Skip to main content
Knowledge bases connect external documents, FAQs, product material, or business data to an agent. The model can retrieve trusted material before answering. VeADK Go provides the knowledgebase package and backend directions such as local, OpenSearch, Redis, and Viking.

Minimal Local Example

The local backend is the fastest way to validate the knowledge-base path. It does not require an external service. Write a few text snippets with AddFromText, then attach the KnowledgeBase to llmagent.
The local backend also supports AddFromFiles and AddFromDirectory, which is useful when testing with Markdown files, FAQs, or a small document set.

Viking Knowledge Example

Production deployments normally use a managed knowledge service or vector retrieval backend. The following flow is based on examples/knowledgebase/agent_with_knowledge.go: create the Viking backend, ingest text, and pass the knowledge base into the agent.
VikingKnowledgeBackend uses Viking Knowledge and TOS. Pass credentials with AK, SK, and SessionToken, or use the team’s standard runtime credential injection.

Backend Selection

Ingest and Search Interface

All backends implement the same KnowledgeBackend interface:
Call Search directly when debugging the retrieval path:

Relationship to the Agent

After KnowledgeBase is passed into veagent.Config, VeADK Go lets the agent use the knowledge-base tool when external material is needed. Make the retrieval policy explicit in the instruction, for example: “search the knowledge base before answering product facts” and “say when no relevant material is found.”

Use cases

  • Product documentation Q&A.
  • Internal knowledge search.
  • Answers that need current business material.
  • Restricting retrieval to trusted sources.

Knowledge versus memory

Knowledge bases usually hold shared team or product material. Long-term memory is usually scoped to users, sessions, or task history.

Troubleshooting

Last modified on October 20, 2026