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

# Financial analyst across quarters

> Ask what changed between Q2 and Q4 and get an answer grounded in what was said at the time.

[← All use cases](https://docs.memory.anonalabs.com/use-cases/overview.md)

[time\_travel.py](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/time_travel.py)[memory\_basics.py](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/memory_basics.py)

## The scenario

The numbers are in a spreadsheet. The *reasons* are in eight earnings
transcripts, a dozen board memos and a year of management commentary — and the
question you actually have is "what did they say about margin in Q2, and does it
still hold?"

A search engine over those documents returns the paragraphs. It does not tell
you what changed.

## Step 1 — Load the documents, dated

```python theme={null}
for path, when in [("q2-earnings.pdf", "2026-06-30"), ("q3-earnings.pdf", "2026-09-30")]:
    client.upload_file(space_id="filings", file=path, tags=[f"period:{when[:7]}"])
```

Tags carry the period so a later question can be pinned to one, and uploads are
asynchronous — poll `get_job`, or take the
[webhook route](https://github.com/anonalabs/Anona-Memory-SDK/blob/main/examples/webhooks_and_settings.py).

## Step 2 — Bound the question by period

```python theme={null}
client.retrieve(
    space_id="filings",
    query="gross margin commentary",
    tags=["period:2026-06"],
    tags_match="any_strict",
)
```

The period tag is what pins the question to a quarter, and it has to be:
everything was uploaded on one afternoon and none of it happened then, but an
uploaded file does not carry event time today — the `occurred_after` /
`occurred_before` filters match nothing extracted from a file. They work on
memories you [`record` with a timestamp](https://docs.memory.anonalabs.com/use-cases/what-was-true-back-then);
for documents, the tag you set on upload is the date. `any_strict` matters: the
plain `any` mode also matches untagged memories, which would let undated
material back into a pinned question.

## Step 3 — Ask the comparative question

```python theme={null}
print(client.reason(
    space_id="filings",
    query="What did management say about margin pressure in Q2, and how did that change by Q3?",
))
```

## Step 4 — Keep the receipt

```python theme={null}
res = client.retrieve_receipt(space_id="filings", query="margin pressure", receipt_detail="full")
print(res.receipt_id)
```

Store the receipt id next to the answer. When somebody challenges the number six
months from now, [the receipt says exactly what the model
saw](https://docs.memory.anonalabs.com/use-cases/why-the-answer-used-what-it-used.md).

## Evals

1. Load two consecutive quarters where you know a metric moved.
2. Ask the comparative question. Check both periods are actually represented in
   the answer, not just the more recent one.
3. Re-run pinned to one quarter's tag and confirm the other drops out — if it
   does not, check the tag actually went on at upload.
4. Pull the receipt and confirm the cited memories come from both filings.

## Guardrails

> [!WARNING]
>
> **This is not investment advice, and it must not be presented as any.** The
> system retrieves and summarises what was said. It does not know whether the
> guidance was met, and it will summarise a misleading statement as confidently
> as an accurate one.

* **Numbers in prose are the weakest part.** An extracted memory is text, and a
  figure that matters should be checked against the filing rather than trusted
  from a summary. The receipt gives you the path back.
* **`relevance_score` can exceed 1.0** and is not a confidence. It is a ranking
  signal within one result set.
* **Uploads carry no event time.** Every fact from a file is undated, so the
  `occurred_*` filters and point-in-time reads cannot tell one filing's quarter
  from another's. Tag the period on upload, as above, and filter on the tag.

## Built from

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.