tradememory-protocol is a free, open source compliance & risk management project written in Python and released under MIT. It has 1,418 GitHub stars, 167 forks and 1 open issues, and was last pushed 4 days ago. On this registry it ranks #40 of 45 tracked projects in Compliance & Risk Management, with 5 head-to-head comparisons available.

What is tradememory-protocol?

TradeMemory Protocol is an MIT-licensed Python memory and decision-audit layer for AI trading agents, giving them persistent outcome-weighted recall of past trades plus a tamper-evident SHA-256 audit trail with RFC 3161 timestamp anchoring — built for traders and developers running agentic trading systems who need an agent to remember what happened and to be able to prove it.

What it is

TradeMemory Protocol is a memory and audit layer that plugs into AI trading agents through the Model Context Protocol. It lives in the agentic-trading and MCP ecosystem, alongside the execution-focused MCP servers that place orders, fetch prices and read charts. What it replaces is not a named product but a missing layer: the ephemeral context-window memory that an agent loses the moment a session ends. The project describes the situation directly — an agent can buy 100 shares of AAPL but cannot answer "What happened last time I bought AAPL in this condition?" TradeMemory exists to answer that question and to keep the record that answers it.

The concrete problem is twofold. Operationally, an agent makes the same mistakes every session, cannot explain why it traded, and forgets everything when the context window closes. TradeMemory records every trade, outcome and mistake across five memory layers that update automatically from a single call, and recalls them, weighted by outcome, before the next decision. Regulatorily, MiFID II Article 17 raises the bar for algorithmic decision documentation and the EU AI Act Article 14 demands systematic logging of AI actions; the SHA-256 chain provides a tamper-evident record for that purpose. The tool records and recalls only — it does not execute trades and does not touch funds.

Key capabilities

  • Exposes 20 MCP tools through an MCP server, listed on Smithery, for recording trades and querying memory from an agent session.
  • Maintains a tamper-evident SHA-256 hash chain with RFC 3161 anchoring for the audit trail.
  • Applies outcome-weighted recall (the OWM framework, documented in docs/OWM_FRAMEWORK.md) so past results shape what the agent retrieves.
  • Updates five distinct memory layers automatically from one recording call.
  • Provides safety rails: confidence tracking, drawdown alerts and losing streak detection, so the system signals when to stop.
  • Supports a pre-trade recall query that asks what happened last time in the current market condition and how it ended.
  • Ships a replay harness — tradememory demo --fast replays 30 trades and shows the recall and parameter adjustment derived from them.

Who uses it and how

  • An independent trader runs a pre-flight checklist against memory before every position.
  • A first-party deployment against an MT5 account logs blocked signals as well as executed ones, not only the trades that filled.
  • It works across any market (stocks, forex, crypto, futures), any broker and any AI platform, since it records rather than executes.
  • It integrates into Claude Desktop through claude_desktop_config.json, or into Claude Code with claude mcp add tradememory -- uvx tradememory-protocol.
  • It can be self-hosted as a service with docker compose up -d for teams that keep trading data in their own environment.

Getting started

Install the Python package with pip install tradememory-protocol, then either register it as an MCP server (uvx tradememory-protocol) or run it from source with python -m tradememory; a Docker path is available through docker compose up -d. Full walkthroughs for both a Trader Track and a Developer Track are in docs/GETTING_STARTED.md.

How it compares

No comparable tool is named in the facts provided, so on the evidence available this project stands alone in this registry. The relevant contrast is structural rather than against a rival product: the surrounding MCP servers in the trading stack handle execution, and this is the layer that handles memory and audit.

When to use it — and when not to

This suits a self-hoster who is comfortable running a Python package or a Docker Compose stack and who wants decision history to stay in their own environment under an MIT licence. It is a poor fit for anyone wanting a hosted service or an actively developed feature roadmap: the project is feature-complete and in maintenance mode as of August 2026, with bug and security reports still reviewed but no new features or hosted service planned, and paid work routed to a separate Trading Record Analysis offering.

Note that the public dashboard runs on an illustrative synthetic dataset and is an interface preview, not a track record — the trades and figures on it are labelled as such. Prospective users should read docs/USE_CASES.md to see which of the two documented deployments each use case describes, and LIMITATIONS.md before depending on the audit trail for a compliance obligation.

project readme (upstream, from github) — read inline

PyPI Tests MCP Tools Smithery License: MIT

Getting Started | Use Cases | API Reference | OWM Framework | Limitations | 中文版


Project status (August 2026): Feature-complete, in maintenance mode — bug and security reports are still reviewed; no new features or hosted service are planned. For paid work, see Trading Record Analysis.

Your trading AI has amnesia. And regulators are starting to notice.

It makes the same mistakes every session. It can't explain why it traded. It forgets everything when the context window ends. Meanwhile, MiFID II is raising the bar for algorithmic decision documentation (Article 17). The EU AI Act demands systematic logging of AI actions (Article 14). Your competitors' agents are learning from every trade.

The AI trading stack is missing a layer. Every MCP server handles execution — placing orders, fetching prices, reading charts. None handle memory.

Your agent can buy 100 shares of AAPL but can't answer: "What happened last time I bought AAPL in this condition?"

TradeMemory is the memory layer. One pip install, and your AI agent remembers every trade, every outcome, every mistake — with a SHA-256 tamper-evident audit trail.

