← Back to directory
T

TradeMemory Protocol

Community
Tamper-evident decision audit trail and outcome-weighted memory for AI trading agents.
GitHub source repository ↗
★ 1.4k Stars Category · Other Very popular
69FMRS · C

TradeMemory Protocol is a self-hosted, MIT-licensed MCP memory layer that uses 20 tools to fill the memory and audit gaps for AI trading agents: outcome-weighted recall, five-layer memory writes, behavioural and risk analysis, and a SHA-256 forward-chained audit ledger with daily Merkle roots. It explicitly does not execute trades or touch funds, is local-first, and its only outbound call is trusted timestamping of daily audit roots (which can be turned off). The project is in maintenance mode, and the docs flag the audit chain as not yet fully mature plus OWM validation and the evolution engine as research-phase. It suits individuals and teams that value decision traceability and review discipline, not those wanting a hosted service, trade execution or investment advice.

Reliability
11/20
Security and permissions
14/20
Maintenance
13/20
Documentation
16/20
Setup experience
15/20
Read the FMRS scoring method →

TradeMemory Protocol is a memory layer for AI trading agents: it never executes trades and never touches funds, it only records and recalls. Recall before trading weights past trades by outcome quality, context similarity, recency, confidence and emotional state; after trading, a single remember_trade call writes to five memory layers (episodic, semantic, procedural, affective and trade records). Every decision is SHA-256 hashed at creation and forward-linked into an audit ledger, summarised by daily UTC Merkle roots, with optional RFC 3161 trusted timestamp anchoring (on by default, disable with TRADEMEMORY_TSA=off). It ships 20 MCP tools plus 35+ REST endpoints, works with any market or broker, is local-first, and is MIT-licensed. As of August 2026 the project is feature-complete and in maintenance mode: bug and security reports are reviewed, but no new features or hosted service are planned.

Tools

remember_trade
Record a trade, writing to all five memory layers at once.
recall_memories
Recall past trade memories scored by outcome-weighted factors.
get_agent_state
Read agent state: confidence, drawdown and win/loss streaks.
get_behavioral_analysis
Analyse behavioural patterns and drift.
create_trading_plan
Create prospective trading plans with conditional triggers.
check_active_plans
Check currently active trading plans.
check_trade_legitimacy
Five-factor pre-trade gate returning full / reduced / skip.
export_audit_trail
Bulk-export the audit trail for review or regulatory submission.
verify_audit_hash
Verify a single record's SHA-256 hash has not been tampered with.
verify_audit_chain
Walk the entire chain, or a slice, end-to-end.
get_daily_root
Get the Merkle root over every decision record for a UTC day.
get_strategy_performance
Query strategy performance statistics.
get_trade_reflection
Retrieve trade reflection content.
validate_strategy
Run statistical validation on a strategy.
compute_dqs
Compute statistical validation metrics such as DSR and MBL.
evolution_fetch_market_data
Fetch market data for the evolution engine.
evolution_discover_patterns
Discover patterns in the data (research phase).
evolution_run_backtest
Run a strategy backtest (research phase).
evolution_evolve_strategy
Evolve and generate strategies (research phase).
evolution_get_log
Read the evolution process log.

Setup

  1. Run pip install tradememory-protocol. 2. Add an mcpServers entry to Claude Desktop's claude_desktop_config.json with command uvx and args ["tradememory-protocol"]. 3. Restart the client, then tell your agent to record a trade. Alternatives: for Claude Code run claude mcp add tradememory -- uvx tradememory-protocol; from source, git clone the repo, pip install -e . and run python -m tradememory; or use docker compose up -d.
claude_desktop_config.json
{
  "mcpServers": {
    "tradememory": {
      "command": "uvx",
      "args": ["tradememory-protocol"]
    }
  }
}

Fit and risk

Best for

  • Individual traders who want persistent memory and a decision audit trail for their AI trading agent.
  • Developers building autonomous trading agents that need to query prior context before trading.
  • Compliance or risk teams that need verifiable, exportable decision records.
  • Researchers studying the outcome-weighted memory (OWM) framework.

Not for

  • Users expecting the MCP server to place orders, manage funds or touch wallets — it does not execute trades.
  • Teams needing a rich hosted service or a fast-moving feature roadmap (the project is in maintenance mode).
  • Anyone treating its outputs as trade signals or investment advice.
  • Users requiring capabilities not yet shipped, such as external TSA anchoring or zkML proof of inference.

Required permissions

  • Reads the trade decision context and trade records passed in by your agent.
  • Writes and maintains memory-layer and audit-chain data locally.
  • By default makes one outbound call to an RFC 3161 trusted timestamping service, sending only the 32-byte daily audit root with no trade data; disable with TRADEMEMORY_TSA=off.
  • Does not access API keys, wallets or broker credentials.

Risks and side effects

  • Audit-chain maturity is limited: v0.5 does not yet include TSA timestamping and external anchoring, which the docs list as roadmap items.
  • OWM empirical validation is ongoing (n=40; target n>=100 for statistical significance), so conclusions should be treated cautiously.
  • The evolution engine is in a research phase, with statistical gate pass rate still being optimised.
  • The default outbound timestamping call contacts a third-party service, which must be disabled for fully offline environments.
  • Memory and audit data live locally, so disk tampering or loss affects verifiability and historical retention.

Troubleshooting

  1. Tools not visible after configuration: confirm uvx is on PATH, or start it instead with pip install -e . followed by python -m tradememory.
  2. For fully offline operation, set TRADEMEMORY_TSA=off to disable the outbound timestamping call.
  3. If verify_audit_hash or verify_audit_chain fails, inspect first_break_at to locate the chain break and check whether that record was modified.
  4. For MT5 sync issues, follow docs/MT5_SYNC_SETUP.md to check the connection and export configuration.
  5. With small sample sizes or without embeddings configured, recall runs in OWM-only mode; vector fusion requires embeddings to be set up.

Use cases

A US equity trader running a pre-flight checklist before every position, recalling how similar conditions ended last time.
A Forex EA system syncing automatically from MT5 and recording why signals were blocked, not just executed.
A compliance team using SHA-256 tamper-evident records to meet MiFID II and EU AI Act logging requirements.
Running daily, weekly and monthly reviews to detect behavioural drift, strategy decay and trading mistakes.

Supported clients

Claude DesktopFull support
Claude CodeFull support
CursorFull support