Chatbot Service
Chatbot Service is the Python + FastAPI service that acts as RAGA's inference engine — this is the concrete implementation of the concept described on the Raga Engine page. It accepts a user question along with a list of relevant knowledge sources, gathers context from Elasticsearch and supporting services in parallel, dynamically assembles a system prompt, then calls one of several LLM providers to generate an answer.
Chatbot Service is called by API Tarantula (env var CHATBOT_URL) whenever a chat message comes in for a workspace.
Tech Stack
| Component | Technology |
|---|---|
| Runtime | Python (FastAPI + uvicorn) |
| Search / Knowledge Index | Elasticsearch |
| LLM Client | openai SDK (OpenAI-compatible, used for every provider) |
| Observability | OpenTelemetry (traces + FastAPI/requests/logging instrumentation) |
| Secret Management | infisical_sdk (Python) |
Full environment variable, endpoint, and prompt-assembly flow details are on the Technical page.
How It Works
- The caller sends
POST /chatbotwith the user's question, a list of relevant knowledge sources (km), the selected LLM provider, and various flags (chain,image,files,source,think, etc.). - If the provider is a local model (
local/local_v2), the request waits (polling) until the VLLM queue has an available slot before proceeding. - All five knowledge source types (basic, document/OCR, audio, database, API) are fetched in parallel — one source failing does not fail the others (
degraded_sourcesis reported back to the caller). - For database and API sources, Chatbot Service doesn't query directly: it asks the LLM to compose the right query/call, then executes it through Database Connect and API Connect.
- All context (knowledge sources, chat history, uploaded files, image descriptions, personalization) is merged into a single system prompt, sent to the LLM, and the answer is returned — either all at once or as a stream.
Summary
Chatbot Service is RAGA's brain: it orchestrates five types of knowledge sources, delegates Text-to-SQL and Text-to-API to other services, then weaves everything into one coherent conversation through any of six supported LLM providers.