Used by an independent trader running a pre-flight checklist before every position, and first-party against an MT5 account that logs blocked signals as well as executed ones. See USE_CASES.md for which is which.

What it does

  • Before trading: ask your memory — what happened last time in this market condition? How did it end?
  • After trading: one call records everything — five memory layers update automatically
  • Safety rails: confidence tracking, drawdown alerts, losing streak detection — the system tells you when to stop

Works with any market (stocks, forex, crypto, futures), any broker, any AI platform. TradeMemory doesn't execute trades or touch your money — it only records and recalls.

See the interface

tradememory-dashboard.onrender.com — the dashboard running on an illustrative demo dataset. Nothing to install.

It is an interface preview, not a track record: the trades are synthetic and every figure on it is labelled as such. For what the memory layer actually does in a terminal, pip install tradememory-protocol && tradememory demo --fast replays 30 trades and shows the recall and parameter adjustment it derives from them.

Quick Start

pip install tradememory-protocol

Add to Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "tradememory": {
      "command": "uvx",
      "args": ["tradememory-protocol"]
    }
  }
}

Then tell Claude: "Record my AAPL long at $195 — earnings beat, institutional buying, high confidence."

Claude Code / Cursor / Docker
# Claude Code
claude mcp add tradememory -- uvx tradememory-protocol

# From source
git clone https://github.com/mnemox-ai/tradememory-protocol.git
cd tradememory-protocol && pip install -e . && python -m tradememory

# Docker
docker compose up -d

Full walkthrough: Getting Started (Trader Track + Developer Track)

Who uses TradeMemory

US Equity Trader Forex EA System Compliance Team
Market Stocks (AAPL, TSLA, ...) XAUUSD (Gold) Multi-asset
How Pre-flight checklist before every trade Automated sync from MT5 Full decision audit trail
Key value Discipline system — memory before every decision Record why signals were blocked, not just executed SHA-256 tamper-evident records for regulators
Details Read more → Read more → Read more →

How it works

  1. Recall — Before trading, retrieve past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state (OWM Framework)
  2. Record — After trading, one call to remember_trade writes to five memory layers: episodic, semantic, procedural, affective, and trade records
  3. Reflect — Daily/weekly/monthly reviews detect behavioral drift, strategy decay, and trading mistakes
  4. Audit — Every decision is SHA-256 hashed at creation. Export anytime for review or regulatory submission

MCP Tools

Category Tools Description
Memory remember_trade · recall_memories Record and recall trades with outcome-weighted scoring
State get_agent_state · get_behavioral_analysis Confidence, drawdown, streaks, behavioral patterns
Planning create_trading_plan · check_active_plans Prospective plans with conditional triggers
Risk check_trade_legitimacy 5-factor pre-trade gate (full / reduced / skip)
Audit export_audit_trail · verify_audit_hash SHA-256 tamper detection + bulk export
All 20 MCP tools + REST API
Category Tools
Core Memory get_strategy_performance · get_trade_reflection
OWM Cognitive remember_trade · recall_memories · get_behavioral_analysis · get_agent_state · create_trading_plan · check_active_plans
Risk & Governance check_trade_legitimacy · validate_strategy · compute_dqs
Evolution evolution_fetch_market_data · evolution_discover_patterns · evolution_run_backtest · evolution_evolve_strategy · evolution_get_log
Audit export_audit_trail · verify_audit_hash · verify_audit_chain · get_daily_root

REST API: 35+ endpoints for trade recording, reflections, risk, MT5 sync, OWM, evolution, and audit. Full reference →

Trading Record Analysis

TradeMemory itself is free and self-hosted. What the maintainer offers as a paid service is statistical analysis of your own trading records: export your MT4/MT5 history and get a descriptive-statistics report — where your losses concentrate, how your position sizing changes after losses, forced-liquidation structure, and the actual risk you took per trade — followed by a walkthrough call.

Descriptive statistics of past trades only: no trade signals, no investment advice, no performance promises. Your files are deleted after delivery.

[email protected] | Book a call

Enterprise & Compliance

Every trading decision your agent makes — including decisions not to trade — is recorded as a Trading Decision Record (TDR). Per-record SHA-256 content hashes are linked into a forward-chained audit ledger; every UTC day is summarised by a Merkle root which itself chains across days. Tampering with any historical record invalidates every subsequent link.

Regulation Requirement TradeMemory Coverage
MiFID II Article 17 Record every algorithmic trading decision factor Full decision chain: conditions, filters, indicators, execution
EU AI Act Article 14 Human oversight of high-risk AI systems Explainable reasoning + memory context for every decision
EU AI Act Article 12 Automatic, tamper-resistant logs over system lifetime Linked SHA-256 chain + daily Merkle roots (RFC 3161 TSA in Phase 1.5)
## Verify a single record hasn't been tampered with
verify_audit_hash(trade_)
## → {"verified": true, "chain_entry": {"sequence_num": 42, ...}}

## Walk the entir

readme truncated — read the full docs on github

Frequently asked questions

Is tradememory-protocol free to use?

tradememory-protocol is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does tradememory-protocol do?

Decision audit trail + persistent memory for AI trading agents. Outcome-weighted recall, tamper-evident SHA-256 chain with RFC 3161 anchoring, 20 MCP tools.

What is tradememory-protocol written in?

tradememory-protocol is primarily written in Python. Its source is publicly available at https://github.com/mnemox-ai/tradememory-protocol, and it has 1,418 GitHub stars.