FAQ Chatbot¶
Embeddable AI chatbot trained on your business data with a drop-in website widget.
| Port | 8101 |
| Container | hai-faq-chatbot |
| Use case | Customer support, internal helpdesk, website self-service |
| Compliance | GDPR, CCPA, EU AI Act (limited risk — transparency required), SOC 2 |
How it works¶
- Upload your FAQ content, knowledge base articles, or business documents
- The chatbot indexes everything into a vector database
- Customers ask questions via the embeddable widget or API
- The chatbot retrieves relevant context and generates conversational answers
- Conversation history is maintained per session
EU AI Act: Transparency Requirement¶
EU AI Act — Limited Risk
Under the EU AI Act, chatbots are classified as limited risk and require transparency: users must be informed they are interacting with an AI system. The widget includes a visual indicator. If deploying for EU customers, ensure the chatbot clearly identifies itself as AI-powered.
Embeddable Widget¶
Add the chatbot to any website with a single script tag:
<script>
window.HAI_CONFIG = {
apiUrl: 'https://your-server:8101',
apiKey: 'hai_your_public_key',
title: 'Chat with us',
theme: '#2563eb'
};
</script>
<script src="https://your-server:8101/widget/chatbot.js"></script>
The widget renders as a floating button in the bottom-right corner. Clicking it opens a chat panel.
Widget configuration¶
| Property | Default | Description |
|---|---|---|
apiUrl |
— | Required. Your FAQ Chatbot server URL |
apiKey |
— | Required. API key with Viewer role |
title |
"Chat with us" | Header text in the chat panel |
theme |
#2563eb |
Primary color (hex) |
API Endpoints¶
Send a chat message¶
curl -X POST http://localhost:8101/api/v1/chat/message \
-H "X-API-Key: hai_your_key" \
-H "Content-Type: application/json" \
-d '{"message": "What are your business hours?", "session_id": null}'
Response:
{
"reply": "Our business hours are Monday through Friday, 9 AM to 5 PM Pacific Time. We're closed on weekends and major holidays.",
"session_id": "chat_a1b2c3d4e5f6",
"sources": [{"text": "Business hours: Mon-Fri 9AM-5PM PT...", "score": 0.912}],
"latency_ms": 987
}
Add FAQ entries¶
curl -X POST http://localhost:8101/api/v1/knowledge/faq \
-H "X-API-Key: hai_your_key" \
-H "Content-Type: application/json" \
-d '{
"entries": [
{"question": "What are your hours?", "answer": "Mon-Fri 9AM-5PM PT", "category": "general"},
{"question": "How do I reset my password?", "answer": "Click Forgot Password on the login page.", "category": "account"}
]
}'
Upload knowledge base document¶
curl -X POST http://localhost:8101/api/v1/knowledge/upload \
-H "X-API-Key: hai_your_key" \
-F "file=@support-docs.txt"
Session Management¶
Each conversation maintains context for up to 20 messages. Sessions are automatically created on first message or can be explicitly created:
# Create a new session
curl -X POST http://localhost:8101/api/v1/chat/sessions \
-H "X-API-Key: hai_your_key"
# Get session history
curl http://localhost:8101/api/v1/chat/sessions/chat_a1b2c3d4e5f6 \
-H "X-API-Key: hai_your_key"
Customizing the persona¶
Set the chatbot's personality via environment variable: