Decision audit trail + persistent memory for AI trading agents. SHA-256 tamper detection, outcome-weighted recall, strategy evolution via MCP.
Project description
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 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-evident records for regulators |
| Details | Read more → | Read more → | Read more → |
How it works
- Recall — Before trading, retrieve past trades weighted by outcome quality, context similarity, recency, confidence, and emotional state (OWM Framework)
- Record — After trading, one call to
remember_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
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.
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). 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_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
See LIMITATIONS.md for the full audit-chain maturity statement, including what's not in v0.5.2 yet (TSA timestamping, external anchoring, zkML proof of inference).
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.
- Local-first. No external network calls by default; the only optional outbound call is RFC 3161 trusted timestamping, and only if you enable it. No data is sent to third parties.
- 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.
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-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)
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
MIT — see LICENSE. For educational/research purposes only. Not financial advice.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tradememory_protocol-0.5.2.tar.gz.
File metadata
- Download URL: tradememory_protocol-0.5.2.tar.gz
- Upload date:
- Size: 388.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30d2aa10eb411884836a4fd2afdc1e8b3862ed7d5b11a7eaecd549c901654dcb
|
|
| MD5 |
a6e7e438e0538486f9200e419b064d9e
|
|
| BLAKE2b-256 |
7b7ffd31e6bc5c1c97cb2138a3c7830ca4941f36d33eaf5f76b9c53f6821e6cd
|
Provenance
The following attestation bundles were made for tradememory_protocol-0.5.2.tar.gz:
Publisher:
publish.yml on mnemox-ai/tradememory-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradememory_protocol-0.5.2.tar.gz -
Subject digest:
30d2aa10eb411884836a4fd2afdc1e8b3862ed7d5b11a7eaecd549c901654dcb - Sigstore transparency entry: 2274841068
- Sigstore integration time:
-
Permalink:
mnemox-ai/tradememory-protocol@7ec73b900f7e7267fac31d7438ecfdaa3c880fae -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/mnemox-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ec73b900f7e7267fac31d7438ecfdaa3c880fae -
Trigger Event:
release
-
Statement type:
File details
Details for the file tradememory_protocol-0.5.2-py3-none-any.whl.
File metadata
- Download URL: tradememory_protocol-0.5.2-py3-none-any.whl
- Upload date:
- Size: 268.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38318463ed6c017180db31af637d4f7213456c3c97212d205b267203f2c8dc57
|
|
| MD5 |
aaa5dc1b2378a925faece044b52a1518
|
|
| BLAKE2b-256 |
c659032ec848d1c57a7f95fec2a905fa034ab182ca613391a3a8d10050920f00
|
Provenance
The following attestation bundles were made for tradememory_protocol-0.5.2-py3-none-any.whl:
Publisher:
publish.yml on mnemox-ai/tradememory-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradememory_protocol-0.5.2-py3-none-any.whl -
Subject digest:
38318463ed6c017180db31af637d4f7213456c3c97212d205b267203f2c8dc57 - Sigstore transparency entry: 2274841289
- Sigstore integration time:
-
Permalink:
mnemox-ai/tradememory-protocol@7ec73b900f7e7267fac31d7438ecfdaa3c880fae -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/mnemox-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ec73b900f7e7267fac31d7438ecfdaa3c880fae -
Trigger Event:
release
-
Statement type: