Knowledge Base Overview
RadarOS provides a KnowledgeBase abstraction for Retrieval-Augmented Generation (RAG). Store documents in a vector store, search by semantic similarity, and expose retrieval as a tool so agents can answer questions using your private data.What is RAG?
Retrieve
Convert documents to embeddings, store in a vector database, and search by semantic similarity.
Augment
Inject retrieved chunks into the LLM context before generating a response.
Generate
The model produces answers grounded in the retrieved content instead of relying only on its training data.
KnowledgeBase Class
Display name for the knowledge base. Used in tool descriptions.
A vector store implementation (InMemory, PgVector, Qdrant, MongoDB).
Collection/index name inside the vector store. Defaults to a sanitized version of
name.Default search strategy.
"hybrid" combines vector + keyword search via Reciprocal Rank Fusion for the best results. See Hybrid Search.Fine-tune hybrid search weights and RRF constant. See Hybrid Search.
asTool() — Expose KB to Agents
The most powerful feature: turn a KnowledgeBase into a ToolDef that agents can call automatically.Tool name exposed to the LLM. Default:
search_<collection>.Custom tool description. Default: auto-generated from KB name.
Number of results to return per search.
Minimum similarity score to include a result.
Metadata filter applied to every search.
Override search mode for this tool. Inherits from KB config if not set.
Custom formatter for search results. Default: numbered list with scores.
Flow Diagram
Add Documents
Use
add() or addDocuments() to ingest content. Embeddings are computed if not provided.Next Steps
- Vector Stores — InMemory, PgVector, Qdrant, MongoDB
- Embeddings — OpenAI and Google embedding providers
- Hybrid Search — BM25, RRF, and hybrid search modes
- RAG Example — End-to-end walkthrough