Chat Interface
The chat interface lets users ask natural language questions and receive answers grounded in the knowledge base. Responses stream in real time with source attribution showing which documents were used.
Available routes
| Route | Title | Default namespace | Retrieval |
|---|---|---|---|
/chat | Cape Help | user_docs | Standard |
/chat/tech | Cape Developer Docs | tech_docs | Smart |
The user-facing chat at /chat is intended for Cape's external customers and searches user documentation by default. The developer chat at /chat/tech targets technical teams, defaults to tech_docs, and uses smart retrieval for more thorough multi-section answers.
Interface controls
Source selector — changes which namespace is queried for the current and all future messages in the session. Options on /chat: User Documentation, Knowledge Base, All Sources. On /chat/tech: Technical Docs, API Reference, Confluence, All Sources.
Language selector — overrides the auto-detected language for the response. Supported: English, Nederlands, Deutsch, Français, Español. Auto-detection is active when the user types; use this selector to force a specific output language regardless of the question's language.
Smart badge — shown on /chat/tech to indicate that smart (agentic) retrieval is active. Smart retrieval runs 2–4 LLM calls and inspects document outlines to fill gaps before generating a response.
Sending messages
Type in the input box and press Enter to send. Shift + Enter inserts a newline. The send button is disabled while a response is streaming.
Conversations
Each browser session maintains a conversationId. This is captured from the first response's meta SSE event and passed back with every subsequent message, so the LLM has access to the full conversation history (last 20 messages). Refreshing the page starts a new conversation; there is no UI to resume a previous one.
All conversations are stored server-side and are visible in the admin panel under Conversations.
Source attribution
Every assistant message includes badges showing which documents were retrieved to generate the answer. Duplicate documents (multiple chunks from the same document) are deduplicated — only the document title is shown.
Embedding in other surfaces
The ChatInterface component is reusable. To embed a scoped chat in another page:
import { ChatInterface } from "@/components/chat/ChatInterface"
const SOURCES = [
{ value: "api_endpoints", label: "API Reference" },
{ value: "tech_docs", label: "Technical Docs" },
]
export default function MyPage() {
return (
<ChatInterface
title="Developer Assistant"
defaultSource="api_endpoints"
availableSources={SOURCES}
retrieval="smart"
placeholder="Ask about the API…"
/>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | "Documentation Assistant" | Header title |
defaultSource | string | — | Namespace selected on load |
availableSources | { value, label }[] | — | Options in the source dropdown |
retrieval | "standard" | "smart" | "standard" | Retrieval mode |
placeholder | string | "Ask a question…" | Input placeholder |
apiKey | string | — | Bearer token if the embedding surface requires auth |
Authentication
The chat pages themselves require no authentication. The underlying /api/v1/chat endpoint also requires no API key when called from the browser without an Authorization header. If embedding the chat in an authenticated context where an API key should be scoped per request, pass it via the apiKey prop.