Goal: Prepare one small document for retrieval.
Prerequisites: Use a source document you are authorized to share with the agent.
Expected result: A readable document with descriptive headings and a clear source of truth.
Choosing the Right File Formats
Not all documents are created equal. Format and structure directly impact how well the AI retrieves and uses information. raia can ingest almost anything, but Markdown (.md) and JSON (.json) are the gold standards for AI training.
| Format | Recommendation | Why |
|---|---|---|
| Markdown (.md) | Best | Markdown uses clear headers and bullets, which perfectly map to how the AI chunks information. |
| JSON (.json) | Best for data | Ideal for structured data like product catalogs, pricing matrices, or large Q&A sets. |
| PDF (.pdf) | Good | Works well if the PDF is text-heavy and cleanly formatted. Avoid PDFs that are scanned images of text. |
| Word (.docx) | Acceptable | raia Command converts Word to Markdown automatically, but complex formatting may be lost. |
| CSV / Excel | Avoid | Spreadsheets flatten data and lose context. Convert tables to JSON before uploading. |
| Slide decks | Avoid | Slides contain disjointed text, floating text boxes, and missing context. Copy the core text into a Markdown file instead. |
Three Rules for Formatting Content
If you want your agent to give smart, accurate answers, feed it well-structured documents. Follow these three rules before uploading:
Rule 1: Use Structured Headings
Break up walls of text. Use clear, descriptive headings for every section. The AI uses headings to understand the context of the paragraphs below them.
Bad:
Our company was founded in 2015 and we offer three plans. The basic plan costs $10/month and includes 5 users. The pro plan costs $25/month and includes 20 users. The enterprise plan is custom pricing.
Good:
# Pricing Plans
## Basic Plan
- Price: $10/month
- Users: Up to 5
- Features: Core dashboard, email support
## Pro Plan
- Price: $25/month
- Users: Up to 20
- Features: All Basic features + API access, priority support
Rule 2: Keep Sections Focused
Keep each section between 200 and 500 words. Split a 50-page handbook into smaller logical files (e.g., handbook_intro.md, handbook_benefits.md, handbook_policies.md).
Rule 3: Use a Consistent Q&A Format
If you are uploading FAQs, use a consistent structure so the AI learns the pattern:
## What is the refund policy?
Our refund policy allows returns within 30 days of purchase. To initiate a refund, contact support with your order number.
## How do I reset my password?
Navigate to Settings > Security > Reset Password. You will receive a confirmation email within 5 minutes.
Tools Available
raia provides free tools to help you prepare documents:
- Convert to Markdown: Available at
https://convert.raia.run— converts any file to optimized Markdown - PDF Splitter: Available at
https://pdf.raia.run— splits large PDFs into smaller, focused documents
Pro Tip: Product details, pricing, and policies belong in the Knowledge Base. The Instructions should only contain the rules of engagement — how the agent should behave, not what it should know.
Practice check
Recommended practice: write two questions answered by the document and record the exact supporting passages before uploading.