USE CASE
Causal memory for a trading research agent
A P&L number tells you what happened. A causal decision journal tells you which part of your reasoning was wrong — and what you would have gotten if you had done the other thing.
Updated · English
Who this is for
For research and trading agents that review their own decisions, where the goal is a better decision process rather than a return promise.
The failure mode it fixes
These are not hypothetical; each one is a direct consequence of storing text instead of causal structure.
Outcome bias hides process quality
A bad decision can make money and a good one can lose. Without a record of the thesis, the context and the alternative that was rejected, a review cannot tell skill from luck — so the wrong lesson gets reinforced.
The market regime is not stored with the decision
The same rule behaves differently in different regimes. If the decision is recorded without the volatility and liquidity context it was made in, later recall compares situations that were not comparable.
Counterfactuals are guessed, not queried
Reviews ask 'what if we had not cut exposure?' and answer from memory. The alternative was known at decision time; if it was recorded, the comparison becomes evidence instead of narrative.
The journal is prose nobody queries
A notes file grows for years and is never read again. A structured, searchable edge is what a review can actually use.
How causal memory is used
The loop is always the same three fields — decision, context, outcome — plus one rule: record after the outcome, not before.
Record the decision with the alternative attached
Every position or sizing decision becomes an edge: the decision, the alternative that was rejected, the context (regime, volatility, liquidity), and the outcome observed later. Recording the alternative is what makes a counterfactual query possible instead of rhetorical.
- task_tag: the decision type — entry, exit, sizing, hedge, review.
- context: regime and constraints, so two decisions are only compared when they are comparable.
- outcome: fill it in when the horizon closes, not at entry. An unobserved outcome is not an edge yet.
Compare against the path not taken
counterfactual_query contrasts the recorded decision with the stated alternative in similar historical situations. It reports empirical evidence from the graph — not a market simulation and not a forecast. The output is a comparison of what the two choices produced, which is exactly what a review needs.
- The alternative must be written at decision time; inventing it later is hindsight.
- A result of 'insufficient evidence' is a valid answer and should be reported as such.
- This is a research tool; it does not predict prices and does not produce buy or sell calls.
Review the process, not only the P&L
At the review horizon, search the decision type and read the edges in order. The useful question is not 'did this make money' but 'was the reasoning that produced it sound, and did the outcome follow for the reason we expected'. CausalEval C3 counterfactual is the capability under test here: 95% vs 80%.
- Score the process separately from the outcome.
- Supersede a rule when the evidence falsifies it; keep the old edge for the counterfactual record.
- Look for repeated task_tags with opposite outcomes — that is where the process is inconsistent.
What the calls look like
The same JSON shape works over stdio MCP, the HTTP transport and the DSH plugin.
{
"name": "record_decision",
"arguments": {
"decision": "cut gross exposure before the scheduled macro release",
"outcome": "realised volatility stayed below the level the position was sized for",
"relation": "caused",
"task_tag": "sizing",
"context": "event week, elevated implied vol, thin liquidity in the underlying"
}
}{
"name": "counterfactual_query",
"arguments": {
"decision": "cut gross exposure before the scheduled macro release",
"alternative": "hold gross exposure through the macro release",
"task_tag": "sizing",
"limit": 5
}
}{
"name": "search_causal",
"arguments": {
"task_tag": "sizing",
"query": "event-week exposure decision",
"limit": 5,
"detail_level": "l2"
}
}What to watch over three months
Track these on your own data. The published numbers are benchmark baselines, not a promise about your repository or your incidents.
| Metric | Reference | How to read it |
|---|---|---|
| Decision review coverage | Track quarterly | Share of positions whose thesis, alternative and outcome are all recorded. A journal with missing alternatives cannot support counterfactual review. |
| Counterfactual accuracy | 95% vs 80% | CausalEval C3, choosing between alternatives with known outcomes, against the mem0 baseline on the 70-question protocol. |
| Thesis hit rate | Track per strategy | How often the recorded outcome matched the recorded expectation, independent of P&L. We publish no customer numbers for this. |
| Belief revision | 100% | CausalEval C7: superseding a rule after falsification. Relevant when a regime change invalidates a rule that used to work. |
| Repeat-mistake rate | 33% vs 67% | trap-world benchmark, causal-memory vs the fact-store baseline. For a research process, track re-entered positions that repeat a previously recorded error. |
Benchmark figures come from the causal-memory README and CausalEval v13; see the CausalEval page for protocol and limitations.
Trading agent questions
- Is this investment advice?
- No. causal-memory is a memory and research tool. It records decisions and their observed outcomes and compares them; it does not generate buy or sell recommendations, targets, or return promises. Nothing on this page is investment advice.
- Does it predict prices?
- No. counterfactual_query compares the recorded outcomes of a decision and a stated alternative in similar past situations. That is an empirical comparison over stored evidence, not a forecast and not a simulation of the market.
- What is the minimum useful journal?
- Three fields per decision: the decision, the alternative rejected, and the context. Without the alternative, the review can only ask 'did it work'; with it, the review can ask 'was it better than the other choice'.
- How is this different from a spreadsheet journal?
- A spreadsheet stores rows; it does not rank them by causal relevance or answer a counterfactual across years of entries. The graph does both, and the same store also holds the facts and context the decision depended on.
- Can a research team share the journal?
- The server supports multi-tenant HTTP with a token file, one database per tenant, so teams can isolate journals. The engine and this website are not a broker, an exchange or an order-routing system.
Related
Use case
- Causal memory for an on-call agentAn incident timeline records what happened. Causal memory records which mitigation actually prevented the worse outcome — and which one only looked like it did.
- Causal memory for a coding agentA coding agent already remembers the diff. Causal memory makes it remember why the diff was wrong the first time.
Integration
- causal-memory with DeepSeek HarnessA native plugin rather than an MCP bridge: 17 tools with clean names, plus a system-prompt section that makes the agent check memory before it acts.
- causal-memory with Claude CodeClaude Code already reads your repository. Give it the one thing a repository cannot store: why a decision was made, and what it prevented.
Run it on one real decision
Record a decision you already made, add the outcome when you know it, and ask for it back a week later. That single loop is the whole evaluation.