# Document memory

> Your agent knows all your contracts, manuals and catalogues, searches by meaning and tells you which document and page each answer came from. How to add it, how a document gets in, and who sees what.

URL: https://www.ghosty.studio/en/docs/document-memory

With **Document memory**, your agent knows all your documents (contracts, manuals, policies, catalogues, case files) and tells you which document and page each answer came from. It understands your question even when you don't use the document's words: ask "how much deposit do I leave?" and it finds the clause that says "a guarantee equal to two months of rent".

## When you need it

Without the memory, the agent reads the documents you gave it in full. That works well with a few documents. When you have dozens or hundreds of PDFs, the memory lets it find the page that matters in seconds, without reading everything every time.

## How to add it

Add it in [Plans](/planes), on the **Document memory** row. Each pack holds **up to 5,000 pages** of your documents and is billed monthly; you can add as many as you need. The agent tells you if you reach the limit.

## How a document gets in

1. Upload the document in **Documents** and give it to the agent, like any other document.
2. The agent indexes it on its own the first time it needs it: it reads the text (scanned PDFs included) and stores it in the memory. Uploading the same document again without changes does not index it again.
3. From then on, when someone asks something, the agent searches the memory and answers citing document and page.

You can also do it from the terminal:

```bash
ghosty agents kb status <id>                                     # pages used and indexed documents
ghosty agents kb add <id> "Contract.pdf" --file ./Contract.pdf   # index a granted document
ghosty agents kb search <id> "how long is the warranty?"         # what the agent finds
ghosty agents kb forget <id> "Contract.pdf"                      # remove it from the memory; the document stays
```

## Who sees what

- The memory only shows documents you gave that agent. Taking a document away removes it from its answers.
- From a customer channel (WhatsApp, Messenger, the widget), the agent only searches the documents that channel can see.
- Indexing and removing documents only happens from one of your team's channels; a customer never changes the memory.
- Your documents live in your own database, separate from other customers'.

## FAQ

**Is it RAG?** Yes: hybrid search (by meaning and by exact words) over your own database, with the source cited.

**What happens if I update a document?** The new version is indexed again and replaces the old one in the memory.

**Does it read scanned documents?** Yes. The agent runs OCR on them before indexing, and checks the page again for important figures.
