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

# Search across everything the company knows

> One question, answered from the documents, decisions and conversations you have already fed it.

[← All use cases](/use-cases/overview)

<div className="uc-examples"><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/document_qa.py">document\_qa.py</a><a href="https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py">memory\_basics.py</a></div>

## The scenario

The answer exists. It is in a design doc, or a thread, or a deck from last
quarter, and the person who knows which is on leave.

Keyword search fails here because the document does not use your words. You are
asking "why do we bill on ingest?" and the doc says "retention-time accounting".

## Step 1 — Put the sources in one space

```python theme={null}
for path in ["rfcs/", "decisions/", "postmortems/"]:
    for f in Path(path).glob("*.md"):
        client.upload_file(space_id="company", file=str(f), tags=[path.strip("/")])
```

Tag by source so a later question can be narrowed without a second space.

## Step 2 — Ask, in your own words

```python theme={null}
print(client.reason(
    space_id="company",
    query="Why do we bill on ingest rather than on storage?",
))
```

Extraction stores meaning, not just tokens, so a question phrased in the words
you actually have finds a document written in the words you do not.

## Step 3 — Show where it came from

```python theme={null}
res = client.retrieve_receipt(space_id="company", query="billing model rationale", receipt_detail="full")
for row in res.memories:
    print(row["content"][:100], "→ document", row.get("document_id"))
```

For internal search this matters more than it looks. An answer with no source is
a rumour, and people are right not to act on it.

## Evals

1. Collect ten questions your team asked in Slack that were answered by a link.
2. Ask all ten and score against the linked document.
3. Deliberately ask one using vocabulary that appears nowhere in the corpus. A
   semantic system should still find it; if it does not, the source is missing
   rather than the search being bad.
4. Check `document_id` resolves for every answer you would act on.

## Guardrails

<Warning>
  **Access control is per space, not per document.** Everything you upload into
  one space is readable by everyone with access to it. Do not mix a public
  handbook with board material and rely on the question not being asked — use
  separate spaces.
</Warning>

* **Stale beats missing, but only just.** An archived RFC answers as
  confidently as a current one. Tag by status and filter, or
  [supersede explicitly](/use-cases/correct-a-memory).
* **`reason` costs more than `retrieve`.** Use retrieve where the user can read
  the results themselves, and reason where they need them synthesised.
* **Don't ingest everything.** A corpus of drafts, duplicates and superseded
  versions produces confident contradictions; curate at the folder level.

## Built from

Both are complete, runnable scripts:
[`document_qa.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/document_qa.py),
[`memory_basics.py`](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py).
