Docs/Knowledge Base/Knowledge Base Overview

Knowledge Base Overview

The Knowledge Base is where your agent learns. Every answer your agent gives is grounded in the content you add here — it never draws on generic internet knowledge. You can train the agent using four source types: uploaded files, website URLs, manual Q&A pairs, and Notion pages.

How retrieval works (RAG)

AIChatVault uses Retrieval-Augmented Generation (RAG) with a hybrid search pipeline that combines vector semantic search and keyword matching to find the most relevant content for each question.

Step 1 — Embedding the question

When a visitor sends a message, the text is converted into a numerical vector using an on-premise embedding model (all-MiniLM-L6-v2). This captures the semantic meaning of the question, not just its keywords.

Step 2 — Dedicated Q&A retrieval

The system runs a separate vector search specifically over your Manual Q&A sources. Up to 4 matching Q&A entries are reserved and placed at the very top of the context window, before any other content. This guarantees that FAQ answers, policies, and pricing you wrote manually always surface in answers, even when other documents are more similar on a raw score basis.

Step 3 — General vector search

A second search runs over all knowledge sources (files, website pages, Notion) and returns the top 5 most semantically similar chunks. Only chunks scoring above the relevance threshold are included — this filters out loosely related passages that could confuse the answer.

Step 4 — Keyword boost

A hybrid keyword pass searches for exact words from the question across all source content. Matching chunks that were not already found by the vector search are added, with scores deduplicated to keep the highest-scoring version of each chunk.

Step 5 — Context assembly and response

Retrieved chunks are assembled into a prompt: Q&A results first, followed by document and website chunks. The agent's system prompt, conversation history, and this retrieved context are sent to the AI model, which generates a grounded response based exclusively on your content.

ℹ️
If no relevant content is found above the relevance threshold, the agent will say it doesn't know rather than guessing. This prevents hallucinations and keeps answers trustworthy.

Source types

TypeBest forRetrieval priority
Manual Q&AFAQs, policies, pricing — exact answers you controlHighest — dedicated 4-slot search, always first in context
FilesProduct manuals, knowledge articles, PDFs, spreadsheetsStandard vector + keyword search
WebsitesHelp centre pages, blog articles, public documentationStandard vector + keyword search
NotionInternal wikis, SOPs, team knowledge basesStandard vector + keyword search

Source lifecycle

Every knowledge source goes through a processing pipeline after it is added:

StatusMeaning
PendingSource is queued and waiting to be processed.
ProcessingContent is being extracted, split into chunks, embedded, and indexed.
CompletedSource is fully indexed and active in retrieval.
FailedProcessing encountered an error. Check the source URL or file and try again.

The agent can only retrieve content from sources that have reached the Completed status. Sources are automatically removed from the vector index when deleted.

How chunks work

Content is never stored as one large block. Each source is split into smaller overlapping chunks before being indexed. Each chunk is individually embedded and stored in the vector database. When the agent retrieves context, it retrieves individual chunks — not entire documents — so only the relevant section is included in the prompt. This keeps context windows efficient and answers focused.

💡
For best retrieval accuracy: use clear headings in documents, keep Q&A answers concise and factual, and add multiple question phrasings for each common topic.

Was this page helpful?