freshcrate
Skin:/
Home > MCP Servers > tradememory-protocol

tradememory-protocol

Decision audit trail + persistent memory for AI trading agents. Outcome-weighted recall, SHA-256 tamper detection, 17 MCP tools.

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

Decision audit trail + persistent memory for AI trading agents. Outcome-weighted recall, SHA-256 tamper detection, 17 MCP tools.

README

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 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-proof records for regulators
Details Read 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

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 17 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
Evolution evolution_fetch_market_data · evolution_discover_patterns · evolution_run_backtest · evolution_evolve_strategy · evolution_get_log
Audit export_audit_trail · verify_audit_hash

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

Pricing

Community Pro Enterprise
Price Free $29/mo (Coming Soon) Contact Us
MCP tools 17 tools 17 tools 17 tools
Storage SQLite, self-hosted Hosted API Private deployment
Dashboard Web dashboard Custom dashboard
Compliance Audit trail included Audit trail included Compliance reports + SLA
Support GitHub Issues Priority support Dedicated support
Get Started → Coming soon dev@mnemox.ai

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.

dev@mnemox.ai | 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.

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 Logging Systematic logging of every AI action Automatic 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?dev@mnemox.ai

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

Doc Description
Getting Started Install → first trade → pre-flight checklist
Use Cases 3 real-world production scenarios
API Reference All REST endpoints
OWM Framework Outcome-Weighted Memory theory
Architecture System design & layer separation
Tutorial Detailed walkthrough
MT5 Setup MetaTrader 5 integration
Research Log Evolution experiments & data
Failure Taxonomy 11 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

Release History

