Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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-ups

All steps use transport: "http".

Two 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

Last updated