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

# Knowledge bases

> Create reusable knowledge collections and attach them to agents.

A knowledge base gives an agent information it can retrieve during a conversation. Use it for product information, policies, support material, or other content that should remain separate from the core prompt.

<Frame caption="The Knowledge Base library shows source counts and processing status for each collection.">
  <img src="https://mintcdn.com/persistence-ai/vTPO-R7syJyo2N_1/images/dashboard/knowledge-base-library.png?fit=max&auto=format&n=vTPO-R7syJyo2N_1&q=85&s=68c757cf10fce78f03a73d043236bd31" alt="Persistence Knowledge Base library showing ready, processing, and failed collections" width="640" height="360" data-path="images/dashboard/knowledge-base-library.png" />
</Frame>

## Create a knowledge base

<Steps>
  <Step title="Open Knowledge Base">
    From the dashboard, open **Knowledge Base** and create a knowledge base with a clear name and description.
  </Step>

  <Step title="Add documents">
    Upload PDF files up to 5 MB each. Wait until processing finishes before attaching the knowledge base to a production agent.
  </Step>

  <Step title="Attach it to an agent">
    Open the agent's settings, select **Knowledge Base**, and add the ready knowledge base.
  </Step>

  <Step title="Test retrieval">
    Ask questions that should be answered, should combine nearby information, and should return a fallback because the answer is absent.
  </Step>
</Steps>

## Keep retrieval reliable

Use **Retrieval Testing** to select a knowledge base, enter a representative query, adjust supported retrieval settings, and inspect the chunks the agent would receive.

<Frame caption="Retrieval Testing makes ranking settings, returned chunks, and query history visible before an agent goes live.">
  <img src="https://mintcdn.com/persistence-ai/vTPO-R7syJyo2N_1/images/dashboard/knowledge-base-testing.png?fit=max&auto=format&n=vTPO-R7syJyo2N_1&q=85&s=79e019a87611b77e07a24aa05c49e4de" alt="Persistence Knowledge Base retrieval testing screen" width="640" height="360" data-path="images/dashboard/knowledge-base-testing.png" />
</Frame>

* Keep each knowledge base focused on one domain.
* Remove obsolete or conflicting documents.
* Use descriptive headings and plain text in source documents.
* Put behavior rules in the agent instructions, not only in the knowledge documents.
* Re-test the agent after adding or deleting a document.

<Note>
  An agent can only use a knowledge base that has finished processing. The agent settings identify knowledge bases that are not ready.
</Note>

Document processing moves through pending, extracting, chunking, embedding, and ready states. Replace a document when it reaches failed or upload failed.

Knowledge base names can contain up to 128 characters and descriptions up to 512 characters.

Deleting a knowledge base or a source document removes it from future retrieval. Review every agent that depends on that content before deleting it.

<Card title="Knowledge Bases API" icon="code" href="/api-reference/knowledge-bases/overview">
  Create, list, inspect, and delete knowledge bases through the public API.
</Card>
