WorksComputer Science
TrackMem: Tracking Evolving Beliefs in Long-Horizon Financial Dialogue
Abstract
Memory systems for LLM agents are evaluated mostly on social dialogue, where facts accumulate and rarely change, so remembering reduces largely to finding the turn in which something was said. Financial dialogue breaks this assumption: figures are revised, stances shift without being restated, rules stated once govern later questions, and a single company is discussed under several analytical lenses. Memory systems that retrieve the passages most similar to a question, or the most recent ones, therefore return superseded values, miss rules that share no wording with the question, and cannot recover a stance spread across sessions. We present TrackMem, a per-speaker graph memory that tracks the history of figures, separates perspectives by entity and lens, and preserves each speaker's actions in chronological order. To evaluate it, we introduce FinLoCoMo, a benchmark of 15 long-horizon investment conversations with 765 questions in two splits: one following the LoCoMo categories and one targeting four failure modes. With two readers, TrackMem outperforms existing memory systems on both splits. On the failure-mode split it reaches 73.9% macro accuracy against 69.4% for the strongest baseline, with the largest gains on questions about revised figures (86.5% against 73.4%).
Introduction
Large Language Model (LLM) agents operating over extended horizons accumulate more information than their context windows can hold, and performance degrades as the context fills ([6]). Memory systems address this limitation through persistent storage and retrieval.
Memory systems are evaluated mostly on open-domain social dialogue (LoCoMo, Maharana et al., 2024; MemBench, [14]), where facts are largely append-only, non-numeric, and remain valid once asserted. Retention thus reduces to locating where a fact was first stated, a task well suited to flat retrieval. In building the memory of a commercial investment assistant, we identified four failure modes specific to financial dialogue. Revision: quantities are superseded rather than accumulated. Stance: a speaker’s stance evolves through dated observations and actions across sessions, requiring reconstruction from the trajectory rather than a single passage. Constraint: a rule stated once may govern later queries with no textual overlap, making similarity- and recency-based retrieval insufficient. Aspect: the same entity is discussed under distinct analytical lenses (e.g., valuation, regulatory risk, and position sizing) that must remain separate. Existing systems address these failure modes at most partially, and none addresses stance (Table 1).
| System | Update | Revision | Stance | Constraint | Aspect |
| Turn RAG | append | ○ | ○ | ○ | ○ |
| MemGPT | self-edit | ◐ | ○ | ◐ | ○ |
| Mem0 | overwrite | ◐ | ○ | ○ | ○ |
| A-Mem | note links | ○ | ○ | ○ | ○ |
| Zep | invalidation | ◐ | ○ | ○ | ○ |
| O-Mem | attributes | ○ | ○ | ◐ | ◐ |
| TRACKMEM | event time | ● | ● | ● | ● |
Table 1. Failure modes each system addresses by design. ● addressed; ◐ partially; ○ not addressed.
We propose TRACKMEM, a per-speaker graph memory whose nodes retain event-time histories, so that it represents what is in force at any date rather than what was last said: revised figures supersede earlier values, stances are reconstructed from dated actions, standing rules remain available to relevant queries, and each analytical lens maintains a distinct view. To evaluate these capabilities, we introduce FinLoCoMo, a benchmark of long-horizon investment dialogues that turns each failure mode into a question category of the same name. We write benchmark categories in small caps (REVISION, STANCE, CONSTRAINT, ASPECT) and the failure modes in lowercase. Across both splits and both readers, TRACKMEM delivers the strongest and most consistent performance among the tested memory systems, with its largest gains on REVISION. It also retrieves more annotated evidence than any baseline at a similar context size (Figure 1).

