agentleFS
mnemox-aimnemox-ai/tradememory-protocol/skills/binance-skills-hub/trade-memory/SKILL.md

trade-memory

Skill1.4k starsChanged 9 months agoMITView on GitHub

Decision audit trail for AI trading agents. Records every trading decision with full context (conditions, filters, indicators, risk state) in a SHA-256 hash chain, so a later edit is detectable, and exports it as JSON or JSONL. Works alongside Binance Spot, Futures, and Web3 skills: they execute trades, TradeMemory records why.

  • Installs packages

Trending

Quiet since October.thin dataabout the whole repository

Jan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 3 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 1 mentionOct 2026: 1 mentionNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the mnemox-ai/tradememory-protocol repository that our weekly crawl found: only 8 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about mnemox-ai/tradememory-protocol

The biggest 5 of 8 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 8

Talked about on GitHub and Hacker News (8 times).

On GitHub · 7

2 more on GitHub

On Hacker News · 1

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Tamper-evident, not tamper-proof: Every record is hashed at creation and linked to the one before.

    line 184

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TradeMemory — Decision Audit Trail for AI Trading Agents

Binance skills execute trades. TradeMemory records why.

TradeMemory keeps the decision record. When your AI agent opens a position using the Spot or Futures skill, TradeMemory captures the full decision context: what conditions triggered the signal, which filters passed or blocked, the market indicators at that moment, risk state, and execution details. Every record is SHA-256 hashed for tamper detection.

Why keep it. So you, or anyone you report to, can see why each trade was taken and how it ended. Rules that require decision records (MiFID II Article 17) bind investment firms, not retail users; the EU AI Act's high-risk logging obligations were postponed to 2 December 2027, and ESMA's February 2026 briefing states that AI-based algorithmic trading is currently excluded from the high-risk scope. This is not a compliance claim.

What TradeMemory Records

For every trading decision your agent makes:

FieldDescription
timestampUTC decision time
agent_idWhich agent/EA made the decision
model_versionSoftware version at decision time
decision_typeENTRY, EXIT, HOLD, SKIP
strategyStrategy name (e.g. VolBreakout)
conditionsEntry conditions evaluated (passed/failed with thresholds)
filtersRisk filters checked (spread gate, regime gate, portfolio limits)
indicatorsMarket snapshot (ATR, EMA, spread, session range)
executionTicket, price, slippage, latency
regimeMarket regime at decision time (trending/ranging/transitioning)
risk_stateConsecutive losses, cooldown status, daily P&L
memory_contextPast trades recalled via Outcome-Weighted Memory
data_hashSHA-256 of all inputs for tamper detection

Real Decision Event

This is a real decision event from a XAUUSD trading system running three automated strategies. The AI agent detected a SHORT breakout signal but the sell_allowed filter blocked execution:

{
  "ts": "2026-03-26 07:55:00",
  "strategy": "VolBreakout",
  "decision": "FILTERED",
  "signal_triggered": true,
  "signal_direction": "SHORT",
  "conditions_json": {
    "conditions": [
      {"name": "breakout_high", "passed": false, "current_value": 4462.58, "threshold": 4569.75, "operator": ">"},
      {"name": "breakout_low", "passed": true, "current_value": 4462.58, "threshold": 4463.11, "operator": "<"}
    ]
  },
  "filters_json": {
    "filters": [
      {"name": "spread_gate", "passed": true, "blocked": false, "current_value": 12.0, "threshold": 0.0},
      {"name": "sell_allowed", "passed": false, "blocked": true, "current_value": 0.0, "threshold": 0.0},
      {"name": "account_risk", "passed": true, "blocked": false, "current_value": 0.0, "threshold": 0.0},
      {"name": "regime_gate", "passed": true, "blocked": false, "current_value": 0.0, "threshold": 0.0}
    ]
  },
  "indicators_json": {
    "atr_d1": 171.16,
    "atr_m5": 8.53,
    "asia_high": 4544.08,
    "asia_low": 4488.78,
    "asia_range": 55.30
  },
  "regime": "TRENDING",
  "regime_ratio": 0.335,
  "consec_losses": 0,
  "cooldown_active": false,
  "risk_daily_pct": 0.0
}

