Knowledge base (RAG)
Router: app/server/routers/kdb.py. All route prefixes in the main doc use /api/knowledge-base.
How this ties to other features
- Agents: set
kdb_ids inAgentConfigDTO.availableKnowledgeBases(or the snake_case alias) so the runtime can attach the right retrieval to that agent. Exact enforcement is in the chat/agent wiring layer, not the KDB router alone. - Tools: some UIs go through a tool that wraps
POST .../retrieveinstead of calling HTTP from the client—same backend, different surface for auth/auditing.
Suggested integration order
POST .../addand storekdb_id.POST .../doc/add_by_filesto ingest files; capturetaskId.- Poll
.../doc/task_processand/or.../doc/listuntil processing is healthy; use.../redopaths when you need a rerun. POST .../retrieveto validate RAG end-to-end.- Add the
kdb_idto agent config or your own orchestration.
Common pitfalls
- Delete vs clear:
DELETE /api/knowledge-base/delete/{kdb_id}vsPOST .../clearhave different semantics. - Task IDs here are ingestion jobs for that KDB, not the
/tasksscheduler in HTTP_API_TASKS.md nor the async work in HTTP_API_AGENT.md. - Re-read the main doc’s table of query parameters for
doc/listanddoc/task_processbefore you script filters.