TradeMemory Protocol

AI trading memory layer for MT5/forex with 15 MCP tools — store/recall trades, pattern discovery, strategy evolution, and Outcome-Weighted Memory.

TradeMemory Protocol


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 SHA-256 tamper-proof audit trail.

Used in production by traders running pre-flight checklists before every position, and by EA systems logging thousands of decisions daily.

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.

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 TraderForex EA SystemCompliance Team
MarketStocks (AAPL, TSLA, ...)XAUUSD (Gold)Multi-asset
HowPre-flight checklist before every tradeAutomated sync from MT5Full decision audit trail
Key valueDiscipline system — memory before every decisionRecord why signals were blocked, not just executedSHA-256 tamper-proof records for regulators
DetailsRead more →Read more →Read more →

How it works

OWM 5 Factors

  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

CategoryToolsDescription
Memoryremember_trade · recall_memoriesRecord and recall trades with outcome-weighted scoring
Stateget_agent_state · get_behavioral_analysisConfidence, drawdown, streaks, behavioral patterns
Planningcreate_trading_plan · check_active_plansProspective plans with conditional triggers
Riskcheck_trade_legitimacy5-factor pre-trade gate (full / reduced / skip)
Auditexport_audit_trail · verify_audit_hashSHA-256 tamper detection + bulk export
All 17 MCP tools + REST API
CategoryTools
Core Memoryget_strategy_performance · get_trade_reflection
OWM Cognitiveremember_trade · recall_memories · get_behavioral_analysis · get_agent_state · create_trading_plan · check_active_plans
Risk & Governancecheck_trade_legitimacy · validate_strategy
Evolutionevolution_fetch_market_data · evolution_discover_patterns · evolution_run_backtest · evolution_evolve_strategy · evolution_get_log
Auditexport_audit_trail · verify_audit_hash

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

Pricing

CommunityProEnterprise
PriceFree$29/mo (Coming Soon)Contact Us
MCP tools17 tools17 tools17 tools
StorageSQLite, self-hostedHosted APIPrivate deployment
DashboardWeb dashboardCustom dashboard
ComplianceAudit trail includedAudit trail includedCompliance reports + SLA
SupportGitHub IssuesPriority supportDedicated support
Get Started →Coming soon[email protected]

Need Help Integrating?

Building a trading AI agent and want battle-tested memory architecture?

Free 30-min strategy call — we'll map your agent's memory needs and design guardrails for your specific workflow.

[email protected] | Book a call

We've helped traders build pre-flight checklists, connect MT5/Binance, and design custom guardrails for forex, equities, and crypto.

Enterprise & Compliance

Every trading decision your agent makes — including decisions not to trade — is recorded as a Trading Decision Record (TDR), SHA-256 hashed at creation for tamper detection.

RegulationRequirementTradeMemory Coverage
MiFID II Article 17Record every algorithmic trading decision factorFull decision chain: conditions, filters, indicators, execution
EU AI Act Article 14Human oversight of high-risk AI systemsExplainable reasoning + memory context for every decision
EU AI Act LoggingSystematic logging of every AI actionAutomatic per-decision TDR with structured JSON
# Verify any record hasn't been tampered with
GET /audit/verify/{trade_id}
# → {"verified": true, "stored_hash": "a3f8c9...", "computed_hash": "a3f8c9..."}

# Bulk export for regulatory submission
GET /audit/export?strategy=VolBreakout&start=2026-03-01&format=jsonl

Need a custom deployment for your fund?[email protected]

Security

  • 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.
  • No external network calls. The server runs locally. No data is sent to third parties.
  • SHA-256 tamper detection. Every record is hashed at creation. Verify integrity anytime.
  • 1,324 tests passing. Full test suite with CI.

Research Status

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,300+ tests)
  • Statistical validation: DSR, MBL implemented (Bailey-de Prado 2014)
  • Audit trail: SHA-256 tamper-proof 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)

Documentation

DocDescription
Getting StartedInstall → first trade → pre-flight checklist
Use Cases3 real-world production scenarios
API ReferenceAll REST endpoints
OWM FrameworkOutcome-Weighted Memory theory
ArchitectureSystem design & layer separation
TutorialDetailed walkthrough
MT5 SetupMetaTrader 5 integration
Research LogEvolution experiments & data
Failure Taxonomy11 trading AI failure modes
中文版Traditional Chinese

Contributing

See Contributing Guide · Security Policy

Star History

MIT — see LICENSE. For educational/research purposes only. Not financial advice.

Built by Mnemox

Related Servers

NotebookLM Web Importer

Import web pages and YouTube videos to NotebookLM with one click. Trusted by 200,000+ users.

Install Chrome Extension