Live Chat Assistant
BellamyBook Assistant answers product questions using your docs-app markdown and OpenAI (default gpt-4o-mini). It replaces the old n8n webhook proxy.
How it works
- Frontend or docs widget
POST /api/live-chat/sendwith headerX-Live-Chat-Token. - API validates the token and applies IP + session rate limits.
- Docs are loaded from
LiveChat:DocsPath, chunked, and ranked with a cheap keyword score (synonyms, light typo fix, FAQ pin — no embedding API cost). Public Q&A (founder, GitHub, contact, pricing) lives in FAQ. - Top chunks + recent Redis session history are sent to OpenAI Chat Completions.
- Response shape:
{ "output": "..." }(widgets also acceptmessage/text).
Configuration
| Key | Description |
|---|---|
LiveChat__Enabled | Turn the endpoint on/off |
LiveChat__Token | Shared secret with frontend / docs widgets |
LiveChat__OpenAiApiKey | OpenAI API key |
LiveChat__Model | Default gpt-4o-mini |
LiveChat__DocsPath | Folder of docs markdown (Docker: /app/docs) |
LiveChat__SessionRateLimitPerMinute | Per-session Redis limit |
LiveChat__DailyRequestLimitPerIp | Soft daily OpenAI request cap per IP |
Also keep AspNetCoreRateLimit rule post:/api/live-chat/* (15/min, 60/hour).
Client env
- Frontend:
VITE_SOCIAL_ENABLE_LIVE_CHAT,VITE_LIVE_CHAT_TOKEN - Docs-app build:
LIVE_CHAT_ENABLED,LIVE_CHAT_API_URL,LIVE_CHAT_TOKEN
See Self-host: Live Chat.