Current Blog
Why Trading Agents Need Context Across Runs
A useful trading agent needs an inspectable record of goals, evidence, assumptions, tests, corrections, and unresolved questions. A longer chat history cannot supply those relationships by itself.
By alyc
Context answers a practical question: what must survive when a trading investigation resumes tomorrow? The useful record includes the goal, constraints, evidence, assumptions, tests, corrections, outcomes, and unresolved questions. A transcript helps with recall. It does not, by itself, show which claim is active, which source supports it, what changed, or whether the current run has authority to act.
A transcript is not a workflow state
Conversation history preserves sequence. Workflow context preserves meaning. A later run needs the objective that governed a test, the data available at that time, the assumptions frozen before the test, and the status of every material result. Without those links, a fluent summary can still recommend the wrong next step.
Trading makes the distinction unforgiving. A thesis can remain readable after its price input, venue condition, or account constraint has expired. Retrieval should bring back the record together with its source time, owner, and review state, not present every remembered sentence as equally current.
Memory layers answer a different question from authority
Working memory holds the material needed for the present step. Episodic memory preserves what happened in a particular run. Semantic memory carries durable concepts or facts. Procedural memory retains a reusable method. These categories describe how information is organized and retrieved; they do not say whether the information is current, correct, or permitted to control a decision.
A procedural record can be useful and expired. An episodic observation can be recent and disputed. A semantic fact can be superseded by a corrected source. The authority label therefore belongs beside the memory type, never inside it. Research such as FinMem studies layered memory for trading agents, while Agent Workflow Memory studies reusable routines; neither result grants a stored record present-day authority in Mattheus.
Seven states make retained context reviewable
This article proposes seven editorial states: active, superseded, disputed, failed, observed, unresolved, and expired. Active material may guide the current research step. Superseded material stays visible and points to its replacement. Disputed material keeps the competing evidence and the person or test needed to resolve it. Failed material records the attempted path and its failure condition.
Observed is deliberately narrow: it records what a source or tool returned without promoting that return into a conclusion. Unresolved keeps a question alive across runs. Expired marks a fact, instruction, or permission that has crossed its freshness boundary. Storage preserves history; a controlled transition determines what may guide the next step.
A worked example across three runs
Run one asks whether a volatility condition precedes a change in an anonymized equity basket. The record freezes the universe, observation window, cost assumption, and rejection rule. A market-data response is stored as observed. The proposed relationship remains unresolved because no eligible test has run.
Run two discovers that a feature published at 09:35 was used for a simulated 09:30 decision. That five-minute leak invalidates the decision even though both records share the same date. The test becomes failed, its conclusion is not promoted, and the leakage finding becomes active.
Run three starts from that record, replaces the feature with a time-valid version, links the old assumption as superseded, and runs a new test under a new identifier. It does not rewrite run one. This matters because financial-agent evaluation can otherwise confuse historical memorization, market exposure, or leaked data with transferable decision quality.
The minimum record is small but relational
A useful item needs an immutable identifier, type, payload or digest, source, observed-at time, effective interval, owner, memory layer, authority state, and freshness rule. It also needs edges such as derived-from, supports, contradicts, supersedes, tested-by, and corrected-by. The W3C PROV family supplies a general vocabulary for entities, activities, agents, derivation, versioning, and reproducibility.
That shape answers concrete questions. Which source produced this observation? Which test relied on it? What replaced the invalid assumption? Who marked the replacement active, and when does that decision expire? A longer prose summary cannot answer reliably unless those relationships survive beside it.
Selection, forgetting, and contradiction are controls
A context system should not retrieve everything. Selection can prefer records that match the current goal, instrument, time window, and authority state. Forgetting can delete private or low-value material under a declared retention policy while preserving an auditable tombstone where required. Contradiction handling should surface incompatible records together instead of letting retrieval order decide which one appears true.
Persistent memory also expands the attack surface. MemPoison reports that content injected through ordinary interactions can remain in agent memory and influence later behavior, including through combinations of records that appear harmless alone.
Practical defenses therefore include scoped writes, source and owner attribution, write-time validation, retrieval-time policy checks, quarantine, deletion, and replay tests. No single filter should be described as a complete defense.
Stale context should lose authority
Every material item needs a freshness rule. A market observation may expire quickly. Product availability should be read from the current launch gate. A methodological decision can last longer but should still carry a version and review date. When freshness or provenance is uncertain, the affected path stops and asks for current evidence.
Expiry prevents a remembered permission, retired strategy rule, or resolved incident from silently returning as active guidance. It is a control surface, not housekeeping. Revalidation creates a new event; it should not erase the fact that the earlier record expired.
What the Mattheus repository currently persists—and what remains unproven
The Mattheus repository contains source-level, user-scoped persistence models and services for saved chat records, artifacts, workflow graphs, approval requests, temporal facts and relationships, and provenance metadata. This is implementation evidence, not proof of a deployed public service or reliable end-to-end continuity. Public market and DeFi previews do not establish that persistent workflow features or live execution are available to every visitor. Live execution remains gated; check the current execution policy before relying on any action path.
The immediate evaluation target is continuity: can a later review recover the goal, trace evidence, distinguish failures from findings, apply a correction, and preserve the next unanswered question? The unpublished Trading-Agent Harness Benchmark v0.1 candidate proposes continuity checks, but its methodology is not human-approved, no eligible cohort or repeated product trial has run, and no result or ranking exists.
A practical review before resuming
Inspect source, timestamp, effective interval, status, owner, and replacement links. Confirm that failed methods are visible without becoming reusable instructions. Read permissions from current policy, not an earlier action. Test deletion and revocation. Replay the context pack and compare it with the source records rather than trusting a generated summary.
Useful continuity makes the next decision easier to inspect and easier to stop. The record should show what the workflow knows, what it only observed, what changed, and what still needs an answer.
What the evidence supports
The W3C provenance model explains how records can carry relationships among sources, activities, and people. It does not establish that any particular trading system applies those relationships correctly.
Agent Workflow Memory and FinMem provide research examples of organizing and reusing memory. This article draws a design distinction between storing a record and granting it current authority; the cited studies are not independent validation of Mattheus.
The memory-controlled trading-agent benchmark discusses evaluation risks, while MemPoison examines persistent-memory threats. These papers support testing for leakage and poisoning; they do not demonstrate that Mattheus has eliminated those risks.
Descriptions of Mattheus persistence services come from internal implementation notes. Those notes are not public evidence that readers can independently inspect, and they do not establish a reliable deployed continuity service. No completed public benchmark or human-approved result in this article establishes superiority over another system.
Use the public execution policy to understand approval boundaries and the documentation to inspect documented behavior. Public preview access is separate from permission to execute a trade.
Sources and evidence
PROV Overview: A model for provenance relationships among entities, activities, and agents.
Internal source notes cover persistence, retrieval, temporal relationships, unresolved correctness risks, and release controls. They are not published here as independently reproducible results. The benchmark proposal remains unpublished and unapproved; no results or rankings are claimed.




