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

# Prepare documents for RAG

> Prepare clear, complete reference documents for your Anam persona, preserving context, exceptions, tables, and source information.

A knowledge search returns passages from your documents. Prepare each passage so your persona can understand it without the surrounding pages: name the subject, keep conditions beside the facts, and preserve the source.

Start with the [document template](/docs/personas/knowledge/document-template), or jump to the task you need. All examples on this page are fictional.

| I want to…                                    | Go to                                                                     |
| --------------------------------------------- | ------------------------------------------------------------------------- |
| Decide what belongs in each file              | [Organize your documents](#organize-your-documents)                       |
| Make facts easy to interpret                  | [Write clear, complete facts](#write-clear-complete-facts)                |
| Keep restrictions with the facts they qualify | [Keep critical rules with the facts](#keep-critical-rules-with-the-facts) |
| Combine sources without losing details        | [Remove duplication](#remove-duplication)                                 |
| Preserve a PDF, table, or procedure           | [Preserve formatting and steps](#preserve-formatting-and-steps)           |
| Resolve sources that disagree                 | [Handle conflicting information](#handle-conflicting-information)         |

Choosing which material a persona should access? See [Set the knowledge scope](/docs/personas/knowledge/setup#set-the-knowledge-scope).

## Organize your documents

**Scenario:** You have several manuals, policies and FAQs to upload.

**Aim:** Each file covers a useful topic and keeps its conditions together.

| Don't                                                            | Do                                                            |
| ---------------------------------------------------------------- | ------------------------------------------------------------- |
| Combine returns, installation and billing in `everything.pdf`.   | Use a focused document for each subject.                      |
| Put a refund deadline in one file and its exclusions in another. | Keep the policy, eligibility and exceptions together.         |
| Create a new file for every question.                            | Group closely related questions under descriptive headings.   |
| Split or merge just to reach a target file count.                | Choose boundaries based on the questions users need answered. |

**Example**

Instead of one “Customer handbook”, create:

* `returns-policy.md`: deadline, eligibility, exclusions and process.
* `installation-guide.md`: requirements, steps and completion checks.
* `billing-faq.md`: payment methods, invoices and billing questions.

Separate regional policies when their rules differ substantially. Use clearly labeled sections when the differences are small enough to explain together.

**Quick check:** Can someone understand the topic and its important restrictions from this file without hunting through unrelated documents?

Anam processes uploaded documents into searchable passages. Inspect a retrieved passage: even a well-organized file can be split at an unhelpful point. There is no universal file count or document length that guarantees accuracy.

## Write clear, complete facts

**Scenario:** The persona finds a passage but misinterprets what it applies to.

**Aim:** A fact remains clear when read outside the full document.

| Don't                                               | Do                                                                                     |
| --------------------------------------------------- | -------------------------------------------------------------------------------------- |
| “This includes priority support.”                   | “The Business plan includes priority support during published support hours.”          |
| Put an exception several pages away from the claim. | Keep the exception beside the claim or in the same table row.                          |
| Use only an internal acronym.                       | Include the full term and its recognized abbreviation, such as “single sign-on (SSO)”. |
| Turn “up to 12 hours” into “lasts 12 hours”.        | Preserve the maximum, test conditions and source.                                      |

**Example**

**Don't:** “Support resolves issues within two hours.”

**Do:** “The Business plan has a two-hour initial response target during support hours. This is not a resolution deadline.”

The second wording preserves what the source actually measures. Similarly, listing supported configurations does not establish which configuration suits every user. Include decision criteria only when the source provides them.

**Quick check:** Does the passage identify the relevant plan, version, audience or region? Could a reader mistake a target for a guarantee?

Short passages can lose their original context. Clear names and nearby qualifications help them remain interpretable when retrieved alone.

## Keep critical rules with the facts

**Scenario:** The persona retrieves a deadline, price, or procedure without the restrictions that govern it.

**Aim:** Each passage includes the conditions needed to use it correctly, even when retrieved on its own.

| Don't                                                               | Do                                                                            |
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| Put all restrictions in a separate “Important information” section. | Repeat the relevant restriction beside each affected instruction or table.    |
| Write “subject to the conditions above”.                            | State the conditions needed to interpret that section.                        |
| Put a table's eligibility rule only in a distant footnote.          | Include it in the table heading, affected rows, or immediately adjacent text. |
| Copy the entire safety policy into every section.                   | Repeat a short, specific qualification and retain the full policy separately. |

**Example: a fictional returns policy**

**Weak passage**

> Returns are accepted within 30 days.

**Self-contained passage**

> For online purchases in Region A, unused items can be returned within 30 days of delivery. Personalized items are excluded.

Include those conditions wherever the document explains the deadline or return procedure. Preserve this useful repetition when [removing duplication](#remove-duplication).

### Check how context reaches the model

Inspect the [passages returned by search](/docs/personas/knowledge/testing#inspect-retrieved-passages) to check that rules and exceptions stay together.

A passage is only as complete as the text around it in your source file. Where a restriction matters, put it in the same paragraph, table row, or step as the claim it qualifies, rather than relying on a nearby section to travel with it. Carry the identifying details a reader would need — product, version, region, effective date — into the text itself, since a filename or a document property is not part of the passage the model receives.

Check the result rather than assuming: retrieve the passage and read what actually comes back.

### Enforce behavioral guardrails in your application

“Personalized items are excluded” belongs beside the returns policy. A behavioral rule such as “Never issue a refund without authorization” also needs enforcement in the application. Check authorization in the code that performs the refund; repeating the rule in documents or prompts does not guarantee compliance.

**Quick check:** Retrieve the pricing, eligibility, and procedure sections separately. Does each returned passage include the conditions needed to use it correctly? Include this check in your [knowledge base tests](/docs/personas/knowledge/testing#inspect-retrieved-passages).

## Remove duplication

**Scenario:** A manual, FAQ and sales sheet repeat similar information.

**Aim:** Remove repeated wording while preserving unique evidence.

| Don't                                                     | Do                                                                                |
| --------------------------------------------------------- | --------------------------------------------------------------------------------- |
| Keep only the shortest summary.                           | Compare the details before choosing what to retain.                               |
| Delete a table because its topic appears in the overview. | Preserve unique values, conditions and exceptions from the table.                 |
| Copy the complete policy into every FAQ.                  | Maintain one main policy document; keep any necessary short summaries consistent. |
| Treat repeated copies as independent confirmation.        | Trace the claim to its original source.                                           |

**Example**

An overview says: “Business customers receive priority support.”

A policy adds: “The initial response target is two hours during support hours. Training requests are excluded.”

**Don't:** Replace both with the overview sentence.

**Do:** Retain the response target, hours and exclusion in the main support policy, with its source reference.

**Quick check:** Compare the old and new versions for every number, limit, exception and procedural step. Record why any unique information was removed. Preserve the original files separately.

Keep short, repeated restrictions that make individual passages complete. See [Keep critical rules with the facts](#keep-critical-rules-with-the-facts) for the distinction between necessary context and redundant copies.

If a tool response still repeats overlapping passages after source cleanup, contact support with the query and repeated passages. Editing documents does not fix every form of duplication. Reusing a document in separate searches is not itself a defect.

## Preserve formatting and steps

**Scenario:** You are uploading a PDF, price table or step-by-step procedure.

**Aim:** The extracted text preserves the relationships shown in the original.

| Don't                                                          | Do                                                                       |
| -------------------------------------------------------------- | ------------------------------------------------------------------------ |
| Assume a readable PDF produces readable extracted text.        | Check the extracted or retrieved passage against the page.               |
| Upload a table with unexplained values such as “20 / 30 / 50”. | Include row labels, units, currency and billing period where applicable. |
| Separate a footnote from the rows it qualifies.                | Keep the qualification with the affected values.                         |
| Summarize a procedure by deleting preparation steps.           | Preserve prerequisites, order and completion checks.                     |

**Example**

**Don't:** “Install the update and restart.”

**Do:** “Before updating, create the backup required by the installation guide. Install the update, restart, then run the documented verification check.”

Use the second wording only when those steps are supported by the source. Do not invent missing steps to make a procedure seem complete.

**Quick check:** Look for missing columns, misplaced footnotes, broken reading order and images containing essential text. Use a supported format that preserves these details; clean Markdown or text may help, but still check the result. Flag unreadable material for correction instead of guessing its contents.

For an update question, test whether the persona includes the prerequisite as well as the main action.

## Handle conflicting information

**Scenario:** Two sources give different answers to the same question.

**Aim:** Preserve valid differences and make unresolved conflicts explicit.

| Don't                                           | Do                                                              |
| ----------------------------------------------- | --------------------------------------------------------------- |
| Pick whichever file was uploaded most recently. | Check the source's authority, version and effective date.       |
| Assume different values are contradictory.      | Compare region, audience, product version and conditions first. |
| Average two conflicting deadlines.              | Ask the responsible owner to establish the applicable rule.     |
| Delete an uncertain claim without a record.     | Preserve its source and state exactly what remains unconfirmed. |

**Example**

Source A gives a 14-day return period. Source B gives 30 days.

**Don't:** Publish “Returns are accepted within 30 days” for everyone.

**Do:** If the sources cover different regions, label each rule with its region. If both cover the same region and effective period, record the conflict and withhold a definitive deadline until the policy owner resolves it.

Keep internal discussions and review notes outside the persona's knowledge folders. In the reference document, explain any remaining uncertainty beside the affected fact. For example: “The return period for UK purchases is awaiting confirmation because the two source policies give different deadlines.”

**Quick check:** Have you identified the conflicting rules, their sources, who they apply to, and who will resolve the disagreement? Record policy effective dates separately from the dates you reviewed the documents.

## Next steps

<CardGroup cols={2}>
  <Card title="Upload documents" icon="file-arrow-up" href="/docs/personas/knowledge/uploading-documents">
    Upload your prepared files and check processing status.
  </Card>

  <Card title="Upload checklist" icon="list-check" href="/docs/personas/knowledge/upload-checklist">
    Check your sources before upload and your results afterwards.
  </Card>
</CardGroup>