VersionChangesUrgencyDate
v0.5.5Security hotfix for the dashboard SPA catch-all route (GitHub issue #13). - **SPA static path is now bounded to `dashboard/dist`** — the catch-all in `server.py` checked containment with a plain string `startswith`, which has no path-component boundary: a sibling directory whose name merely shares the prefix (`dist-x/`) passed the check. Containment is now `Path.is_relative_to` in a dedicated `_resolve_static_file` helper. Paths that escape the dist root return 404 as before; client-side routesHigh9/8/2026
v0.5.4Same-day hotfix for three critical gaps an adversarial review found in the v0.5.3 anchoring path: - **Rebuilds no longer destroy existing anchors** — `tsa_token` is preserved when the recomputed root is identical, dropped only when the underlying data actually changed. - **TSA rejections can no longer masquerade as anchors** — PKIStatus is now verified; explicit rejections raise instead of being stored as proof. - **`POST /audit/root/{date}` is protect-by-default** — already-anchored roots are High7/28/2026
v0.5.1## What's New ### Decision Audit Trail (TDR) - 4 audit REST endpoints: `/audit/decision-record/{id}`, `/audit/export`, `/audit/export-jsonl`, `/audit/verify/{id}` - Trading Decision Record schema inspired by MiFID II Article 17 + EU AI Act Article 14 - SHA-256 tamper detection on every record ### DecisionLogReader - Reads EA JSONL decision logs (conditions, filters, indicators, execution, regime, risk) - Priority: JSONL > CSV event_log > fallback - Handles concurrent write corruption (merged JMedium3/27/2026
v0.5.0## What's New ### Evolution Engine - Autonomous strategy discovery powered by LLM-generated hypotheses - Vectorized backtester for fast signal evaluation - In-sample / out-of-sample validation to prevent overfitting - Multi-generation evolution: discover → hypothesize → backtest → select → evolve - Result: BTC/USDT 1H over 22 months — Sharpe 3.84, 477 trades, 91% positive months ### OWM Complete All 5 memory types fully implemented: - **Episodic** — power-law decay for trade recall Low3/16/2026
v0.4.0## Outcome-Weighted Memory (OWM) A cognitive science-based recall system for AI trading agents. Novel application of established cognitive science (ACT-R, Kelly Criterion, Bayesian updating, Tulving's memory taxonomy) to AI trading agents. ### New Features - **5 Memory Types**: Episodic, Semantic, Procedural, Affective, Prospective - **Core Formula**: `Score(m,C) = Q(m) × Sim(m,C) × Rec(m) × Conf(m) × Aff(m)` - **Kelly-from-Memory**: Context-weighted position sizing derived from recalled tradLow3/5/2026
v0.3.1## [0.3.1] - 2026-03-03 ### Added - `scripts/generate_screenshots.py` — generates demo output for documentation - `ROADMAP.md` — 5-phase development roadmap - OpenClaw Skill (`.skills/tradememory/SKILL.md`) with env var declarations and security section - Hosted API server (`hosted/server.py`) with account isolation and API key auth - Marketing materials (`marketing/`) for Forex Factory, Reddit, MQL5 ### Changed - Repository reorganized: scripts, docs, and deploy configs moved to proLow3/2/2026
v0.3.0## L3 Strategy Adjustments — Rule-based strategy tuning from L2 patterns ### Added - `strategy_adjustments` table in SQLite with proposed/approved/applied/rejected lifecycle - 5 deterministic rules: strategy_disable, strategy_prefer, session_reduce, session_increase, direction_restrict - `generate_l3_adjustments()` in ReflectionEngine — reads L2 patterns, outputs proposed adjustments - 3 CRUD methods in Database: `insert_adjustment`, `query_adjustments`, `update_adjustment_status` - 3 REST API Low3/1/2026
v0.2.0## tradememory-protocol v0.2.0 The first MCP memory system built for AI trading agents. Not a dashboard. Not a journal. A protocol layer that gives your trading AI the ability to remember and learn. ### New: MCP Server (FastMCP) 4 tools available via MCP protocol: | Tool | Description | |------|-------------| | `store_trade_memory` | Store a trade decision with full context | | `recall_similar_trades` | Find past trades with similar market context | | `get_strategy_performance` | Aggregate sLow2/24/2026
v0.1.0## TradeMemory Protocol v0.1.0 The first public release of TradeMemory Protocol — a structured memory layer for AI trading agents. ### Features - 3-layer memory architecture (L1: Raw Trades → L2: Patterns → L3: Strategy) - 7 MCP tools for recording, reflecting, and evolving trading decisions - ReflectionEngine powered by Claude API - Platform adapters: MT5, Binance, Alpaca - 36 tests passing, zero deprecation warnings ### Quick Start See [QUICK_START.md](docs/QUICK_START.md) for aLow2/23/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

memoraGive your AI agents persistent memory.v0.4.0
AgentGuardProtect AI agents by detecting and blocking prompt, command injection, Unicode bypass, and social engineering attacks with customizable security controls.main@2026-09-10
uk-due-diligence-mcpUK due diligence MCP server — Companies House, corporate research, compliance checksv1.4.0
claude-copilotTransform Claude Code into a full development team. 11 specialized agents (Architect, Engineer, QA, Security, UX, DevOps, and more), persistent memory across sessions, and 25,000+ on-demand skills. Wov5.15.2
claude-code-configClaude Code skills, architectural principles, and alternative approaches for AI-assisted developmentmain@2026-09-08

More in MCP Servers

difyProduction-ready platform for agentic workflow development.
tabularisA lightweight, cross-platform database client for developers. Supports MySQL, PostgreSQL and SQLite. Hackable with plugins. Built for speed, security, and aesthetics.
ai-agents-from-zero 🚀 2026 最系统的 AI Agent 速成指南|智能体实战教程 · 完整学习路径 + 实战项目 + 面试题库 · 对标大模型应用开发工程师岗位 · 覆盖LangChain / LangGraph / Coze / Dify / MCP / skills / LLM / RAG / 提示词 · 企业级部署与微调 · 从0到企业级落地 + 从学习到上线项目 + 面试准备一体化
studioOpen-source control plane for your AI agents. Connect tools, hire agents, track every token and dollar