> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbutter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Base

> Retrieval Augmented Generation (RAG) for Agents

The Knowledge Base allows you to upload documents that agents can query during a conversation. This is essential for providing accurate, business-specific information that isn't contained in the LLM's base training data.

## How it Works

1. **Ingestion**: You upload a file (PDF, TXT, DOCX) or raw text.
2. **Indexing**: We split the document into chunks, generate vector embeddings, and store them in a vector database (Pinecone).
3. **Retrieval**: When a user asks a question, the agent performs a semantic search to find relevant chunks.
4. **Generation**: The relevant chunks are injected into the LLM's context window, allowing it to answer accurately.

## Managing Documents

### Supported Formats

* PDF
* Text files (.txt)
* Microsoft Word (.docx)
* Raw text input

### Attachment

Documents are not automatically used by all agents. You must explicitly **attach** a document ID to an Agent ID. This allows you to have different knowledge sets for different agents (e.g., "Sales Agent" vs. "Support Agent").

## Best Practices

* **Chunk-friendly formatting**: Use clear headings and short paragraphs.
* **Specific information**: RAG works best for facts (prices, policies, hours).
* **Update frequency**: If information changes, you must delete the old document and upload the new version.