A regulator or risk manager can read this and immediately understand: the agent saw a valid breakout, but policy blocked the SHORT direction. No guessing, no black box.

How It Works with Binance Skills

Your AI Agent
    |
    |--- [1] Binance Spot Skill: execute BUY 0.01 XAUUSD
    |
    |--- [2] TradeMemory Skill: record WHY this trade was made
    |         - conditions that triggered the signal
    |         - filters that passed/blocked
    |         - market indicators at decision time
    |         - risk state and regime context
    |         - SHA-256 hash for tamper detection
    |
    |--- [3] Later: query /audit/verify/{trade_id} to prove the record hasn't been altered

Installation

pip install tradememory-protocol

Start the server:

python -m tradememory
# Server running at http://localhost:8000

API Endpoints

Record a Decision

POST /trade/record_decision
Content-Type: application/json

{
  "trade_id": "VB_20260326_0755",
  "symbol": "XAUUSD",
  "direction": "short",
  "strategy": "VolBreakout",
  "confidence": 0.75,
  "reasoning": "SHORT breakout detected. Price 4462.58 < asia_low 4488.78 - buffer. Blocked by sell_allowed filter.",
  "market_context": {
    "price": 4462.58,
    "session": "london",
    "regime": {"regime": "TRENDING", "atr_h1": 26.66, "atr_d1": 171.16},
    "decision_data": {
      "indicators": {"atr_d1": 171.16, "atr_m5": 8.53, "spread_pts": 12}
    }
  }
}

Audit: Get Decision Record

GET /audit/decision-record/{trade_id}

Returns a complete Trading Decision Record (TDR) with:

  • Decision context (who, what, when, why)
  • Memory context (similar past trades recalled)
  • Market snapshot (indicators, regime, risk)
  • SHA-256 data hash

Audit: Verify Integrity

GET /audit/verify/{trade_id}
{
  "trade_id": "VB_20260326_0755",
  "verified": true,
  "stored_hash": "a3f8c9...",
  "computed_hash": "a3f8c9...",
  "match": true
}

Recomputes SHA-256 from stored inputs and compares. If any field was tampered with after recording, match will be false.

Audit: Bulk Export

GET /audit/export?strategy=VolBreakout&start=2026-03-01&end=2026-03-31&format=jsonl

Export all TDRs as JSON or JSONL for review.

Security

  • The memory server never asks for exchange or broker keys. It does not execute trades, move funds, or access wallets. (The optional brake that sits in front of a broker is a separate install; see the project README.)
  • Read and record only. The agent calls TradeMemory after making a decision, passing the context. TradeMemory stores it.
  • Local-first. Records stay in a local SQLite file. Daily audit roots are timestamped by an RFC 3161 authority by default: a 32-byte hash, no trade data (TRADEMEMORY_TSA=off turns it off). The evolution tools read public Binance market data when an agent calls them. The README's Security section lists every outbound call.
  • Tamper-evident, not tamper-proof. Every record is hashed at creation and linked to the one before; changing a record breaks the chain. Verify it at any point with /audit/verify.
  • Scale: 20 MCP tools, a REST API, and five memory layers (episodic, semantic, procedural, affective, prospective).

Where the records map to regulation

The table shows which TradeMemory features map to these texts if and when they apply to you. It is not a compliance claim.

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 action and decision pathAutomatic per-decision TDR with structured JSON
ESMA 2026 BriefingAlgorithms must be distinguishable, testable, identifiableagent_id + model_version + strategy per record

MCP Integration

TradeMemory also runs as an MCP server with 20 tools:

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

Key MCP tools: remember_trade, recall_memories (with order="losses_first" before a trade), get_strategy_performance, export_audit_trail, verify_audit_hash, verify_audit_chain.

Links

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.