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

# Knowledge Base

> Upload documents and crawl websites to give your agent accurate, up-to-date answers grounded in your content.

The knowledge base powers Agentic Trust's RAG (Retrieval-Augmented Generation) pipeline. When a user asks a question, the agent searches your uploaded content for relevant passages and uses them to generate an accurate answer.

## How it works

1. You upload documents or add website URLs in the dashboard.
2. Content is chunked, embedded using OpenAI `text-embedding-3-small` (1536 dimensions), and stored in PostgreSQL with pgvector.
3. At query time, the agent retrieves the top 3 most similar chunks (similarity threshold: 0.4) and includes them as context.

## Supported file types

<AccordionGroup>
  <Accordion title="PDF" icon="file-pdf">
    Upload PDF documents up to 10 MB. Text is extracted and chunked automatically. Scanned PDFs with embedded text are supported.
  </Accordion>

  <Accordion title="Word (DOCX)" icon="file-word">
    Microsoft Word documents are parsed with full formatting support. Tables and lists are preserved as text.
  </Accordion>

  <Accordion title="Plain text (TXT)" icon="file-lines">
    Raw text files are chunked by paragraph boundaries.
  </Accordion>

  <Accordion title="Markdown (MD)" icon="file-code">
    Markdown files are parsed with heading-aware chunking so sections stay together.
  </Accordion>

  <Accordion title="CSV" icon="file-csv">
    CSV files are converted to structured text. Each row becomes a retrievable unit.
  </Accordion>
</AccordionGroup>

## Website crawling

You can also add website URLs as knowledge sources. The crawler:

* Fetches the page content and extracts readable text
* Follows internal links to crawl related pages
* Re-crawls on demand when you trigger a refresh from the dashboard

<Steps>
  <Step title="Add a website source">
    Go to **Knowledge** in the dashboard sidebar and click **Add Source**. Select **Website** and enter the URL.
  </Step>

  <Step title="Wait for ingestion">
    The crawler fetches and processes the pages. Progress is shown in the source list.
  </Step>

  <Step title="Test it">
    Open the chat widget and ask a question about the content you just added.
  </Step>
</Steps>

## Limits

| Resource            | Limit                   |
| ------------------- | ----------------------- |
| Sources per project | 20                      |
| Files per upload    | 15                      |
| Max file size       | 10 MB                   |
| Supported formats   | PDF, DOCX, TXT, MD, CSV |

<Note>
  The knowledge base uses cosine similarity search. If the agent isn't finding relevant content, try breaking large documents into smaller, topic-focused files.
</Note>
