首页 > AI前沿 > Show HN: Bolnee-Chat – Self Hosted Chatbot Integration in Your Business Website

Show HN: Bolnee-Chat – Self Hosted Chatbot Integration in Your Business Website

Hacker News 2026-08-30 17:56 2 阅读 查看原文
Bolnee-Chat Chatbot integration in your business website. Self hosted, free forever! Bolnee-Chat is a self-hosted RAG chatbot platform. Create a bot, add your website + PDFs as knowledge, pick any OpenAI-compatible provider (OpenRouter, OpenAI, Groq, Ollama, vLLM), and embed a 2-line snippet. Answers are grounded in your sources with citations, visitor chats are grouped and exportable, and everything runs on your infrastructure with SQLite. Why Bolnee-Chat? Self-Hosted & Free Forever No vendor lock-in, no per-message billing. Run on your server, Vercel or Cloudflare Pages — SQLite, no external DB. RAG-Grounded Answers Crawls your site + ingests PDFs/TXT/MD/DOCX, chunks to SQLite FTS and builds grounded prompts. Sources are cited, fallback is configurable. 2-Line Embed, Any Stack Copy window.BotConfig + chatbot-widget.js and paste before . Works on any site, accent/theme/greeting live via dashboard. All Features Bot Overview — Stats & Snippet Per-bot: Live status, message/user counts, creation date, source count, embed snippet with botName/avatar/chatUrl/accent/greeting/theme. Appearance — Live Preview Edit bot name, avatar (upload/preview), accent/background colour, theme light/dark/auto, greeting. Live preview; saved via PATCH /api/chatbots/:id. Chats — Grouped by Visitor Grouped by visitorId → IP, then by date, chronological. Refresh + download CSV (Excel) / JSON / PDF (print). Active sessions = distinct visitors last 5m. Settings — Provider, Prompts, Danger Zone provider/model/baseUrl/apiKey, default message (pre-first-turn), fallback message (no sources matched), delete bot + chats + sources + chunks. Widget — Floating, Theme-Aware, Persistent Bottom-right bubble → sliding window (360×520, 75vh mobile). Header with accent + avatar, typing dots, SSE streaming, sources cited, VISITOR_ID + history in localStorage so greeting shows once and chats survive close/open. Theme light/dark/auto (#0f172a / #fff). Also in the box: Knowledge management — lists locator · type · status · error · date with delete; append more via Add knowledge. Avatar file storage — data URLs converted to /api/public/avatar/:id (2MB limit, data/avatars/). Encrypted provider keys — per-bot apiKey/baseUrl/model via AES-256-GCM, never exposed in snippet. Dark-mode console — #020617 bg, #1e293b cards, slate-800 inputs, no white surfaces. Workflow 1. Create Chatbot — Brand in Seconds Name + avatar (PNG/JPG/WEBP ≤2MB, preview) → stored as /api/public/avatar/:id and shown in the widget header. 2. Add Knowledge — Website + Files URL-only, files-only, or both. Same-origin crawler (crawler/crawler.py) respects robots.txt, extracts h1/h2/p/li, dedups, saves data/{chatbotId}_website.json. Status: queued → crawling → parsing → indexing → indexed. 3. Configure Provider — Any OpenAI-Compatible API Pick provider → Base URL auto-fills → paste API key → Fetch models lists live models (prioritizes :free for OpenRouter). Keys stored encrypted (AES-256-GCM), never in embed. 4. Embed — 2 Lines Copy from Overview → Embed code or Knowledge → Step 4. Auto-configures origin via window.location.origin; widget loads via chatbot-widget.js with SSE streaming. Requirements Tech Stack Installation # Clone git clone https://github.com/AniketWathore/bolnee-chat.git cd bolnee-chat # Env cp .env.example .env # edit .env — simplest self-hosted: # DISABLE_AUTH=true # JWT_SECRET=change-me-32-chars # LLM_BASE_URL=https://openrouter.ai/api/v1 # optional global fallback # LLM_API_KEY=sk-or-v1-... # optional global fallback # LLM_MODEL=inclusionai/ling-3.0-flash-fin:free # Install npm install # Python crawler deps (optional) pip install aiohttp beautifulsoup4 lxml requests brotli # Verify npm run lint # tsc --noEmit npm run build # vite + esbuild → dist/ npm run dev # http://localhost:3000 (auto-fallback to 3001 if busy) SQLite is created at data/bolnee.db (git-ignored). Crawled sites → data/{chatbotId}_website.json, chunks in SQLite. Usage — Dashboard Flow Create chatbot — + New chatbot → name + avatar (preview ≤2MB). Add knowledge — enter https://your-site.com and/or upload PDF/TXT/MD/DOCX/FAQ → status queued → indexed. Configure provider — choose provider → Fetch models → pick model → Save. Keys encrypted, not in embed. Embed — copy snippet from Overview: Paste before . Widget stores VISITOR_ID + chat history in localStorage; greeting shows once. Bot Console Reference API Reference Streaming: public/chatbot-widget.js:311 reads SSE via getReader(), falls back to text() + SW bypass for locked streams. Visitor grouping via X-Visitor-Id (VISITOR_ID in localStorage). File Reference Hosting Dashboard is fully API-driven (/api/* relative) and auto-configures window.location.origin for embed URLs. Vercel: # env DISABLE_AUTH=true # JWT_SECRET not required for simple mode # vercel.json already: rewrites /api/:path* → /api, /(.*) → /index.html, outputDirectory: dist npm run build && vercel --prod Cloudflare Pages / Workers: # wrangler.toml: bucket = "./dist", DISABLE_AUTH=true npm run build wrangler pages deploy dist # or: npx wrangler deploy Chat endpoint streams SSE; for external sites use public https:// chatUrl (not localhost). Configuration .env.example documents all. Troubleshooting Verification Checklist npm run lint # tsc --noEmit clean npm run build # vite + esbuild → dist/ npm run dev # http://localhost:3000 # Manual: # 1. Create bot → avatar preview → Save appearance → preview updates # 2. Add knowledge: URL + PDF → status queued → indexed # 3. Provider → Fetch models → pick :free → Save # 4. Overview → Copy embed → paste in plain HTML → widget loads, greeting once, close/open keeps history, dark/light/auto themes correct # 5. Chats → grouped by visitor → CSV/JSON/PDF export # 6. Settings → default/fallback messages → Chat without sources returns fallback License Distributed under the MIT License. See LICENSE for more information.