Figure 1. Evidence recall against context length.
Our contributions are as follows:
TRACKMEM, a per-speaker graph memory that tracks event-time histories of figures, stances, standing rules and lens-specific views, deployed in a commercial investment assistant (§ 6).
FinLoCoMo, a benchmark of 765 questions over 15 long-horizon investment conversations, covering four failure modes and standard LoCoMo categories.
An evaluation against five memory systems under two readers. TRACKMEM is the most accurate on both splits, and outperforms turn-level retrieval at a matched retrieval budget and comparable recall.
Related Work
Memory systems. Memory systems store, organize, and retrieve information from past interactions to work around the limited context window. They differ mainly in how memory is represented. MemGPT pages chat logs between the prompt and external storage, like operating-system memory (Packer et al., [11]). Mem0 keeps a vector database of memories, reconciled against new claims through updates or insertions (Chhikara et al., [3]). A-Mem stores linked, re-annotated atomic notes in the style of a Zettelkasten (Xu et al., [17]). Zep uses a bi-temporal knowledge graph recording when a fact was observed and when it remains valid (Rasmussen et al., [12]). O-Mem maintains a user profile with hierarchical retrieval (Wang et al., [15]).
None fully addresses any of the four failure modes of § 1 (Table 1). For revision, Mem0 and O-Mem order facts by when they were discussed rather than when the event occurred, so recency-based supersession can keep the wrong value. Zep tracks validity but invalidates a fact only when a model judges two fact strings to conflict, so a revised figure can persist beside the old one. For stance and constraint, all of these systems retrieve atomic items by similarity or by graph and profile structure, so a stance spread over a trajectory of statements, or a rule that shares no content with the query, is not reached. For aspect, only O-Mem indexes memory by topic, which separates topics rather than lenses on the same entity.
Memory benchmarks. Existing evaluations rarely exercise these failure modes. Benchmarks with knowledge updates (Wu et al., 2025; Hu et al., [7]) ask for a fact after it changes, but do not surround the revised value with plans, hypotheticals and the other speaker’s figures, as FinLoCoMo does (Appendix § 8.§ 3).
FinLoCoMo: A Long-Horizon Financial Dialogue Benchmark
FinLoCoMo extends LoCoMo’s generation pipeline (Maharana et al., [10]) to investment dialogue. It has 15 two-speaker conversations of 24–28 dated sessions spanning 191–612 days (184–293 in LoCoMo), with two question splits over the same transcripts (Table 2).
| Standard split (464) | Modes split (301) | ||
| SINGLE-HOP | 168 | REVISION | 64 |
| MULTI-HOP | 76 | STANCE | 50 |
| TEMPORAL | 74 | CONSTRAINT | 148 |
| OPEN-DOMAIN | 73 | ASPECT | 39 |
| ADVERSARIAL | 73 |
Table 2. FinLoCoMo questions (765 in total). Conversations average 27.3 sessions of 9.0 turns and 7.9k tokens.
Conversation generation
We add a finance layer and keep LoCoMo’s persona-conditioned agents, event graph, session generation with retrieval of earlier facts, and running summary. Each speaker is seeded with a financial persona of 10–12 first-person lines (role, holding period, leverage and concentration rules, largest holdings). From it, the model writes 80 dated events over 600 days, each linked to the earlier event that caused it; unlinked and off-domain events are discarded. The event graph is the ground truth for what was in force on any date. Each session consumes the agents’ next unused events, and stays on financial topics with concrete figures, introducing no new storylines or people. All generation uses MiniMax-M3 (Appendix § 9.§ 1, Appendix § 9.§ 2).
Figure 2. Illustrative example from a long-horizon financial conversation. TRACKMEM stores each kind of information in its own structure and retrieves it by entity and kind. Recall is evaluated based on FinLoCoMo-Modes.
Questions
The Standard split follows LoCoMo, with 391 SINGLE-HOP, MULTI-HOP, TEMPORAL and OPEN-DOMAIN questions and 73 unanswerable ADVERSARIAL questions. The Modes split turns the four failure modes of §1 into categories designed to mislead similarity- or recency-based retrieval: REVISION asks for the current value of a revised quantity; STANCE links a stance change to its trigger and action across sessions; CONSTRAINT applies a previously stated rule to a figure given elsewhere; and ASPECT asks for a view under a specified analytical lens or reconciles views across lenses. Candidate questions pass four automatic checks (Appendix B.3); Table 9 gives examples.
| Type | Question | Evidence | Retrieval trap | Gold |
| REVISION | What discount rate is Sarah currently using for her SPG DCF? | D16:3 “Using 8.0% for SPG now, up from 7.75%.” D17:2 “10Y near 4.2% pushes my discount rate to 8.25%.” | D17:6, the latest mention: “at 4.3% I’d bump SPG’s discount rate up another 25bps” (hypothetical) | 8.25% |
| STANCE | What data point caused Robert to first raise his XOM price target above $126? | D21:3 “$126 target still works if Brent holds here.” D22:3 “$94 Brent has me second-guessing my mid-cycle call . . . XOM’s $126 target needs a $5–10 bump.” D23:5 “updated my PT to $131 from $126.” | D23:5 states the raise but not its cause; D25:3 reports a later raise to $136 | Brent reaching $94, prompting a late-cycle rethink | ||
| CONSTRAINT | Given Kenji’s trailing-stop discipline, at what price would his stop trigger on the Sony position he reloaded at ¥13,420? | D21:5 “30bps trailing, same as before . . . not giving back more than 0.3% on any single name.” D26:5 “picked up 1% Sony last Wednesday at ¥13,420.” | D26:5 matches the question but carries no rule; the rule is five sessions earlier | ≈¥13,380 |
| ASPECT | How does Eleanor reconcile liking SPG’s valuation with her reluctance to size it up, and what risk lens dominates her hesitation? | D25:4 “SPG feels like the steadier play—100 shares there is sleep-at-night money.” D26:4 “Same CEO across two 90%+ payout names is a concentration risk red flag.” D26:10 “my 100 SPG shares at 6.65% yield still feel like the right anchor.” | D22:5 cites a different risk: “100 SPG shares funding that 6.65% yield with debt has me nervous” | Likes the 6.65% yield but holds at 100 shares; same-CEO concentration risk |
Table 9. Example questions from the Modes split. Evidence lists the turns (session:turn) the gold depends on; Retrieval trap is a turn that a similarity- or recency-based retriever is likely to return instead.
TrackMem
Problem setting
A dialogue between two speakers consists of an ordered sequence of sessions . Following Maharana et al. [10], all turns of session share one timestamp , with . For each speaker , the system maintains a memory , updated after every session in order. Given a question about , it returns a context from which a fixed reader answers, so the systems we compare differ only in and .
Memory representation
is a property graph over the entities discusses, organised by a fixed taxonomy of financial topics (Appendix C.1), with four node types (Figure 3). Views hold ’s current understanding of an entity under one analytical lens, as a short summary with an optional sentiment. A view is keyed by with a topic, so the valuation, regulatory risk and sizing of one security have separate histories.
Figure 3. Design of TrackMem
Anchors hold figures as typed values. A commitment is a decision may revise (a price target, a position cap); an observation is true when stated (a market level, an executed fill). An anchor is keyed by : its kind , a slot that separates different quantities of the same kind § 4.3, and a period . For a commitment the period is empty, so a later value replaces the earlier one; for an observation it is the date stated, so readings accumulate.
Attributes hold standing properties of , such as risk tolerance or a portfolio-wide rule (“no leverage”), keyed by with kind .
Claims are single assertions from one turn and are never revised; a claim recording something did carries an action kind (added, trimmed, . . .).
Views, anchors and attributes keep every earlier state in a history , each with its validity interval in event time, when the conversation took place rather than when the node was written. Fields and vocabularies are listed in Appendix § 10.§ 2.
Memory construction
Each session updates once (Algorithm 1). A schema-constrained extraction maps the session onto closed vocabularies and links its entities to those already in . The kind of a figure does not identify the quantity it measures. We compare each new commitment with the stored anchors
Algorithm 1 Writing session S_k into G_p.
1: (Z, A, C, P) ← EXTRACT(S_k)
2: map the entities in Z, A, C onto those in G_p
3: for each commitment a ∈ A do
4: j(a) ← ψ(a, Q(a)) ▷ revised slot, or new
5: end for
6: for each view (e, z) ∈ Z and attribute in P do
7: new text ← SYNTHESISE(stored text, S_k)
8: end for
9: for each view, anchor and attribute n not yet updated by
S_k do
10: if n is new or its state changed then
11: append (state(n), [t^{from}(n), τ_k)) to H(n)
12: state(n) ← new state; t^{from}(n) ← τ_k
13: end if
14: end for
15: add the claims C ▷ immutable
that share its entity, kind, unit and period, and a resolver selects the one that revises, if any. When the match is ambiguous, assigns a new slot, because merging two distinct quantities would overwrite a valid value, while keeping them apart costs only a duplicate. Each node is then written under its key, and a changed state closes the previous one at . The current value of each quantity is therefore determined by its key rather than by a model judgement (Appendix § 10.§ 2).
Retrieval
A single model call maps the question to the entities and topics it mentions and to a question type. Each node type is then retrieved through its own channel. Current views, past views and claims are ranked by similarity to the question. Current views additionally receive fixed bonuses for a matching entity and topic, must exceed a similarity threshold , and are limited per entity. Anchors with their value histories, the trajectory of ’s claims about in event order, and all attributes are retrieved by exact lookup, independent of the question’s wording (Appendix § 10.§ 3). The retrieved items form the context : verbatim turns , anchors , current views , past views , the profile and the trajectory . holds the source turns of the retrieved claims and trajectory, plus the source turns of other retrieved items most similar to the question.
Experiments
Setup
We compare TrackMem with five memory systems: MemGPT (Packer et al., [11]), Mem0 (Chhikara et al., [3]), A-Mem (Xu et al., [17]), Zep, via its open-source engine Graphiti ([12]), and O-Mem ([15]), each run from its released code with default settings. Each system builds its memory once from the 15 FinLoCoMo conversations with gemini-3.1-flash-lite, embedding with gemini-embedding-2, then retrieves context once per question. The contexts are answered under the same prompt by two readers at temperature 0: gemini-3.1-flash-lite and nemotron-3.5-lightning with reasoning, so recall and context length do not depend on the reader. An LLM judge (MiniMax-M3) grades each answer as correct (1), partial (0.5) or incorrect (0). Tokens are estimated as characters / 4. Macro weights the four categories of a split equally; Micro weights each answerable question equally.
Main results
TRACKMEM is the most accurate memory system with both readers. It leads MemGPT, the strongest baseline, by 4.5 and 0.3 macro on Modes and by 2.4 and 2.5 on Standard (Table 3). TRACKMEM also shows the reader the most gold evidence (recall 0.80 and 0.86, against at most 0.70 and 0.73), with a quarter to a third of the full context’s tokens.
| Retrieval | Gemini 3.1 Flash Lite | Nemotron 3.5 Lightning | ||||||||||||
| Method | Recall | Tokens | REV. (64) | STANCE (50) | CON. (148) | ASPECT (39) | Macro | Micro (301) | REV. (64) | STANCE (50) | CON. (148) | ASPECT (39) | Macro | Micro (301) |
| Mem0 | 0.42 | 311 | 54.0 | 12.8 | 66.3 | 27.0 | 40.0 | 50.0 | 48.4 | 15.0 | 47.3 | 32.1 | 35.7 | 40.2 |
| A-Mem | 0.70 | 3,687 | 69.4 | 56.1 | 79.3 | 59.2 | 66.0 | 70.7 | 76.6 | 61.0 | 80.7 | 65.4 | 70.9 | 74.6 |
| MemGPT | 0.55 | 2,656 | 73.4 | 55.1 | 76.5 | 72.4 | 69.4 | 71.8 | 80.5 | 66.0 | 76.4 | 83.3 | 76.5 | 76.4 |
| Graphiti (Zep) | 0.48 | 318 | 40.6 | 14.0 | 61.1 | 26.9 | 35.7 | 44.5 | 42.2 | 11.0 | 41.6 | 21.8 | 29.1 | 34.1 |
| O-Mem | 0.33 | 943 | 60.2 | 49.0 | 65.2 | 35.9 | 52.6 | 57.6 | 54.7 | 51.0 | 49.0 | 42.3 | 49.2 | 49.7 |
| TRACKMEM | 0.80 | 2,636 | 86.5 | 61.5 | 79.1 | 68.4 | 73.9 | 76.4 | 84.4 | 71.0 | 77.4 | 74.4 | 76.8 | 77.4 |
| Full context | 1.00 | 10,429 | 82.0 | 63.0 | 76.0 | 63.5 | 71.1 | 73.6 | 82.8 | 79.0 | 81.8 | 70.5 | 78.5 | 80.1 |
| Gold evidence | 1.00 | – | 88.3 | 56.0 | 78.0 | 75.6 | 74.5 | 76.3 | 80.5 | 66.0 | 64.5 | 71.8 | 70.7 | 69.1 |
| Retrieval | Gemini 3.1 Flash Lite | Nemotron 3.5 Lightning | ||||||||||||
| Method | Recall | Tokens | SINGLE (168) | MULTI (76) | TEMP. (74) | OPEN (73) | Macro | Micro (391) | SINGLE (168) | MULTI (76) | TEMP. (74) | OPEN (73) | Macro | Micro (391) |
| Mem0 | 0.45 | 367 | 53.7 | 44.4 | 25.7 | 42.4 | 41.6 | 44.6 | 54.5 | 39.5 | 15.5 | 42.5 | 38.0 | 41.9 |
| A-Mem | 0.73 | 3,714 | 84.5 | 65.5 | 40.3 | 52.2 | 60.6 | 66.9 | 86.6 | 69.7 | 41.2 | 55.5 | 63.3 | 68.9 |
| MemGPT | 0.65 | 3,165 | 88.6 | 72.3 | 48.6 | 47.8 | 64.3 | 70.5 | 90.2 | 76.3 | 45.3 | 54.1 | 66.5 | 72.3 |
| Graphiti (Zep) | 0.55 | 315 | 42.9 | 41.4 | 35.1 | 37.0 | 39.1 | 40.0 | 36.0 | 38.2 | 25.7 | 26.7 | 31.6 | 32.7 |
| O-Mem | 0.44 | 1,099 | 64.6 | 59.9 | 25.7 | 48.6 | 49.7 | 53.3 | 64.9 | 46.1 | 24.3 | 46.6 | 45.5 | 50.1 |
| TRACKMEM | 0.86 | 3,666 | 85.5 | 75.0 | 54.9 | 51.4 | 66.7 | 71.4 | 90.5 | 71.7 | 56.1 | 57.5 | 69.0 | 74.2 |
| Full context | 1.00 | 10,512 | 83.7 | 67.3 | 43.2 | 47.7 | 60.5 | 66.5 | 87.2 | 75.7 | 58.8 | 63.0 | 71.2 | 75.1 |
| Gold evidence | 1.00 | – | 94.9 | 80.9 | 64.2 | 50.7 | 72.7 | 78.1 | 86.9 | 80.3 | 58.8 | 68.5 | 73.6 | 76.9 |
Table 3. Main results (%). REV. = REVISION, CON. = CONSTRAINT. Recall: share of annotated evidence turns in the context. Micro is over successfully judged questions (range from 0 – 18 unjudged per cell).
The gains are on the failure modes. With both readers TRACKMEM is the best memory system on REVISION and STANCE; MemGPT leads on ASPECT, and A-Mem on CONSTRAINT, marginally with Gemini. On Standard, TRACKMEM leads on TEMPORAL, which requires ordering events across sessions. Mem0, Zep and O-Mem return at most 1.1k tokens with recall of at most 0.55, and trail TRACKMEM on every category.
The reader decides how much full context recovers. With Gemini, full context trails TRACKMEM on both splits despite containing every gold turn: most quantities are stated several times, as plans, revisions and the other speaker’s figures, and the reader often picks a superseded one (Appendix § 9.§ 6). The reasoning reader recovers more from the whole transcript and leads overall, most clearly on STANCE, whose evidence is spread over many turns. Gold evidence is not a ceiling either: with Nemotron it scores below TRACKMEM on Modes and declines 60 of the 301 questions, as annotated turns lack surrounding dates and actions.
TRACKMEM abstains with high precision. Treating a decline as a prediction that the question is unanswerable, TRACKMEM has the highest precision with both readers (91.5 and 87.8; Appendix § 11) but declines fewer unanswerable questions, so its F1 matches MemGPT’s with Gemini and trails it with Nemotron.
Where the advantage comes from
Structure beats retrieval at an equal budget. A turn-level RAG baseline that embeds every turn and returns the 27 most similar to the question, the number of turns TRACKMEM shows, reaches nearly the same recall (0.82 against 0.80) but scores 5.5 points lower in macro accuracy and 16.3 lower on REVISION (Appendix § 11). The evidence turns are in its context, but nothing tells the reader which stated value is current.
Upstream ablation. We rebuild the memory without one extracted component and rerun retrieval (Table 4). Removing claims costs the most although claims are never shown to the reader, and the share of gold turns retrieved falls from 79.0% to 65.5%, so claims serve to find evidence.
| Modes | Standard | |
| Upstream ablation | ||
| Full memory | 74.4 | 70.3 |
| −C | 70.6 ↓3.8 | 68.8 ↓1.5 |
| −A | 73.2 ↓1.2 | 69.3 ↓1.0 |
| −P | 74.0 ↓0.4 | 68.9 ↓1.4 |
| Context ablation | ||
| All sections | 75.9 | – |
| −U | 62.3 ↓13.6 | – |
| −A | 72.6 ↓3.3 | – |
Table 4. Micro accuracy after removing one component. Each block is a separate build and judge run, so its first row differs from Table 3.
Context ablation. We remove either the verbatim turns or the anchors from the rendered context after retrieval, keeping retrieval fixed. Without verbatim turns, accuracy falls by 13.6 points, and without anchors by 3.3.
Deployment
Architecture and reliability. TRACKMEM runs as four services connected by Redis streams: an API that accepts turns and answers queries, a buffer that groups turns per user, a dispatcher that makes all write-path model calls, and a writer that updates the Neo4j graph (Appendix § 10.§ 4; Table 5). Each stage acknowledges a message only after storing its result, and writes are idempotent, so at-least-once delivery is safe; batches that repeatedly fail validation are held in a dead-letter queue for replay. Queries are restricted to the user’s subgraph, and the recommendation layer reads only per-user engagement counts on shared entity and topic nodes.
| In production since | July 2026 |
| Ingested turns | 13,781 |
| Nodes per user | 604 |
| Estimated model write cost per batch | ≈ $0.005 |
| Ingestion delay (median) | 19.0 min |
| Estimated query latency | 3–5 s |
| Batches entering dead-letter queue | 0.13% |
Table 5. TRACKMEM deployment (Oct 2026).
Cost and ordering. A user’s turns are buffered into batches of up to 2,048 tokens or 20 messages, and a six-hour inactivity timeout. Extraction requests are submitted through the provider’s asynchronous batch interface. Users are hashed to shards, and one worker writes each shard’s output stream sequentially. At query time, the router is the only generative model call, alongside embedding and graph operations; channel-specific keep the context at about 2.6k tokens on FinLoCoMo-Modes.
Lessons from deployment. Four production failures shaped the implementation. Attribution. Figures in the assistant’s replies were recorded as the user’s commitments; a figure now enters the user’s memory only if the user states or adopts it. Scale. Users wrote figures in different scales or format (0.08 and 8%); values are now normalised
to one scale per unit. Scope. Portfolio-wide rules were stored on each company discussed, so a later change reached only some of them; they are now stored once, as a user attribute. Non-subjects. Uploaded files, drafts and the assistant itself were extracted as investment entities; extraction now admits only subjects on which the user can hold a view.
Evaluated and deployed systems. The evaluation uses the production write and read paths, with sessions in place of batches. Production also links entities to a proprietary market-event graph and learns the view-score weights ; the hand-set weights of Appendix § 10.§ 3 serve as its cold start and are used in all reported results.
Limitations
TRACKMEM relies on a language model to build its memory. Extraction, quantity resolution and view synthesis are model judgements, so an error made when a session is written, such as a missed figure, a wrong entity or two quantities merged into one slot, persists until a later session revises it. Writing memory also costs model calls at ingestion, which retrieval over raw turns avoids. The graph stores turn identifiers rather than turn text, so the verbatim section of the context requires access to the original transcript.
Our evaluation covers one domain and one language, with two speakers per conversation, and conversations short enough to fit in the reader’s context. Behaviour over longer histories, other domains and many-party dialogue is untested. Accuracy is graded by an LLM judge, whose verdicts vary between runs by about two macro points, and the configuration of TRACKMEM was selected on the evaluation questions, while the baselines were run with their released settings.
Extended related works
Retrieval-Augmented Generation
Retrieval-Augmented Generation (RAG) augments LLMs with externally retrieved evidence. Naïve RAG chunks source documents, embeds them in a vector store, and inserts the top- semantically similar chunks into the prompt [5]. Advanced RAG improves retrieval quality through query reformulation, expansion, and index refinement before search, as well as re-ranking and filtering afterward [8]. Agentic RAG further delegates retrieval decisions to an LLM, allowing it to determine when and what to retrieve during reasoning [13]. GraphRAG targets global questions by constructing an entity knowledge graph, summarizing its hierarchical communities, and combining partial answers generated from these summaries [4]. Across these variants, however, retrieval remains largely static: they do not maintain or revise an evolving belief state as new information arrives over time.
Long-Context LLM Evaluation on Financial Concepts
Gupta et al. [6] evaluate GPT-4-family models on financial-news retrieval tasks of increasing context length and complexity. They find that a model’s advertised context window does not imply reliable use of the full context: GPT-4o’s F1 on a simple company-identification task falls from 0.99 at 4K tokens to 0.40 at 128K tokens.
Degradation is more severe for multi-concept tasks, such as jointly identifying a company and its sentiment, where performance approaches zero beyond roughly 32K tokens. The authors also report instruction-following and formatting failures at long context lengths, as well as sensitivity to prompt placement and minor formatting changes. These results indicate that long-context LLMs may require retrieval, controlled context construction, and explicit abstention mechanisms in financial applications.
Memory and Financial QA Benchmarks
Closest to FinLoCoMo are benchmarks with knowledge updates: LongMemEval and MemoryAgent-Bench include questions whose answer changes during the interaction [7] (Wu et al. 2025).
FinLoCoMo differs in what surrounds the update. A revised figure co-occurs with plans, hypotheticals and the other speaker’s figures for the same quantity, so the latest mention is often not the answer (Table 9), and the benchmark also targets stance trajectories and analytical lenses. Financial QA benchmarks evaluate numerical reasoning over a single filing or conversation rather than memory across sessions [1, 2, 9].
FinLoCoMo Construction
Personas and event graph
Personas. Each speaker is seeded with 10–12 first-person attribute lines describing a financial life: role, market focus, holding period, leverage and concentration rules, risk appetite, rebalancing habit, and largest holdings (e.g., “I run a long-only book with no leverage and strict single-name concentration limits”). Roles range from professionals (portfolio manager, sell-side bank analyst, rates trader, currency-overlay manager) to serious private investors.
Event graphs. From the persona, the model writes 80 dated events per speaker over a 600-day window, each linked to the earlier event that caused it; events with no causal link are discarded. For example, a quarterly result raises conviction, which leads to a larger position. The graph therefore records each revision of a quantity held about an entity, and each chain from observation to change of conviction to action. It serves as the ground truth for what was in force at any date. A separate LLM call acts as a classifier that removes off-domain events before any dialogue is written.
Session generation
Sessions. Each session is generated iteratively by consuming the next unused event from each agent’s own timeline. The speaking agent sees its persona, the date, the running summary, its own events since the last session, and two facts per speaker retrieved by embedding similarity from earlier sessions. During generation, the model is instructed to keep the conversation to financial topics, to use concrete figures rather than qualitative language, and to avoid introducing new personal storylines or new named people.
Question generation
Quality control. A candidate question is accepted only if it passes four checks: (i) structural checks against the conversation, such as the sessions spanned, the number of revisions and the speaker named; (ii) a blind check, in which MiniMax-M3 answers from the full context, without the gold, and the same model must judge that answer correct; (iii) rejection of the candidate if any of five constant answers is also judged correct; and (iv) deduplication against the Standard split (Appendix § 9.§ 5).
Human validation
We checked a stratified sample of 120 questions (20 per Modes category and 8 per Standard category, including unanswerable ones) for whether the gold answer is correct, the cited evidence suffices, and the question fits its category. 98.3% of gold answers, 96.7% of evidence sets and 94.2% of category assignments were judged valid. We also checked the MiniMax-M3 judge on 24 answers balanced across verdicts and agreed with 24/24 verdicts.
Statistics
Conversations. FinLoCoMo has 15 conversations between two speakers each, with 410 sessions in total (Table 6). Events are generated over a 600-day horizon, and each session is dated one or two days after the event it consumes, so conversations span 191–612 days. The full context shown to the reader averages 10,429 tokens on Modes and 10,512 on Standard; the difference from the 7.9k tokens of turn text is the date and speaker prefix on each turn. Turn text contains about 307 numeric mentions per conversation (range 200–419, counting repeats) and about 21 distinct tickers (range 12–32), counted as uppercase strings of two to five letters after removing common abbreviations. Each REVISION question cites 2.5 distinct values on average, and at most 6; whether its latest mention is the gold is labelled in the human check (Appendix § 9.§ 4).
| Mean | Min | Max | |
| Sessions | 27.3 | 24 | 28 |
| Turns | 247 | 196 | 282 |
| Turns per session | 9.0 | 2 | 22 |
| Days spanned | 411 | 191 | 612 |
| Turn text (tokens) | 7.9k | 5.6k | 9.5k |
Table 6. Per-conversation statistics of FinLoCoMo.
Questions. Table 7 reports, per category, the number of annotated evidence turns, the number of sessions they come from, and the session span, the distance from the earliest cited session to the latest (0 when the evidence lies in one session). Eight of the 168 SINGLE-HOP questions cite more than one session, as in LoCoMo.
| Category | Evidence | Sessions | Span | |
| SINGLE-HOP | 168 | 1.11 | 1.05 | 0.08 |
| MULTI-HOP | 76 | 2.32 | 1.54 | 0.83 |
| TEMPORAL | 74 | 2.01 | 1.95 | 1.78 |
| OPEN-DOMAIN | 73 | 5.07 | 3.25 | 3.29 |
| REVISION | 64 | 4.25 | 3.55 | 9.03 |
| STANCE | 50 | 3.90 | 2.60 | 5.36 |
| CONSTRAINT | 148 | 2.28 | 1.82 | 4.86 |
| ASPECT | 39 | 4.36 | 2.44 | 5.92 |
Table 7. Mean evidence turns, sessions cited and session span per question, by category.
Of the 148 CONSTRAINT questions, 90 place the rule and another cited figure in different sessions (median gap 4, mean 7.6, maximum 26), and 25 place them in the same session. The structural check, which tests wording overlap rather than the number of cited turns, does not exclude two further groups: 22 questions cite only the rule turn, with the figure in that turn or in the question, and 11 leave the rule turn unlabelled, of which 9 cite more than one turn. All of these 25 + 33 questions passed the same checks as the rest of the category: overlap between the question and the rule stays within the structural cap, MiniMax-M3 reproduced the gold from the full context, and none of the five constant answers was accepted. Whether each is a constraint question is part of the human check (Appendix § 9.§ 4). ASPECT questions name 2.6 lenses on average (range 2–4).
Question filtering. Standard questions are generated with LoCoMo’s pipeline. Of its 464 questions, 391 are scored for accuracy; the other 73 are unanswerable and are scored separately, as abstention. A pass over numeric answers that appeared to contradict another mention judged 29 candidates and removed 1.
Modes candidates are written by MiniMax-M3 and kept only if they pass four checks, in order. The structural check enforces the category: evidence ids exist, exactly one speaker is named, and the question does not pin a date; a REVISION question lists values in at least two sessions and is either out of order or has at least three entries, where a repeated mention of the same number counts as an entry; a CONSTRAINT question shares at most a third of its content words with the rule; and an ASPECT question cites at least two lenses. The blind check gives MiniMax-M3 the full context but not the gold, and the same model must judge its answer correct. The chance-floor check judges five constant answers without any conversation and rejects the candidate if any of them is marked correct. Finally, duplicates of earlier questions are dropped. Because the generator and the judge are the same model, these filters do not replace the human check (Appendix § 9.§ 4). The blind check also ensures that every Modes question is answerable from the full context, which favours the full-context reference.
Table 8 reports the filters on an earlier build; about a third of its candidates were kept. The released Modes set consists of the 301 questions accumulated over later runs of the same filters. ASPECT loses most candidates to the structural check, mainly for covering fewer than two sessions or two lenses, which is why it is the smallest category.
| Category | Generated | Kept | Blind | Other |
| REVISION | 78 | 38 | 23 | 17 |
| STANCE | 72 | 33 | 31 | 8 |
| CONSTRAINT | 71 | 26 | 41 | 4 |
| ASPECT | 74 | 9 | 22 | 43 |
| All | 295 | 106 | 117 | 72 |
Table 8. Candidates removed by each filter in an earlier build of the Modes split. Blind: failed the blind check. Other: failed the structural, chance-floor or duplicate check.
Mode Split Examples
Table 9 shows one example of each question type from the Modes split.
TrackMem Details
Topic taxonomy
Views are keyed by an L2 topic and tagged with L3 topics from a fixed three-level taxonomy: 5 analytical domains (L1), 20 subtopics (L2) and 146 leaf tags (L3), each leaf with aliases for matching. Table 10 lists the first two levels.
| L1 domain | L2 subtopics |
| Fundamental analysis | Income statement, Balance sheet, Cash flow, Valuation, Management quality |
| Market dynamics | Price action, Institutional flow, Sentiment, Liquidity |
| Corporate actions | Earnings events, M&A activity, Capital structure, Management changes |
| Quantitative & risk | Factor exposure, Portfolio risk, Earnings quality |
| Macro & sector | Macro environment, Sector dynamics, Geopolitical risk, Commodities & FX |
Table 10. L1 and L2 levels of the topic taxonomy.
Memory Representation and Construction Details
Figure kinds. Commitments: position cap or size, add or trim level, price target, multiple, yield, estimate. Observations: market level, third-party estimate, executed fill, P&L.
Anchor fields. Each anchor also stores a canonical unit, a comparator (at, below, above), a short description of what it measures, and the speaker the figure belongs to.
Attribute kinds. Risk tolerance, risk focus, goal, constraint, time horizon, experience and preference.
Claim fields. Each claim stores its event time, the speaker, and the entities and topic it concerns. Claims can also hold assertions about things that are not stored entities, which views and anchors cannot.
Event time versus processing time. The two diverge when sessions are ingested in bulk. Every node also records the identifiers of the turns it was derived from.
Extraction. One schema-constrained call per session returns entities, (entity, topic) pairs, anchors, claims and attributes from the user’s side of the conversation. Output that breaks a structural rule of the schema (an entity not linked to the user or without a topic, an unknown attribute kind, a relation to an undeclared entity) is rejected and the call retried, up to five times. Entity identifiers are folded onto the spellings already stored in . Table 11 lists the closed vocabularies.
| Field | Values |
| Anchor kind, commitment | position cap, position size, add level, trim level, price target, valuation multiple, yield, estimate |
| Anchor kind, observation | observed level, third-party estimate, executed fill, P&L |
| Unit | currency, percent (basis points are normalised to percent), multiple, shares, quantity |
| Comparator | at, below, above |
| Source | user, endorsed (the other party’s figure, adopted by the user), counterparty, third party |
| Action kind | initiated, added, trimmed, exited, upgraded, downgraded, target raised, target cut, stop tightened, stop loosened, hedged, deferred, held |
| Attribute kind | risk tolerance, risk focus, goal, constraint, time horizon, experience, preference |
| Sentiment | bullish, bearish, neutral, mixed |
Table 11. Closed vocabularies of the extraction schema.
Stored fields. Besides its key, each anchor stores a value in a canonical unit, a comparator (at, below, above), a short description of what it measures, and whose figure it is (Table 11). For yields and estimates the period is the reporting period, so values for different periods coexist. The topic is not part of the anchor key, so a commitment discussed under two lenses remains one quantity. A view’s state is its text and sentiment, an anchor’s its value, unit, currency and comparator, and an attribute’s its text and level; a node is snapshotted only when this state changes, and a session already applied to a node is ignored.
Quantity resolution. For each new commitment , the candidates are the stored anchors with the same entity, kind, unit, currency and period; an anchor in another unit is never a candidate, since a percentage cannot revise a price. Each anchor carries a short description of what it measures, written by the extractor. The resolver sees the new figure’s description and the candidates’ descriptions and current values, and decides for each new figure whether it is the same quantity as one candidate. It is instructed that a figure is a different quantity, even with the same entity, kind and unit, when it concerns another account or portfolio sleeve, another scenario, planned rather than actual sizing, a part rather than the whole (the amount trimmed rather than the resulting position), a different trigger, instrument or horizon, or somebody else’s number, and to answer different when the descriptions do not settle it. A match adopts the stored slot , so the write supersedes it; otherwise receives a new slot derived from its description. Observations are not resolved, since their period is the date on which they were stated.
Synthesis. After the update, the text of every view and attribute the session touched is re-synthesised from its previous text and the session, at temperature 0. At 0.2, re-ingesting identical data moved one speaker’s accuracy from 71% to 60%.
Retrieval configuration
Routing. The router returns the question’s entities , topics , a type (stance, quantity, temporal, profile, exploratory or comparative), whether it concerns past states, an optional reference date, and a grounding: entity-anchored, topic-anchored or semantic-only. Entities are resolved to identifiers in before any search, by exact identifier, alias, lexical match and then embedding match; the user’s own name, and other people’s, are excluded from resolution. In the evaluation, the graphs queried are those of the speakers the question names, or both when it names neither.
View scoring. Current views are ranked by
with each indicator binary and set by hand for each grounding (Table 12). The search returns at most candidates with ; a view is admitted only if its raw cosine similarity is at least , so that the bonuses can reorder candidates but not admit an unrelated one, at most two views per entity are kept, and the top remain. Two expansions then append up to five views of entities one hop away in the shared entity graph (related, competitor, part-of), ranked by similarity, and up to five views tagged with , ranked by recency; these are not filtered by .
| Grounding | |||
| Entity-anchored | 0.10 | 0.02 | 0.02 |
| Topic-anchored | 0.03 | 0.08 | 0.05 |
| Semantic-only | 0.02 | 0.02 | 0.01 |
| None returned | 0.05 | 0.03 | 0.02 |
Table 12. Weights of the entity, topic and tag terms of the view score, by the question’s grounding. The values are set by hand.
Channels by question type.
Anchors: all kinds for quantity, profile and exploratory questions; for stance and temporal questions, only the decision kinds (position size and cap, executed fill, add and trim levels, price target). Each anchor is returned with its value history.
Past views: for every question except present-tense stance and profile questions, ranked by similarity plus the entity term, restricted to states valid on the reference date when one is given; up to five.
Claims: ranked by similarity over all of the user’s claims, with the floor ; up to eight. Their source turns enter .
Trajectory: for stance and temporal questions and questions about the past, the user’s claims about the resolved entities (or, for a theme, about ), in event order; up to 24, keeping actions first when thinned.
Attributes: always.
Grounding check. A question is marked ungrounded when no view reaches , or when none of the entities it names (other than people) resolves in and none of its topics matches a retrieved view. If, in addition, no anchor is retrieved, the structured sections are replaced by a notice that nothing in memory supports an answer; the verbatim turns are still appended.
Context assembly. When the question names known entities, their views lead and at most two views about other entities are kept. Requested anchor kinds are listed first. The verbatim section holds up to 20 source turns of the retrieved claims and trajectory, deduplicated across the speakers queried, plus the 15 turns most similar to the question among the remaining source turns of all retrieved views, past views, claims and trajectory points; all are shown in chronological order. The claims themselves are not rendered. On Modes this gives about 27 turns and 2.6k tokens per question.
Deployed pipeline
Figure 4 shows the write and read paths of the deployed system.
Figure 4. Write and read paths of the deployed TRACKMEM.
Additional results
Equal retrieval budget.
Table 13 gives similarity retrieval over turns the same number of turns as TrackMem. Retrieval is ahead only on STANCE, whose evidence often lies in turns that do not name the entity. At 42 turns it reaches recall 0.88, and the lead of TrackMem narrows to 2.2 macro and 10.3 on REVISION.
| Turn RAG | TRACKMEM | ||
| REVISION | 70.2 | 86.5 | ↑16.3 |
| STANCE | 65.3 | 61.5 | ↓3.8 |
| CONSTRAINT | 74.8 | 79.1 | ↑4.3 |
| ASPECT | 63.2 | 68.4 | ↑5.2 |
| Macro | 68.4 | 73.9 | ↑5.5 |
| Recall | 0.82 | 0.80 |
Table 13. Equal retrieval budget on Modes: similarity retrieval over turns (no graph) and TRACKMEM, each showing about 27 turns.
Abstention.
Table 14 scores each reader’s declines over all 765 questions, with the 73 unanswerable questions as positives.
| Method | Gemini Prec. | Gemini Rec. | Gemini F1 | Nemotron Prec. | Nemotron Rec. | Nemotron F1 |
| Mem0 | 26.0 | 93.2 | 40.6 | 23.8 | 98.6 | 38.4 |
| A-Mem | 69.1 | 89.0 | 77.8 | 59.2 | 83.6 | 69.3 |
| MemGPT | 81.3 | 83.6 | 82.4 | 80.0 | 82.2 | 81.1 |
| Graphiti (Zep) | 19.0 | 71.2 | 30.0 | 15.5 | 82.2 | 26.1 |
| O-Mem | 22.5 | 52.1 | 31.4 | 21.9 | 57.5 | 31.7 |
| TRACKMEM | 91.5 | 74.0 | 81.8 | 87.8 | 58.9 | 70.5 |
| Full context | 73.3 | 75.3 | 74.3 | 86.4 | 52.1 | 65.0 |
Table 14. Precision and recall of a decline. A true positive is a decline on one of the 73 unanswerable questions, counted over all 765 questions.
Prompts
This section gives the instruction text of every model call in TRACKMEM and in the evaluation. Angle-bracket placeholders (<QUESTION>) and Python format fields ({question}) are filled at run time; they are not further instructions. The prompts are reproduced verbatim except that the embedded taxonomy of the extraction prompt is replaced by the placeholder <TOPIC_TAXONOMY_JSON> (its ids are listed in the router prompt, §E.4, and its first two levels in Table 10), one example file name is anonymised, and non-ASCII punctuation is transliterated. Every call returns JSON validated against a schema; we list the output fields here, and the full schemas are in the released code. Table 15 summarises the calls.
| Call | Model | Max | Output fields |
| Extraction | Gemini | 65,536 | entities, relations, anchors, claims, attributes |
| Synthesis | Gemini | 8,192 | text and sentiment per (entity, topic) row |
| Resolver | Gemini | 1,024 | stored quantity revised, or none |
| Router | Gemini | 1,024 | entities, topics, type, date, grounding |
| Reader | Gemini | 1,024 | value, answer, declined, support |
| Reader | Nemotron | 8,192 | as above |
| Judge | MiniMax-M3 | 256 | verdict, reason |
Table 15. Model calls, all at temperature 0. Max: maximum output tokens. Gemini is gemini-3.1-flash-lite and Nemotron is nemotron-3.5-lightning. The first four calls build or query the memory of TRACKMEM (Appendix § 12.§ 1–§ 12.§ 4); the reader and judge are shared by all methods. The resolver runs only when a new commitment has stored candidates.
Extraction
One call per session (EXTRACT in Algorithm 1). <USER_ID> is the graph owner; turns are numbered in order and labelled [user] for the speaker being ingested and [assistant] for the other participant. The call classifies entities and relations and extracts anchors, claims and attributes; it writes no prose, which is left to synthesis.
Extraction prompt
You are a financial knowledge graph extraction specialist.
Your job: classify entities and relationships only. Do NOT
→ write context sentences.
USER: <NAME> (graph id: <USER_ID> -- emit this exact id as
→ the USER identifier)
CONVERSATION:
<NUMBERED_CONVERSATION_TURNS>
========================================================
STEP 1 -- ENTITY EXTRACTION
========================================================
Identify every meaningful real-world entity the user or
→ assistant explicitly discusses.
NODE TYPES:
USER -- emit exactly one USER node: identifier="<USER_ID
→ >", label="<USER_ID>".
ENTITY -- any real-world thing: equity, ETF, person,
→ company, product, index, fund,
concept, event, metric, strategy, etc.
Identifiers: uppercase ticker for equities (e.g.
→ "NVDA"), snake_case for all else.
Always set entity_subtype: TICKER, ETF, INDEX,
→ FUND, COMPANY, PERSON,
ORGANIZATION, EVENT, METRIC, STRATEGY, CONCEPT,
→ or a short snake_case descriptor.
ENTITY RULES:
0. IT MUST BE A SUBJECT, NOT AN ARTEFACT OF THIS
→ CONVERSATION.
Rule 1 asks whose entity it is. This asks whether it is
→ an entity at all, and it is
checked FIRST -- engagement cannot rescue something
→ that should never have been a node.
THE TEST: could <USER_ID> still hold a view about this
→ a year from now, in a
conversation that has nothing to do with today’s? A
→ company, a ticker, a sector, a
macro theme, a strategy, a person in the market -- yes.
→ The file they just uploaded,
the document being drafted, the tool they are using --
→ no. Those exist only because
this session happened.
NEVER emit an entity for:
- FILES AND DOCUMENTS in the workspace -- an uploaded
→ PDF, a deck, a spreadsheet, a report being written, a guide, a note. A document → is a SOURCE, not a subject. The companies discussed inside it are the entities; the → document itself is not. (Observed in production: "file_name", "guide_1".) → THE SOFTWARE AND ITS PARTS -- this product, its panes, its agent, its database, its → models or pipelines, and comparisons between them and anything else. A user → discussing how the tool works is not expressing a market view. (Observed in production: "financial_platform", " → sell_side_model".) → THE SESSION ITSELF -- a task, a request, a chart just produced, an error, a → schedule, "the report", "the analysis". → GENERIC ABSTRACTIONS with no referent a market participant would recognise, e.g. "the platform", "the workflow", "data quality" as a → bare notion.
A conversation may legitimately produce NO entities. → Engineering discussion, product feedback, tooling questions and workspace admin are → normal uses of this system and they are not investment memory. Emitting nothing is the → correct output for them -- far better than forcing a fit, which stores a view < → USER_ID> does not hold about a thing that is not an entity.
Fictional or private companies ARE admissible when the → conversation treats them as real subjects of analysis (a synthetic portfolio, a → private credit borrower). The test is whether it is a market subject, not whether you can → look it up.
THE USER MUST HAVE ENGAGED WITH IT. This memory records → <USER_ID>, not the assistant. Extract an entity only when <USER_ID> either: (a) names it themselves -- "I hold KO", "what about → TSLA at these levels", or (b) RESPONDS to something the assistant raised -- in → EITHER direction. Judge this from meaning, not keywords, and note the reply → often never repeats the name: accepting -- "I agree", "good suggestion", " → that one I like", → "makes sense, I’ll add some", "let → me look at that" rejecting -- "no thanks", "I don’t want energy → exposure", → "I’ve looked at it before and → passed" A REJECTION IS ENGAGEMENT, and often the more → valuable memory: it records a view <USER_ID> actually holds. Capture it as → INTERESTED_IN with the negative sentiment, not as a drop. Where a bare reply ("I agree") could refer to → several entities the assistant named, apply it to the one(s) it most plausibly → answers; if that is genuinely undecidable, leave them all out. An entity the assistant raised that <USER_ID> passed → over, changed the subject from, or simply did not respond to is NOT extracted at → all -- not as MENTIONED, → not with low confidence, not at all.
The two cases look alike and are opposite. Compare them → carefully: NO RESPONSE -> drop Assistant: "income investors also love XOM right → now." <USER_ID>: "Within staples I’d stick with KO and → PG." -> extract KO and PG. Do NOT extract XOM: <USER_ID> → moved past it without evaluating it. DECLINED -> extract, with the negative view Assistant: "some investors allocate 1-2% to BTC as → digital gold." <USER_ID>: "Not for me -- I don’t touch crypto, no → cash flows to value."
-> DO extract BTC as INTERESTED_IN / BEARISH. < USER_ID> evaluated it and said no, and gave a reason. That is one of the most durable memories available: it predicts every future crypto suggestion. Dropping it is a serious loss. The test is not whether <USER_ID> was positive -- it is whether <USER_ID> ENGAGED. When it is genuinely unclear whether the user took it up, leave it out. A missing memory is recoverable from a later conversation; a memory recording an interest <USER_ID> never had is not.
APPLY THIS AS A CHECK, NOT A PRINCIPLE. Before emitting ANY entity, find the specific [user] turn that engages it and be able to quote it. If the only turns naming it are [assistant] turns, DROP IT -- no matter how substantive the assistant was, how central it seems to the discussion, or how naturally it belongs beside entities you are keeping. Two entities named in one assistant sentence, where the user replies about only one, means exactly one is extracted.
[assistant] "I’ll have the soy weather bullet ready, since that USDA report could shake things up." [user] "Sounds good -- talk Friday." -> extract NEITHER soy NOR the USDA report. A scheduling reply is not engagement with the subjects mentioned around it.
Prefer the most specific form: "msft_cloud_segment" over "cloud".
Skip: pronouns, bare time words (today, quarter), filler nouns (stuff, things).
SKIP WORK PRODUCTS AND LOGISTICS. A thing <USER_ID> will WRITE, SEND or DO is not a thing they hold a view about, even though they named it themselves: notes, memos, recaps, decks, models, spreadsheets, reports they are producing; meetings, calls, deadlines, calendar items. "I’ll get the Meridian tightness note and junior assay recap done by Friday" -> extract NOTHING from this. It records a task, not a stance. The subject a document is ABOUT may still be an entity if <USER_ID> says something substantive about it -- but the document itself never is.
Each entity appears ONCE in the entities list.
======================================================== STEP 2 -- RELATIONS ========================================================
Classify the relationship between the user and each entity.
USER->ENTITY relation types: MENTIONED -- <USER_ID> engaged with the entity (named it, or took up the assistant’s mention of it) but revealed no directional view of their own. Use this for a name dropped in passing, a neutral follow-up question, or a bare acknowledgement.
NB an entity <USER_ID> never took up is not MENTIONED -- it is not extracted at all (ENTITY RULE 1).
INTERESTED_IN -- the user holds a thesis, interest, or directional stance -- expressed directly, OR revealed by endorsing, building on, or acting on a point the assistant raised. Sentiment: REQUIRED -- BULLISH / BEARISH / NEUTRAL / MIXED.
ENTITY->ENTITY relation types: RELATED_TO -- two entities are meaningfully linked in this conversation. COMPETES_WITH -- two entities compete in the same market. PART_OF -- DIRECTION MATTERS: subject is the PART, object is the WHOLE. "grapebar PART_OF FCX" -- the mine belongs to the company, never reverse. Same for a segment in a company, a holding in a fund, a constituent in an index.
RULES:
Every ENTITY must appear in at least one USER->ENTITY relation. No orphans.
Only emit INTERESTED_IN when the USER has -- directly, or by endorsing, building on, or acting on a point the assistant raised. Facts and framing may come from the assistant, but the STANCE must be the user’s.
An assistant assertion the user merely heard and did not take up is NOT a user view. If the user took it up but revealed no direction, that is MENTIONED; if they did not take it up at all, the entity is dropped entirely (ENTITY RULE 1).
Do not emit HAS_SUBTOPIC.
Do NOT write context sentences -- that happens in a separate step.
======================================================== STEP 3 -- TOPIC TAGGING (MANDATORY for every ENTITY) ========================================================
Every user-connected ENTITY must have at least one TAGGED_WITH relation. Tags capture WHY the user engaged with this entity -- they will be attached to the user’s memory, not to the entity itself.
RULES:
Tag based on the aspect the user discussed, not what the entity is in general. GOOD: NVDA -[TAGGED_WITH]-> l3_eps (user discussed NVDA’s earnings) BAD: NVDA -[TAGGED_WITH]-> l1_fundamental (too broad -- pick the specific angle)
Persons and concepts must be tagged too -- use the angle the user discussed: GOOD: jensen_huang -[TAGGED_WITH]-> l3_track_record (CEO credibility) GOOD: nvda_datacenter_seg -[TAGGED_WITH]-> l3_revenue_growth (segment growth) GOOD: china_export_controls -[TAGGED_WITH]-> l3_export_controls
One entity may have multiple tags if the user discussed multiple distinct angles.
Prefer TOPIC_L3 leaves; fall back to L2, then L1.
Emit TOPIC_* nodes (identifier = exact taxonomy id) in the entities list.
Emit TAGGED_WITH edges: ENTITY -[TAGGED_WITH]-> TOPIC_*. No context.
Only use ids from the taxonomy below -- do NOT invent new ids.
An entity with no TAGGED_WITH relation is an extraction error.
TOPIC TAXONOMY: <TOPIC_TAXONOMY_JSON>
======================================================== STEP 3b -- TYPED ANCHORS (every concrete figure in the conversation)
Attach to a USER->ENTITY relation EVERY specific number stated in this conversation -- both what <USER_ID> committed to AND what was merely observed or cited. Stored as typed fields, a figure can be looked up exactly instead of competing for room inside a prose sentence that has a hard character budget. THE PROSE IS NOT A SAFETY NET: it is written later, to a budget, by a different call, and figures left to it are routinely lost.
WORK FIGURE BY FIGURE. Scan <USER_ID>’s turns for every number -- prices, levels, sizes, percentages, counts, dates-as-levels -- and for each one ask which kind fits. Do not stop after the first two or three. A conversation with eight figures should usually yield several anchors, not one.
KINDS -- use exactly one of these; if a number genuinely fits none, leave it out.
COMMITMENT -- what <USER_ID> DECIDED. A later value replaces ↪ the earlier one: POSITION_CAP -- max weight they will hold ("I cap ↪ NVDA at 7%") POSITION_SIZE -- current weight ("TSM ↪ is 4% of the book") ADD_LEVEL -- level/condition to buy more (" ↪ adding on any dip below 850") TRIM_LEVEL -- level/condition to trim or stop ("I’d ↪ trim above 10%") PRICE_TARGET -- their fair-value or target price ("I ↪ see fair value at 195") VALUATION_MULTIPLE -- qualifier REQUIRED: P/E, EV/EBITDA, ↪ EV/S ("90x earnings") YIELD -- period-indexed ("BND ↪ yielded 4.2% last year") ESTIMATE -- qualifier + period REQUIRED ("peak ↪ GLP-1 revenue of $20B in FY2030")
OBSERVATION -- what was TRUE at a moment, or what somebody ↪ else asserted. These accumulate by date instead of replacing each other, so two readings ↪ taken weeks apart both stand: OBSERVED_LEVEL -- ANY market datum as of now, not just ↪ price: price ("copper just hit $8,510", ↪ "10y at 3.52%") inventory ("LME stocks at 151,750 ↪ tonnes") spread ("LME-Comex dislocation of ↪ $80/tonne") volume, and period-over-period CHANGES ↪ in any of them ("stocks down 6.5% week-over- ↪ week" -> value 6.5 PCT, qualifier "LME stocks WoW ↪ change") Emit one anchor PER FIGURE: "stocks at ↪ 151,750 tonnes, down 6.5% WoW" is TWO -- the level and the change. THIRD_PARTY_ESTIMATE -- someone else’s number ("JPM ↪ cut CCL EBITDA 18%", "LLY ↪ guided Mounjaro to $4.2B") EXECUTED_FILL -- a trade actually done, or cost basis ("1,200 ↪ shares at $38 cost basis", ↪ entered EUR/USD at 1.0820") PNL -- realised or mark-to-market result ("book ↪ down 14.5% YTD", "locked ↪ in that 12%")
FIELDS: value (unscaled -- $25B is 25000000000), unit ( ↪ CURRENCY/PCT/BPS/MULTIPLE/SHARES/ QUANTITY -- use CURRENCY for money and set currency to the ↪ ISO code, defaulting to USD; say BPS if that is how it was phrased and it will be stored as ↪ PCT; use QUANTITY for a counted or measured amount and put the unit of measure in the ↪ qualifier: "151,750 tonnes" is value 151750, unit QUANTITY, qualifier "tonnes"), comparator (AT / BELOW / ABOVE -- "below 850" is BELOW, " ↪ target 195" is AT), qualifier, period, source (USER / ENDORSED), basis -- what the number MEASURES, in ~12 words, specific ↪ enough to tell it from another figure of the same kind on the same entity: "AMD weight in retiree accounts", "hard stop on the half-size re-entry", "discount rate in the SPG base-case ↪ DCF". Name the account, scenario (base / downside), leg or trigger whenever the ↪ conversation does. ALWAYS fill it: a later session decides from this whether its figure REVISES ↪ this one or is a different quantity, and "position size" alone cannot answer that.
SCALE -- write the number exactly as it was said, never ↪ converted: "8%" -> value 8.0 unit PCT NOT 0.08. A ↪ percent is the number spoken. "0.5%" -> value 0.5 unit PCT (sub-1% values ↪ are legitimate and rare) "25 bps" -> value 25 unit BPS (stored as 0.25 ↪ PCT automatically) "$25B" -> value 25000000000 unit CURRENCY currency USD "40x" -> value 40 unit MULTIPLE
Getting this wrong is not a rounding error: a cap stored ↪ as 0.08 and later restated as 8.0 looks like a 100x revision, which destroys the ↪ supersession the anchor exists for.
RULES:
PICK THE TIER FIRST, THEN THE KIND. The test is whose ↪ number it is and whether it can be revised: ↪ <USER_ID> decided it, and could change their mind -> ↪ COMMITMENT kind it was true at a moment, or somebody else said it -> ↪ OBSERVATION kind "I cap NVDA at 7%" is a commitment. "Copper hit $8,510" ↪ is an observation -- it never be revised, it will simply be a different ↪ number tomorrow. A general truth with no number attached to a moment or ↪ a decision -- "3nm is sold out through 2026", "the Fed cut twice" -- is still NOT an ↪ anchor; it belongs in the context sentence. A wrong anchor is worse than a missing one, ↪ because it is trusted as structured truth.
SOURCE IS MANDATORY AND CARRIES THE ATTRIBUTION: USER -- <USER_ID> stated it as their own ENDORSED -- the other party said it and <USER_ID> ↪ took it up ("I agree") COUNTERPARTY -- the other party said it and <USER_ID> ↪ did NOT adopt it THIRD_PARTY -- attributed to a bank, company ↪ guidance, or an index Getting this wrong is how somebody else’s number gets ↪ read back as <USER_ID>’s view. Most OBSERVATION anchors are COUNTERPARTY or ↪ THIRD_PARTY, not USER.
Only extract a figure that is actually present. NEVER ↪ infer, round, or compute one.
period ONLY for YIELD and ESTIMATE -- the quantities ↪ that take different values at different reporting dates. Two such values for ↪ DIFFERENT periods both stand; for the SAME period the later one replaces the earlier. Leave period NULL on OBSERVATION kinds unless the ↪ figure names an explicit reporting period: they are dated by the conversation ↪ automatically.
Emit nothing when the conversation contains no such ↪ quantity. Most turns will not.
AN ANCHOR IS ABOUT ONE ENTITY. A rule covering the ↪ whole book is NOT an anchor -- it is a CONSTRAINT self-attribute (STEP 4), stored once ↪ against <USER_ID>. "nothing above 8%" -> CONSTRAINT (a portfolio ↪ rule), NOT a POSITION_CAP on every name discussed "I keep 10% in cash" -> CONSTRAINT "I cap NVDA at 7%" -> POSITION_CAP anchor on ↪ NVDA (names one entity) Test: if you are about to attach the SAME anchor to two ↪ or more entities, it is a portfolio rule -- emit the CONSTRAINT once instead. ↪ Copying it onto each name means a later change reaches only the names discussed that day ↪ and the rest silently keep the old value, which is the drift anchors exist to prevent.
============================================================ STEP 3c -- CLAIMS (the fine-grained record) ============================================================ Emit one CLAIM per substantive assertion in this ↪ conversation. Steps 1–3 build a structured INDEX; this is the record an index points at.
A claim is one sentence, self-contained, naming its subject ↪ rather than saying "she" or "it", with every figure kept verbatim. Set exchange_id to ↪ the turn identifier shown in the conversation.
WHAT TO EMIT -- anything either party actually asserted: a position, level, target, threshold, or rule ("<NAME> ↪ caps single names at 7%") a view and its reason ("<NAME> ↪ likes SCHN at 22x for grid exposure") an action taken ("<NAME> ↪ trimmed Orsted by 50bps on China lockdowns") a condition or commitment ("<NAME> passes if there is no audit by Q3") → a market fact either party cited ("copper closed at $8,510")
CLAIMS DO NOT NEED AN ENTITY. This is the point of the step. → A rule about unnamed counterparties, a portfolio-level threshold, a process the user follows -- none of these attach to a company, and they are exactly what the entity-keyed index above cannot hold. Leave entity_identifiers empty in those cases rather than forcing a match.
SET is_user_claim CORRECTLY. True when <NAME> asserted it, false when the other party did. Both are kept -- this records WHOSE claim it is, it does not filter. Getting it wrong is how the other party’s positions become <NAME>’s.
DO NOT: merge two assertions into one claim, restate the same assertion twice, invent anything not said, or emit pleasantries and scheduling ("talk Friday", "nice to meet you").
TWO FIELDS ON EVERY CLAIM, both needed by retrieval: topic_id -- the taxonomy id (same ids as the TOPIC tags above) the claim falls under, the most specific that fits. A question about "the higher-for-longer thesis" names no company; it reaches claims ONLY through this field. action_kind -- set when the claim records something <NAME> DID to a position or a view; null for observations and cited facts. Exactly one of: INITIATED ADDED TRIMMED EXITED UPGRADED DOWNGRADED TARGET_RAISED TARGET_CUT STOP_TIGHTENED STOP_LOOSENED HEDGED DEFERRED (decided to wait on a planned action) HELD "<NAME> trimmed Orsted by 50bps" is TRIMMED; "<NAME> moved COIN to Marketweight from Underweight" is UPGRADED; "<NAME> will trim if spreads fall below 35%" is a rule, not an action -- null. Whether <NAME> warmed or cooled on a name is later read from the SEQUENCE of these, so an action left untagged is a step missing from that path.
USER SELF-ATTRIBUTES (only when the user reveals one)
Separately from entities, capture stable facts the user reveals ABOUT THEMSELVES as an investor. For each, emit a USER_ATTRIBUTE node and a HAS_ATTRIBUTE edge from USER.
NODE: node_type=USER_ATTRIBUTE, identifier=<one KIND slug below>, label=<the kind>. EDGE: USER -[HAS_ATTRIBUTE]-> USER_ATTRIBUTE (no sentiment, no topic tags).
KINDS -- identifier MUST be exactly one of these; never invent, never free-form. If a self-attribute fits none of them, SKIP it -- do not force a bucket.
RISK_TOLERANCE -- the OVERALL amount of volatility / drawdown / loss the user is willing to accept as an investor. This is about HOW MUCH risk they can stomach -- not which specific risks they watch (that is RISK_FOCUS), and not their style (that is PREFERENCE). Emit it WHENEVER the user signals where they sit on the safety↔growth spectrum; do NOT skip a clear signal just because PREFERENCE or RISK_FOCUS is also present. ALSO set attribute_value to the closest level: CONSERVATIVE -- prioritises capital preservation, safety, income, stability; wants to avoid large drawdowns; shuns speculative names.
Cues: "yield plus safety", "I want stability", "I can't stomach big losses", "I stick to boring compounders". MODERATE -- accepts some volatility for growth; balanced; a mix of defensive and growth exposure. AGGRESSIVE -- chases high growth and will endure large drawdowns / high volatility / concentration for it. Cues: "I hold through any drawdown", "comfortable with big swings", "high-conviction concentrated bets", "all-in on the thesis".
Pick the closest; omit the level ONLY if the direction is genuinely unclear. RISK_FOCUS -- the specific risks the user actively watches (concentration, drawdown, inflation, rates/duration, geopolitical, liquidity, currency). GOAL -- an investment objective (retire by 50, income, capital growth). CONSTRAINT -- a hard limit, INCLUDING liquidity needs (no lockups > 2y, must keep cash accessible, no leverage, ESG-only). TIME_HORIZON -- investment horizon (short-term / multi-year / retirement). EXPERIENCE -- self-described expertise (beginner ... professional). PREFERENCE -- a durable style/preference (value investing, dividends, index-only).
The three risk-shaped kinds are DIFFERENT axes and often co-occur -- emit each that applies: RISK_TOLERANCE = how MUCH risk overall (a level) → RISK_FOCUS = WHICH risks they watch PREFERENCE = their STYLE. "Dividends for safety" is BOTH a dividend PREFERENCE and a CONSERVATIVE RISK_TOLERANCE -- do not collapse them into one.
WORLD vs SELF -- the deciding test: ENTITY memory = a third-person stance on a NAMED thing ("NVDA is overvalued"). USER_ATTRIBUTE = a first-person self-description that holds regardless of any specific instrument ("I’m risk-averse", "I want to retire by 50", "I can’t lock up cash for 2 years", "I’m a beginner").
RULES:
Classification ONLY -- flag WHICH kinds are present, plus the RISK_TOLERANCE controlled level (attribute_value). Do NOT write any prose value/description; the value sentence is produced later in synthesis.
Emit BOTH when warranted -- an attribute does NOT replace an entity view, and one self-description can reveal SEVERAL attributes at once. → Emit every kind that applies: "I’m bullish on NVDA because it fits my aggressive risk appetite" → NVDA INTERESTED_IN (BULLISH) AND → RISK_TOLERANCE (AGGRESSIVE). "My whole approach is yield plus safety -- dividends are the anchor and I hold boring compounders through any cycle" → RISK_TOLERANCE (CONSERVATIVE) AND PREFERENCE (dividend/income style). "I’m building one concentrated AI-supply-chain bet and I’ll ride out any drawdown" → RISK_TOLERANCE (AGGRESSIVE) AND RISK_FOCUS (concentration).
Boundary trap -- first-person "I am / I only / I always" → self-descriptions are ATTRIBUTES even when they name a concept: "I’m a value investor" → USER_ATTRIBUTE PREFERENCE "I only buy ESG names" → USER_ATTRIBUTE CONSTRAINT "I love dividends" → USER_ATTRIBUTE PREFERENCE Evaluating a concept as an external thing ("is ESG over-rated?") → ENTITY, not ATTRIBUTE.
Must be the USER’s own attribute -- never assistant advice. Do not invent; skip if merely implied. USER_ATTRIBUTE nodes are NOT tagged with topics.
At most one node per kind.
OUTPUT
Return JSON only -- no commentary. Match the ExtractionResult schema exactly: is_trivial: bool -- true ONLY for pure filler (greetings, one-word replies). extraction_confidence: float [0, 1]. entities: list of {node_type, identifier, label, entity_subtype?, attribute_value?, confidence?} (ENTITY, TOPIC_*, and any USER_ATTRIBUTE nodes; attribute_value only on RISK_TOLERANCE) claims: list of {text, exchange_id, is_user_claim, entity_identifiers?, topic_id, action_kind?} relations: list of {subject_identifier, relation_type, object_identifier, sentiment?, anchors?} (USER→ENTITY, ENTITY→ENTITY, ENTITY→TOPIC, and any USER→USER_ATTRIBUTE; anchors only on USER→ENTITY, and only when a revisable quantity was stated)
Synthesis
One call per session after extraction (SYNTHESISE in Algorithm 1). It receives the dated turns of both participants, one row per touched (entity, topic) pair with its stored text and sentiment, and one row per detected attribute with its stored value, and returns the new text of each. The attribute block is omitted when no attribute was detected.
Synthesis prompt
You are updating a long-term financial memory system for a user after a new conversation.
USER: <NAME> (graph id: <USER_ID>)
The conversation has two participants. Lines prefixed "<NAME>:" are the user whose memory this is. Lines prefixed "(other party)" are someone else -- never the memory’s subject.
NEW CONVERSATION: <DATED_CONVERSATION_TURNS>
ENTITY-TOPIC ROWS TO UPDATE
<ENTITY_TOPIC_ROWS_WITH_PRIOR_STATES>
USER SELF-ATTRIBUTES TO UPDATE
<ATTRIBUTE_ROWS_WITH_PRIOR_VALUES>
For EACH attribute kind above, write one updated value sentence describing what <NAME> revealed about THEMSELVES as an investor (not about any external entity):
FIDELITY FIRST -- anchor on what <NAME> ACTUALLY said. Preserve the concrete specifics verbatim where possible: named limits ("no leverage", "ESG-only"), figures and targets ("retire by 55", "10-15 year horizon"), the specific risks named ("concentration", "inflation"), the stated experience level ("20 years", "beginner"). These specifics ARE the value -- do not paraphrase them away into generic investor-speak.
DO NOT INVENT -- never introduce a limit, goal, figure, risk, or preference <NAME> did not state. E.g. do not add "liquidity" unless they raised it, and do not infer a goal from which stocks they hold. Stay minimal and close to their words.
EVERY kind listed above was already DETECTED as present, so it IS supported -- by this conversation, the prior value, or both. Locate that support and refer to it faithfully. NEVER reply that the attribute is undisclosed / unknown / not specified. If the conversation truly adds nothing for a kind, restate the prior value unchanged (and if there is no prior value, the kind would not be listed -- so find the statement in the conversation).
State the value plus its "why" when they gave one. For RISK_TOLERANCE the controlled level is given above -- the sentence must read consistently with it.
Merge with the prior value -- your output fully replaces it. EVOLUTION: if it shifted vs the prior value, capture the change, not just the endpoint.
Worked contrast for a CONSTRAINT stated as "no leverage, and I only buy ESG names": BAD: "<NAME> prioritizes liquidity and high-quality assets." (invented + generic) GOOD: "<NAME> will not use leverage and invests only in ESG-screened companies."
Return one SynthesisResult entry per kind with entity_id = the KIND slug (e.g. "RISK_TOLERANCE"), and sentiment = null (attributes never carry sentiment).
Max 600 characters; use "<NAME>", never pronouns. Keep figures (<NAME> stated exact (targets, %, limits, dates) -- the raw conversation is not stored, so a dropped figure is lost permanently.
ONE ROW PER (ENTITY, TOPIC) -- SCOPE EACH ROW
Each row above is a SEPARATE memory covering ONE topic for that entity. The row header names the topic and the specific angles discussed under it.
STAY IN SCOPE. Write only what this conversation says about THAT topic. Material belonging to another row is that row’s job -- never repeat it. Row NVDA @ 12_valuation -> the multiple, the price, what it is worth. Row NVDA @ 12_income_statement -> revenue, margins, segment growth. Writing "bullish on datacenter growth but wary at 40x" into BOTH rows is the failure mode this design exists to prevent: it produces two near-identical memories that crowd each other out of retrieval.
OMIT A ROW in either of these cases -- omission is a normal outcome, not an error: (a) it HAS a prior memory and this conversation adds nothing new about that topic; the stored value then stays untouched, which is preferred over restating it or padding it with another topic’s material. (b) another row for the SAME entity already carries this view. The topic rows are proposed mechanically from tags, so a single thesis sometimes gets split across two of them. When that happens, write it ONCE in the row it fits best and omit the other -- do NOT paraphrase the same view into both. e.g. "TSM has pricing power as the indispensable foundry" is ONE view: put it in the row whose angles match it, and drop the other row.
NEVER drop an entity entirely. Every entity in the list must end up with at least one row. If all of an entity’s rows show "prior memory: none", at least one MUST be written -- there is nothing stored to fall back on, so omitting them all destroys the memory. Where the conversation is thin, write the little it supports -- even just the reason the entity came up.
Each row’s sentence must stand alone. A reader seeing only that row must understand the view, so do not write "as noted above" or refer to other rows.
Sentiment is per row. <NAME> can be bearish on valuation and bullish on growth
at the same time; that is the point of separating them. ↪ Set each row’s sentiment from ITS OWN content, not from an overall stance on the entity.
Echo topic_id back exactly as given. A row whose topic_id was not requested is discarded.
TASK
For EACH row above, write one updated context sentence that merges prior memory with new signal from this conversation. This is the single authoritative memory record for this user-entity-topic triple -- your output fully replaces the prior context, it is not appended.
A useful sentence captures, whenever the conversation supports it:
STANCE -- what <NAME> believes about the entity, and how strongly (conviction).
DRIVER -- the reasoning behind that stance: the specific angle engaged (valuation, growth, margins, a catalyst, management, a macro factor). Always pair a view with its "why". The row’s topic IS the angle -- go deep on it rather than surveying every angle of the entity.
ANCHORS -- concrete specifics cited: price levels, targets, multiples, dates, catalysts, % moves. Prefer numbers over adjectives.
EVOLUTION-- if the view shifted vs prior memory, capture the change, not just the endpoint: "was bullish pre-earnings; trimmed post-print, remains net long."
RULES:
Output one entry per ROW you have new signal for -- exact entity_id AND topic_id from the list above. Omit rows with nothing new (see scoping rules).
Sentences must stand alone: use "<NAME>" and entity identifiers, never pronouns.
Record <NAME>’s OWN view and reasoning -- not generic facts about the entity, and not the other party’s opinion. Their lines are shown ONLY so you can resolve what <NAME> is referring to. An assertion <NAME> did not take up is NOT a memory.
EVERY FIGURE BELONGS TO WHOEVER SAID IT. Before writing any number, trigger level, position size or target into the sentence, locate the turn it came from: said in a <NAME> turn -> it is theirs; state it plainly. said by the other party, and <NAME> explicitly adopted it ("I agree", "let’s use that", "that’s my level too") -> it is theirs; state it plainly. said by the other party, and <NAME> merely replied, discussed, or reacted -> NOT theirs. ↪ Either omit it, or attribute it ("the counterparty’s $8,700 trigger"). Engagement with an ENTITY does not transfer the other party’s numbers about it.
Worked example -- the other party says "copper is ~$10 shy of my $8,700 trigger to add 15% to my copper position" and <NAME> replies about copper generally: BAD: "<NAME> ... is considering a 15% position increase at the $8,700 trigger." GOOD: "<NAME> remains bullish on copper" (their own view; the $8,700 and the 15% are the counterparty’s and belong to no memory of <NAME>). This is the single costliest error available here: it manufactures commitments <NAME> never made, and reads back as fact with no way
↪ to tell it is wrong.
A sentence with no stance AND no "why" is a failure: BAD: "<NAME> discussed NVDA’s earnings." (no view, no reasoning) ↪ BAD: "NVDA is a leading AI chipmaker." (generic fact, not the user’s view) GOOD: "<NAME> is bullish on NVDA into earnings, expecting a datacenter beat to push past a 600 price target, but flags China export controls as the key risk."
Reinforcement: if the new conversation confirms prior memory, reflect increased conviction.
First time (prior memory none): summarise only what this conversation reveals -- do not invent.
INTERESTED_IN entities: set sentiment to the net view, and the context sentence MUST read consistently with that label -- the two are reviewed side by side as a sentiment drift timeline, so they can never contradict. BULLISH -- context leans net positive (upside/long/constructive). BEARISH -- context leans net negative (downside/short/cautious-to-negative). MIXED -- context cites MATERIAL offsetting positive AND negative drivers with no clear net winner within THIS topic (e.g. under 12_valuation: "cheap on FCF yield but rich on forward P/E"). Use MIXED here, NOT NEUTRAL. NEUTRAL -- <NAME> is engaged but genuinely expresses no directional lean (rare). The context must NOT read directionally bullish/bearish if you pick NEUTRAL. Never emit a directionally-worded context with a NEUTRAL or opposite-direction label. 6b. ATTRIBUTION -- WHOSE VIEW IS IT. Facts and framing may come from the assistant; the STANCE must be <NAME>’s. A row’s sentence states what <NAME> thinks or did -- never what the assistant concluded, however well argued. The failure this exists to stop: <NAME> ASKS a question ("is AAPL good right now?"), the assistant answers with analysis, and the row is written as though that analysis were <NAME>’s own position ("...viewing the company as high quality but at a full valuation"). <NAME> said none of it. They asked. When the turn is a QUESTION, the honest sentence records the asking and the subject -- "<NAME> asked whether AAPL is attractive at the current price" -- not the answer. Whatever the assistant said is already preserved as a CLAIM; it does not need to be laundered into a memory to survive.
MENTIONED entities (no thesis): sentiment must be null -- capture WHY the entity came up and how it connects to <NAME>’s other interests, rather than a stance. A null-sentiment context must NOT assert a bullish/bearish stance.
Consider how entities relate to each other within this conversation when writing context.
Max 600 characters. Be information-dense -- every clause should add signal, not filler. NOTHING outside this record survives: the raw conversation is not stored, so a figure or commitment you leave out is lost permanently, not merely summarised away. When the budget binds, preserve in THIS order and drop from the bottom: (a) NUMBERS and hard commitments stated by <NAME> -- price levels, targets, multiples, % position sizes, thresholds, dates, deadlines. Keep them exact ("adds below 850", "trimmed at 55x", "caps NVDA at 7%"), never rounded or softened into words like "high" or "a lot", and never converted to another scale -- 8% stays "8%", not "0.08". (b) the stance and its direction. (c) the reasoning / driver behind it. (d) narrative colour and framing.
THREE RULES FOR FIGURES, in order of precedence: i. CARRY FORWARD. A figure in the prior memory that is still current must survive ↪ even when this conversation never mentions it. → The conversation is not stored; dropping the figure deletes it from the system → permanently. If prior memory says "adds below 850" and today’s turns are → about margins, the new sentence still says "adds below 850". ii. REPLACE ON REVISION, and show the move. When <NAME> supersedes a figure, → state the change rather than only the endpoint: → "cut the cap from 10% to 7%". Never leave the old value asserted as if it were → current. iii. STAY IN YOUR ROW. State a figure in the row → whose topic it belongs to, and do NOT restate another row’s figure. Two copies of → one number drift apart the moment one row is updated and the other is not, → and the stale copy then reads as a current commitment. An entry level belongs → in the positioning row, a multiple in the valuation row -- not in both.
Return JSON only matching the SynthesisResult schema: entities: list of { entity_id, topic_id, context, → sentiment }
Quantity resolver
Called only for new commitments that have stored candidates with the same entity, kind, unit, currency and period (§ 4.3). {user} is the graph owner and {blocks} holds one block per contested figure, built by the code below; candidate indices are local to each block. A match reuses the stored slot; null, a missing decision or an out-of-range index gives the figure a new slot.
Resolver prompt
A memory system tracks the quantities {user} has committed
→ to -- position sizes, caps,
stops, add/trim levels, targets, yields, estimates. A later
→ value REPLACES an earlier one
only when both are the SAME quantity. Decide that for each
→ new figure below.
SAME quantity -- the new figure revises or restates the
→ stored one:
- the same decision variable, about the same position,
→ account and scenario
- "my stop is 48" then "moved the stop to 45"; "PT 410"
→ then "raising my target to 500"
DIFFERENT quantity -- even with the same entity, kind and
→ unit:
- another account, mandate, client or portfolio sleeve
- another scenario or case (base vs downside vs upside)
- planned vs actual (a starter size being considered vs
→ the weight actually held)
- a part vs the whole (the amount trimmed or added vs the
→ resulting position)
- a different trigger (a stop-loss vs a profit-taking trim;
→ an add on a dip vs an add
on a breakout), a different instrument or leg, a
→ different horizon
- somebody else’s number
When the descriptions do not settle it, answer DIFFERENT: a
→ wrongly merged quantity
destroys the old value’s identity, a wrongly split one only
→ costs a duplicate line.
{blocks}
Return one decision per NEW figure.
blocks = [] for n, (_, anchor, cands) in enumerate(contested): cur = f"{anchor.currency}" if anchor.currency else "" lines = [f"NEW {n}: {cands[0].entity_id} {anchor. kind.value} {cur}", f"{anchor.basis or anchor.qualifier or '(no description)'} -- " f"{anchor.comparator.value} {anchor.value:g} {anchor.unit.value}{cur}", "STORED quantities of this kind:"] lines += [f" {j}: {c.describe()}" for j, c in enumerate(cands)] blocks.append("\n".join(lines))
Router
The only generative call at retrieval; the question embedding and, for unresolved names, entity embeddings are separate requests. The router returns a grounding label, not weights: the code maps it to the of Table 12. If the output cannot be parsed, retrieval proceeds with an empty intent whose grounding is semantic-only.
Router prompt
You are a financial query router for a personal memory
→ system. Classify what this query needs so the
retriever can fetch the right kinds of stored
→ memory.
QUERY: <QUESTION>
WHO IS ASKING: <NAME> (memory owner id: <USER_ID>)
Every memory in this store already belongs to <NAME>, so <
→ NAME> is NEVER an entity_ids
value -- naming them there matches everything and therefore
→ grounds nothing. The same goes
for first-person references ("my", "I") and for pronouns
→ standing in for <NAME>.
Other people go in person_ids, NOT entity_ids: a
→ counterparty, a colleague, an analyst,
whoever <NAME> was talking to. entity_ids is for SUBJECTS <
→ NAME> holds views about --
companies, tickers, sectors, instruments, macro factors. The
→ split matters because an
unresolved entity_ids value is read as "this store has
→ nothing on that", and a person's
name never resolves to a subject even when the store answers
→ the question.
A person named as the SUBJECT of an opinion ("what does she
→ think of Jensen Huang?")
belongs in entity_ids; a person named as a conversation
→ participant does not.
Topic taxonomy (closed vocabulary -- use exact ids only).
Prefer the most specific level (L3 > L2 > L1). Empty list if
→ no clear topic.
l1_fundamental
l2_income_statement: l3_revenue_growth, l3_gross_margin,
→ l3_ebitda, l3_net_income, l3_operating_leverage,
→ l3_pricing_power, l3_cost_structure, l3_revenue_mix
l2_balance_sheet: l3_debt_equity, l3_cash_position,
→ l3_working_capital, l3_goodwill, l3_covenant_risk,
→ l3_asset_quality, l3_net_debt
l2_cash_flow: l3_free_cash_flow, l3_capex_cycle,
→ l3_cash_conversion, l3_dividend_coverage,
→ l3_cash_burn, l3_operating_cash_flow
l2_valuation: l3_pe_ratio, l3_ev_ebitda, l3_ev_sales,
→ l3_dcf, l3_sum_of_parts, l3_comps, l3_precedent_tx,
→ l3_nav, l3_price_target, l3_lbo, l3_fcf_yield
l2_management_quality: l3_guidance_accuracy,
→ l3_capital_allocation, l3_insider_ownership,
l3_esg_governance, l3_compensation, l3_track_record,
→ l3_board_composition, l3_related_party
l1_market_dynamics
l2_price_action: l3_breakout, l3_support_resistance,
→ l3_volume_anomaly, l3_momentum,
↪ l3_relative_strength, l3_technical_indicators l2_institutional_flow: l3_13f, l3_block_trades, ↪ l3_etf_flows, l3_options_flow, l3_short_interest, ↪ l3_passive_rebalancing l2_sentiment: l3_upgrade, l3_downgrade, l3_short_squeeze, ↪ l3_retail_sentiment, l3_market_sentiment, ↪ l3_options_sentiment, l3_consensus, ↪ l3_earnings_revision, l3_pt_revision l2_liquidity: l3_bid_ask, l3_market_depth, l3_adv, ↪ l3_float, l3_execution_cost l1_corporate_actions l2_earnings_events: l3_earnings_date, l3_eps_surprise, ↪ l3_revenue_surprise, l3_guidance_raise, ↪ l3_guidance_cut, l3_analyst_day, l3_preannouncement, ↪ l3_earnings_call l2_ma_activity: l3_acquisition_target, l3_deal_synergies, ↪ l3_antitrust, l3_spinoff, l3_asset_sale, ↪ l3_merger_arb, l3_deal_premium, l3_strategic_review l2_capital_structure: l3_buyback, l3_convertible, ↪ l3_dividend_init, l3_rights_issue, ↪ l3_secondary_offering, l3_debt_refinancing, ↪ l3_credit_rating l2_management_changes: l3_ceo_change, l3_cfo_hire, ↪ l3_board_change, l3_activist, l3_founder_departure l1_quant_risk l2_factor_exposure: l3_quality_factor, l3_momentum_factor, ↪ l3_low_vol, l3_value_factor, l3_growth_factor, ↪ l3_size_factor, l3_profitability l2_portfolio_risk: l3_beta, l3_var, l3_correlation, ↪ l3_drawdown, l3_concentration, l3_tail_risk, ↪ l3_tracking_error, l3_stress_test, l3_sharpe l2_earnings_quality: l3_accrual_ratio, l3_rev_recognition, ↪ l3_audit_quality, l3_restatement, l3_non_gaap, ↪ l3_financial_distress l1_macro_sector l2_macro_environment: l3_interest_rates, l3_fed_policy, ↪ l3_yield_curve, l3_inflation, l3_employment, l3_gdp, ↪ l3_recession, l3_credit_spreads l2_sector_dynamics: l3_market_share, l3_sector_pricing, ↪ l3_tam, l3_moat, l3_supply_chain, ↪ l3_inventory_cycle, l3_regulation, l3_disruption, ↪ l3_consolidation l2_geopolitical_risk: l3_tariffs, l3_sanctions, ↪ l3_regulatory_probe, l3_trade_war, ↪ l3_export_controls, l3_country_risk, l3_elections l2_commodities_fx: l3_energy_prices, l3_metals_prices, ↪ l3_agricultural_commodities, l3_fx_rates, ↪ l3_commodity_cycle, l3_fx_hedging
Return JSON matching the QueryIntent schema. Be decisive ↪ about query_type, and set needs_history only when ↪ the past state is genuinely required -- a present- ↪ tense question answered from a superseded state is ↪ a wrong answer, not a partial one.
Answer
Shared by all methods; only <CONTEXT> differs (the memory context, the full transcript, or the gold evidence turns). No reference answer is included. A reply of exactly “No information available in memory.” is recorded as a decline. Gemini receives the output schema through its native structured- output interface; Nemotron receives a strict schema and a short appended instruction to return only the JSON object.
Answer prompt
You are answering a question from a personal financial
↪ memory system.
CONTEXT below is everything the system remembers about <NAME>
↪. It is not a document and
not a transcript -- it is a lossy memory record, and it is
↪ deliberately incomplete. Plenty
of true things about <NAME> are simply not in it.
QUESTION: <QUESTION>
CONTEXT:
<CONTEXT>
HOW TO ANSWER
1. SUPPORT CHECK. For each part of your answer, locate the
↪ specific line in context that
supports it. If you cannot point to one, you do not have
↪ the answer -- say so. Do not
fill a gap by reasoning from what a person like <NAME>
↪ would plausibly do.
2. FALSE PREMISE. A question can presuppose something that
↪ never happened -- “what did
<NAME> ultimately execute”, “what leverage did <NAME> use
↪”, “what did <NAME> do with
the proceeds”. If CONTEXT does not show that it happened,
↪ the question is unanswerable.
Do NOT answer with the nearest similar thing <NAME> did; that
↪ is a confident wrong
answer, which is worse than no answer.
3. WRONG SUBJECT -- and read this one carefully, because it
↪ cuts finely.
Unanswerable: what ANOTHER PERSON thinks, holds, decided,
↪ or did. CONTEXT is <NAME>’s
memory and holds no record of anyone else’s positions
↪ or intentions. “What is her
colleague’s target”, “what did he do with the proceeds”
↪ -- decline.
ANSWERABLE: a figure that originated elsewhere but which
↪ <NAME> CITED, relayed, or
reacted to, when CONTEXT records it. A bank’s estimate,
↪ a conference statistic,
company’s guidance, a market print -- these are
↪ legitimately in <NAME>’s memory and
EXACT FIGURES mark each with who stated it. “What
↪ EBITDA cut did the broker apply”,
“what default rate was flagged” -- answer these from
↪ CONTEXT, and say whose figure it
is. Do NOT decline merely because a third party is
↪ named in the question.
The test is whose STATE OF MIND is being asked about, not
↪ whose mouth a number came
out of.
4. WHICH VALUE -- decide this before reading off any number.
↪ Most quantities here were
revised, so CONTEXT usually holds several values for the
↪ thing being asked about.
- The question pins a MOMENT: a date, “initially”, “at
↪ first”, or an event or
condition (“after the Fed signal”, “when he trimmed”,
↪ “following the guide-down”,
“on the February sale”). Answer with the value tied
↪ to THAT moment -- the dated
statement or series entry that matches the event --
↪ even though a later value
exists. The latest value is the wrong answer to a
↪ question about an earlier one.
- The question asks about NOW (“currently”, “latest”,
↪ “where does it stand”) or
about how something CHANGED: use the latest value, or
↪ walk the series in order.
- The question pins nothing: prefer the dated statement
↪ whose wording matches the
question’s own details (the same action, size,
↪ counterpart figure) over a value
that merely shares the entity.
For the same quantity at the same date, EXACT FIGURES
↪ beat the prose, which may be
rounded or loosely restated. They do NOT beat a dated
↪ statement about a different
moment -- a different date is a different fact, not a
↪ less exact one.
5. PREVIOUSLY HELD states are what <NAME> used to think.
↪ They are the right source when
rule 4 points at the past; never present one as <NAME>’s
↪ current view.
6. HOW MANY DAYS. If the QUESTION itself gives both dates,
↪ the answer is the difference
of those two dates; CONTEXT only has to confirm the
↪ events happened. Otherwise, when
dated lines carry a “day N” marker, the days between two
↪ events
is the difference of their markers -- find the line for
↪ EACH event the question names,
then subtract. Do not subtract calendar dates by hand,
↪ and do not use a line merely
because it is dated: it must be the event the question
↪ describes. A statement made in
a conversation about something that happened "yesterday"
↪ or "last week" happened
that much before the line’s date.
7. WARMED OR COOLED means CONVICTION in the thesis, not
↪ position size. Read it from the
whole record in date order -- statements of view, ratings,
↪ targets, what <NAME> kept
returning to -- and then from the actions. Strongest
↪ signals: an upgrade or downgrade,
a target raised or cut, a thesis restated with more or
↪ less confidence, a name called
a top pick or dropped from consideration. Sizing moves
↪ are weaker and ambiguous: a
trim can be risk management or profit-taking inside a
↪ thesis that is strengthening,
and an add can be mechanical. Do not call a trim "cooling
↪ " when the stated view in the
same period is unchanged or firmer. Where signals
↪ conflict, the stated view decides
and the sizing move is mentioned as context. Where the
↪ path reversed, answer where it
ENDED relative to where it began, and say so.
If rule 1, 2 or 3 applies, reply with exactly this and
↪ nothing else:
No information available in memory.
Otherwise fill EVERY field:
value -- the bare answer, nothing around it.
↪ Several values are separated by
"; " in the order the question asks.
"What is her CDS trigger?" ->
↪ 550bps
"...target widen, and what multiple?" ->
↪ 15-20bps; 2-3x
"How many days between X and Y?" -> 17
↪ days
answer -- the same content as one or two sentences,
↪ naming EVERY element the
question asks for. For a question about how
↪ something EVOLVED or about
an OVERALL APPROACH, this must characterise
↪ it, not just cite a number.
↪ her $4B threshold and rose to
↪ $9.4B; the $9.4B unrestricted cash
↪ moved her back to Marketweight.
abstained -- false here; true only in the decline case
↪ above.
supported_by -- the CONTEXT lines you relied on, quoted
↪ short.
Reuse CONTEXT’s figures verbatim in both. Do not pad ‘value‘,
↪ and do not truncate
‘answer‘ to a bare figure -- they are different renderings
↪ on purpose.
Answer the whole question. If it has two parts and CONTEXT
↪ supports only one, give that
part and note the other is not in memory; abstained stays
↪ false -- do not decline the
entire question over a missing half.
Judge
Used for answerable questions. {candidate} is the reader’s answer field (its value field if answer is empty). The judge sees the question, the reference and the candidate, but neither the context nor the method. Verdicts score 1 (correct), 0.5 (partial) and 0 (incorrect); an unrecognised verdict scores 0. Declines on unanswerable questions are read from the reader’s abstained field, without the judge.
Judge prompt
You are grading one answer from a memory system against
↪ reference answer.
QUESTION: {question}
REFERENCE: {gold}
CANDIDATE: {candidate}
Grade ONLY whether the candidate conveys the same
↪ substantive answer as the reference.
IGNORE: length, phrasing, word order, extra correct detail,
↪ and any hedging.
A terse candidate that gives the right figures is CORRECT
↪ even if the reference is a
full sentence. A verbose candidate is CORRECT if the right
↪ answer is in there.
PARTIAL: the question asks for several things and the
↪ candidate gets some but not all.
INCORRECT: a different value, the wrong entity, the wrong
↪ person’s figure, a declined
answer where the reference has content, or an answer that
↪ contradicts the reference.
Numbers must match to be correct. $9.4B and $9.4 billion are
↪ the same; $9.4B and $9.7B
are not.
The prompt is followed by an instruction to return only a JSON object with the fields verdict (CORRECT, PARTIAL or INCORRECT) and reason (one short clause).
References
- [1]Zhiyu Chen, Wenhu Chen, Charese Smiley, Sameena Shah, Iana Borova, Dylan Langdon, Reema Moussa, Matt Beane, Ting-Hao Huang, Bryan Routledge, and William Yang Wang. 2021. FinQA: A dataset of numerical reasoning over financial data. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 3697–3711.arxiv.org/abs/2109.00122
- [2]Zhiyu Chen, Shiyang Li, Charese Smiley, Zhiqiang Ma, Sameena Shah, and William Yang Wang. 2022. Con-vFinQA: Exploring the chain of numerical reasoning in conversational finance question answering. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 6279–6292.DOI
- [3]Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. 2025. Mem0: Building production-ready ai agents with scalable long-term memory. arXiv preprint arXiv:2504.19413.arxiv.org/abs/2504.19413
- [4]Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, Dasha Metropolitansky, Robert Osazuwa Ness, and Jonathan Larson. 2025. From local to global: A graph rag approach to query-focused summarization. Preprint, arXiv:2404.16130.arxiv.org/abs/2404.16130
- [5]Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yi Dai, Jiawei Sun, Meng Wang, and Haofen Wang. 2024. Retrieval-augmented generation for large language models: A survey. Preprint, arXiv:2312.10997.arxiv.org/abs/2312.10997
- [6]Lavanya Gupta, Saket Sharma, and Yiyun Zhao. 2024. Systematic evaluation of long-context LLMs on financial concepts. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: Industry Track, pages 1163–1175, Miami, Florida, US. Association for Computational Linguistics.DOI
- [7]Yuanzhe Hu, Yu Wang, and Julian McAuley. 2025. Evaluating memory in LLM agents via incremental multi-turn interactions. arXiv preprint arXiv:2507.05257.arxiv.org/abs/2507.05257
- [8]Yizheng Huang and Jimmy Xiangji Huang. 2026. A survey on retrieval-augmented text generation for large language models. ACM Computing Surveys, 58(12):1–38.DOI
- [9]Pranab Islam, Anand Kannappan, Douwe Kiela, Rebecca Qian, Nino Scherrer, and Bertie Vigen. 2023. FinanceBench: A new benchmark for financial question answering. arXiv preprint arXiv:2311.11944.arxiv.org/abs/2311.11944
- [10]Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. 2024. Evaluating very long-term conversational memory of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13851–13870, Bangkok, Thailand. Association for Computational Linguistics.
- [11]Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ton Stojanovic, and Joseph E. Gonzalez. 2024. Memgpt: Towards llms as operating systems. Preprint, arXiv:2310.08560.arxiv.org/abs/2310.08560
- [12]Preston Rasmussen, Pavlo Palychuk, Travis Beauvais, Jack Ryan, and Daniel Chalef. 2025. Zep: a temporal knowledge graph architecture for agent memory. arXiv preprint arXiv:2501.13956.arxiv.org/abs/2501.13956
- [13]Aditi Singh, Abul Ehtesham, Saket Kumar, Tala Talei Khoei, and Athanasios V. Vasilakos. 2026. Agentic retrieval-augmented generation: A survey on agentic rag. Preprint, arXiv:2501.09136.arxiv.org/abs/2501.09136
- [14]Haoran Tan, Zeyu Zhang, Chen Ma, Xu Chen, Quanyu Dai, and Zhenhua Dong. 2025. Membench: Towards more comprehensive evaluation on the memory of llm-based agents. In Findings of the Association for Computational Linguistics: ACL 2025, pages 19336–19352.arxiv.org/abs/2506.21605
- [15]Piaohong Wang, Motong Tian, Jiaxian Li, Yuan Liang, Yuqing Wang, Qianben Chen, Tiannan Wang, Zhiqiong Lu, Jiawei Ma, Yuchen Eleanor Jiang, and Wangchunshu Zhou. 2025. O-mem: Omni memory system for personalized, long horizon, self-evolving agents. arXiv preprint arXiv:2511.13593.arxiv.org/abs/2511.13593
- [17]Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. 2025. A-mem: Agentic memory for llm agents. Preprint, arXiv:2502.12110.arxiv.org/abs/2502.12110


