Skip to main content

Knowledge Repository

Connect your agents to your documents to give them powerful semantic search capabilities.

This guide walks you through configuring the KnowledgeRepo tool. By enabling Agentic-Retrieval-Augmented Generation (A-RAG), your agents can provide accurate answers based directly on your own data.

πŸ’‘ Core Concepts​

Before diving into configuration, it helps to understand how data ingestion and search scoping work.

1. How it Works​

The Knowledge Repository (KR) indexes your documents, allowing agents to retrieve and analyze relevant content to answer queries accurately instead of hallucinating.

  1. Ingest: Upload your documents (like PDFs) directly, or sync them automatically using SVAHNAR Connectors.
  2. Index: The repository processes your content, including performing OCR on image-based PDFsβ€”to prepare it for semantic search.
  3. Query: Agents fetch the most relevant information to generate accurate, context-aware answers.

2. Supported Data Sources​

You can manually upload files or use Connectors to automatically sync with external sources:

3. Search Scoping​

You can narrow down an agent's search to specific subsets of your data using IDs:

  • Knowledge Repo ID (k_repo_id): Limits the search to a specific repository.
  • Document ID (doc_id): Limits the search to a single document within a repository.

4. Page-Aware Smart Chunking​

To ensure your agents have the best context possible, the repository uses an intelligent chunking strategy:

  • Page-Wise Chunking: Documents are processed page by page. If a paragraph overflows onto the next page, context is maintained without being lost.
  • Smart Length Constraints: For long, continuous documents, the text is strategically broken down based on both length and context to ensure smooth retrieval.
Access Control

Permissions are inherited. If a user has access to an agent connected to a Knowledge Repository, they automatically get access to that repository's data. No separate configuration is needed.


βš™οΈ Configuration Steps​

Follow these steps to connect your agent to a Knowledge Repository.

Prepare your Repository​

Before configuring your agent, make sure your documents are uploaded and fully indexed.

  1. Go to the KnowledgeRepository section in your SVAHNAR dashboard.
  2. Create a new repository or select an existing one.
  3. Upload your files or set up a Connector (like AWS S3 or Confluence).
  4. Copy the Repository UUID (and the Document UUID if you want to restrict searches to a specific file).

Add the Tool to your Agent​

Add the KnowledgeRepo tool to your agent's YAML configuration.

Key Parameter:

  • k_repo_id: The UUID of the repository you want the agent to search.

Instruct your Agent​

Tell your agent when to use this tool within the agent_function section.

  • Example: "If the user asks about internal HR policies, use the KnowledgeRepo tool to find the answer."
  • How it works: The agent automatically generates the search query based on the user's natural language prompt.

πŸ“š Examples​

Use Case: An agent that searches across an entire Knowledge Repository.

create_vertical_agent_network:
agent-1:
agent_name: researcher_agent
LLM_config:
params:
model: gpt-5-mini
tools:
tool_assigned:
- name: KnowledgeRepo
config:
# The UUID of your KnowledgeRepository
k_repo_id: "550e8400-e29b-41d4-a716-446655440000"
agent_function:
- "Search the knowledge repository for relevant passages and answer the user's question."
incoming_edge:
- Start
outgoing_edge: []

Recipe 2: Scoped Search (Specific Document)​

Use Case: An agent restricted to a single document within a repository, like an "Employee Handbook".

create_vertical_agent_network:
agent-1:
agent_name: hr_policy_bot
LLM_config:
params:
model: gpt-5-mini
tools:
tool_assigned:
- name: KnowledgeRepo
config:
k_repo_id: "550e8400-e29b-41d4-a716-446655440000"
# Restrict search to this specific document UUID
doc_id: "123e4567-e89b-12d3-a456-426614174000"
agent_function:
- "You are an HR assistant. Use the KnowledgeRepo tool to answer policy questions found in the handbook."
incoming_edge:
- Start
outgoing_edge: []

πŸš‘ Troubleshooting​

  • "Invalid KnowledgeRepository ID" Error

    • Make sure your k_repo_id is in a valid UUID format.
    • Check for any accidental spaces in your YAML file.
  • "You do not have permission to access..."

    • This happens if the k_repo_id belongs to another organization and isn't marked as is_global.
    • Private Repositories: Only the creator and authorized organization members have access. Double-check who owns the repository.
  • Poor Search Results

    • Check if your documents have finished Indexing. Large PDFs, especially those requiring OCR, can take a while to process.
    • Ensure your documents contain actual text, not just flattened images without OCR.

πŸ’° Credit Consumption​

The KnowledgeRepo tool consumes credits based on the number of pages it indexes. Each page (up to legal size) uses 0.2 credits.