Document types
You can add content to a knowledge base in three ways:| Type | Supported formats | Max size |
|---|---|---|
| File | PDF, TXT, DOCX, HTML, EPUB | 21 MB per file |
| URL | Any publicly accessible web page | — |
| Text | Plain text pasted directly | — |
On non-enterprise plans, the total knowledge base size per agent is limited to 20 MB or 300,000 characters, whichever is reached first.
Add documents via dashboard
Open your agent
Go to the XUNA AI dashboard and select your agent.
Add a document
Click Add document and choose File, URL, or Text. Fill in the required fields and click Save.
Add documents via API
- Python
- TypeScript
Create documents and attach them to an agent programmatically using the Python SDK.After creating documents, attach them to your agent:
attach-to-agent.py
Best practices
Chunk content into focused documents
Chunk content into focused documents
Rather than uploading one large document, split content into smaller, focused files. Retrieval works by matching user queries to document chunks — smaller, topic-focused documents improve match quality.
Use descriptive document names
Use descriptive document names
Name documents clearly (e.g., “Return policy — US”, “Product specs — Model X”). The retriever uses document names as signals during ranking.
Keep URLs current
Keep URLs current
URL-based documents are fetched and indexed at creation time, not on every conversation. Re-add the document if the source page changes significantly.
Supplement, don't replace the system prompt
Supplement, don't replace the system prompt
Use the knowledge base for reference content (FAQs, product specs, policies). Keep behavioral instructions in the system prompt — they are always in context, not retrieved.
Test retrieval quality
Test retrieval quality
After adding documents, start a test conversation and ask questions that should be answered from the knowledge base. Check the conversation transcript to see which passages were retrieved.

