KnowledgeBase) is an agent’s external source of knowledge — a place to store static material such as product docs, FAQs, and articles. Attach it to an agent and VeADK automatically injects a retrieval tool, so the agent retrieves relevant snippets before answering and produces more accurate, better-grounded responses (RAG).
Unified entry point: KnowledgeBase
Regardless of the backend, everything goes through the unified veadk.knowledgebase.KnowledgeBase. It selects the storage backend through backend and exposes a consistent ingestion and retrieval interface. Ingestion supports three sources:
- From files:
kb.add_from_files([...]); - From a directory:
kb.add_from_directory("./docs"); - From text:
kb.add_from_text([...]).
Common parameters
The fields ofKnowledgeBase are common to all backends:
Vector backends (
local, opensearch, redis, milvus, and tos_vector) embed knowledge text locally and require the extensions extra plus an embedding model. viking, context_search, and openviking process resources server-side and do not need a local embedding model.Choosing a backend
Uselocal for development. Choose viking, context_search, or openviking for managed retrieval, or opensearch, redis, milvus, or tos_vector when you already operate a vector store.
Binding to an agent
Passknowledgebase to Agent and the agent automatically gains a load_knowledgebase tool, deciding on its own whether to search the knowledge base when answering.
Direct retrieval
Besides automatic retrieval at agent runtime, you can callsearch directly for semantic search, useful for debugging or custom RAG. A top_k of 0 uses the value set at construction.