Build a RAG Q&A bot
A retrieval-augmented support bot: index help articles, then answer user questions grounded in that content.
Pipeline
1. Indexing (one-time / on publish)
addDocument Γ N
2. User question
sendAI({ useKnowledgeBase: true, messages: [...] })
β or β
search β sendAI with injected context
3. Optional: sessionId for follow-upsTwo retrieval strategies
Strategy
Code
Automatic RAG
useKnowledgeBase: true in sendAI
Manual RAG
search then build system prompt with hits
The automatic path is simpler. Manual search gives you control over which chunks appear in the prompt.
Language guides
Language
Guide
JavaScript / TypeScript
Dart / Flutter
Related
Intent router workflow β Route doc questions vs general chat
Last updated