TradeMemory Protocol
About
AI trading memory layer for MT5/forex with 15 MCP tools — store/recall trades, pattern discovery, strategy evolution, and Outcome-Weighted Memory.
Details
- Author
- mnemox-ai
- Categories
- Other, Finance, AI
Jump to
Setup
Install TradeMemory Protocol in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/mnemox-ai/tradememory-protocol
Follow the installation instructions in the repository README, then restart your MCP client.
What can you do with TradeMemory Protocol MCP?
- Record trades— Ask your assistant to log a trade withremember_trade, storing context, outcome, and confidence across five memory layers.
- Recall past outcomes— Queryrecall_memoriesto retrieve similar past trades weighted by outcome, context, recency, and confidence.
- Pre-trade risk gate— Runcheck_trade_legitimacyto get a full, reduced, or skip verdict before entering a position.
- Verify audit integrity— Useverify_audit_hashorverify_audit_chainto confirm no record has been tampered with.
- Export audit trail— Callexport_audit_trailto pull bulk trade records for regulatory submission or review.
Getting Started|Use Cases|API Reference|OWM Framework|Limitations|中文版
Project status (August 2026):Feature-complete, inmaintenance mode— bug and security reports are still reviewed; no new features or hosted service are planned. For paid work, seeTrading 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.Onepip install, and your AI agent remembers every trade, every outcome, every mistake — with a SHA-256 tamper-evident audit trail.
Used in production by traders running pre-flight checklists before every position, and by EA systems logging thousands of decisions daily.
- 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.
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 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)
- Recall— Before trading, retrieve past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state (OWM Framework)
- Record— After trading, one call toremember_tradewrites to five memory layers: episodic, semantic, procedural, affective, and trade records
- Reflect— Daily/weekly/monthly reviews detect behavioral drift, strategy decay, and trading mistakes
- Audit— Every decision is SHA-256 hashed at creation. Export anytime for review or regulatory submission
REST API:35+ endpoints for trade recording, reflections, risk, MT5 sync, OWM, evolution, and audit.Full reference →
TradeMemory itself is free and self-hosted. What the maintainer offers as a paid service isstatistical 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.
Every trading decision your agent makes — including decisionsnotto 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.
# Verify a single record hasn't been tampered with verify_audit_hash(trade_id="MT5-7047640363") # → {"verified": true, "chain_entry": {"sequence_num": 42, ...}} # Walk the entire chain (or a slice) end-to-end verify_audit_chain(from_seq=1, to_seq=None) # → {"verified": true, "checked_count": 1284, "first_break_at": null} # Daily Merkle root — single 32-byte anchor over every TDR for that day get_daily_root(date="2026-05-14") # → {"verified": true, "root_hash": "a05544...", "record_count": 18} # Bulk export for regulatory submission GET /audit/export?strategy=VolBreakout&start=2026-03-01&format=jsonl
Need a custom deployment for your fund?→dev@mnemox.ai
- Never touches API keys.TradeMemory does not execute trades, move funds, or access wallets.
- Read and record only.Your agent passes decision context to TradeMemory. It stores it. That's it.
- Local-first.The only outbound call is RFC 3161 trusted timestamping of daily audit roots — a 32-byte hash, no trade data (on by default; disable withTRADEMEMORY_TSA=off). Nothing else leaves your machine.
- SHA-256 chained audit ledger.Every record is hashed at creation and linked to the previous record. Daily Merkle roots anchor the chain. Verify integrity at the record, slice, or day level. Tampering is detectable at every level; external anchoring (TSA by default) is on the roadmap.
- 1,400+ tests passing.Full test suite with CI.
TradeMemory's OWM framework is grounded in cognitive science (Tulving 1972) and reinforcement learning (Schaul et al. 2015). Current status:
- OWM five-factor scoring:implemented, tested (1,400+ tests)
- Statistical validation:DSR, MBL implemented (Bailey-de Prado 2014)
- Audit trail:SHA-256 tamper-evident TDR
- Evolution engine:research phase (strategy generation works, statistical gate pass rate under optimization)
- Hybrid recall:OWM-only mode active, vector fusion available when embeddings configured
- Empirical validation:ongoing (n=40 trades, target n>=100 for statistical significance)
SeeContributing Guide·Security Policy
MIT — seeLICENSE. For educational/research purposes only. Not financial advice.
Full-lifecycle algorithmic trading: describe strategies in plain English, AI generates code, backtest on real data, deploy live to 10+ brokers. Stocks, options, crypto, futures. Free tier available.
Macro-factor quantitative signal source — 8 live-tracked strategies (US + China), free 30-day trial, AI agent self-registration via MCP tools.
Portfolio & trading-strategy stress diagnostics for AI agents: multi-asset stress with hedge-break detection, a daily preregistered regime outlook and deflated-Sharpe backtest-integrity checks. Remote streamable HTTP, free tier, no auth.
Give any AI agent the power to run a serious Monte Carlo forecast for a stock or ETF - in one tool call.
Deterministic macro regime engine for AI trading agents — RISK_ON / NEUTRAL / RISK_OFF / STRESS with transparent scoring rules.
Measured market statistics for AI agents — day-type probabilities, volume-wave events with measured win rates, options max pain and dealer gamma; remote MCP at https://api.quantdata.uk/mcp, no key needed to try.
Connect TradeOS to GPT, Claude, and other MCP-compatible AI tools. The TradeOS MCP Server lets your assistant work directly with your trading data, indicators, strategy logic, and agent workflows, helping you analyze markets, monitor setups, and automate trading intelligence from your TradeOS environment
Use TradeOS MCP Server to bring your trading data, indicators, strategy logic, and agent workflows into MCP-compatible AI tools. Copy your server URL, add it to GPT or Claude, and let your AI assistant work directly with your TradeOS trading intelligence.
The most complete AI-powered trading toolkit for Claude and MCP clients. Backtesting + Live Sentiment + Yahoo Finance + 30+ Technical Analysis Tools — all in one MCP server.
Integrates the xtquant quantitative trading platform with an AI assistant, enabling AI to access and operate quantitative trading data and functions.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




