Purpose: TradeMemory provides persistent memory, decision auditing, and pre-order interception for AI trading agents. It imports historical trades into a local database, identifies its own historical loss patterns, presents these losing trades to the agent before placing an order, and can reject orders according to user-defined rules.
Main capabilities: 1) Recording and recall: each closed trade is stored only once, and repeated runs only write new trades; recall_memories(order="losses_first") prioritizes losing trades, with larger losses ranked earlier under similar conditions; by default it sorts by R multiple and retains at least 20% loss samples. 2) Five-layer memory: episodic, semantic, procedural, emotional, and trade records, written in one call via remember_trade. 3) Reflection and auditing: daily/weekly/monthly reviews detect behavioral drift and strategy decay; each decision generates a TDR, with each entry SHA-256 content-hashed and forward-linked, and the daily Merkle root since 0.5.3 uses RFC 3161 authoritative timestamps by default. 4) REST API with 35+ endpoints and 20 MCP tools. 5) Proxy interception (proxy extra): forwards tool calls to the broker MCP server; order-type tools are first evaluated by policy, and rejected items include symbols outside the whitelist, exceeding notional/position limits, entries without bracket stop-losses, new orders after triggering daily loss or drawdown limits, cancellation of protective stop-losses, unclassified tools, and FULL_HALT status; closing positions is never blocked. Orders reaching approval_notional require manual approval via tradememory proxy approve <intent_id> --terms <fingerprint>, and the same client_order_id is forwarded at most once. evaluate_order can evaluate without placing an order. Cases that cannot be evaluated are always rejected.
How to use: After adding the claude_desktop_config.json configuration in Claude Desktop, Claude can record trades. Sync scripts are located in scripts/: tradememory sync hyperliquid reads public data without keys; the MT5 and Binance spot symbol sync scripts read credentials from environment variables. Brake was tested on an Alpaca paper account (2026-10-01), broker keys are only passed to the broker process started by the proxy, TradeMemory does not store them.
Use cases: researchers and developers who need AI agents to trade on real or simulated brokers while preserving historical memory, conducting behavioral audits, and enforcing pre-order risk controls.
Limitations: for educational and research purposes only, not investment advice. Tamper-evident rather than tamper-proof; anyone who can rewrite the entire database can still rebuild the chain. Private-key signing, public log anchoring, and omission proofs are not implemented. The RFC 3161 timestamp enabled by default sends a 32-byte hash (no trade data), and can be disabled with TRADEMEMORY_TSA=off. Options, order replacement, stop-limit, and trailing orders are rejected rather than evaluated. The evolution engine is at the research stage, with empirical validation n=14, and the sample size is insufficient for conclusions. TradeMemory itself is MIT, while the optional proxy extra's Mnemox Control engine is AGPL-3.0-only, with a commercial license available for purchase.