Labsco
MCP SERVER

TradeMemory Protocol

by mnemox-ai

Keep a trading agent's history as memory it can be held to — each trade stored with its reasoning, recalled by how it turned out, and hash-chained so the record can be checked.

Agent MemoryVerified
Summary
A trading agent has to answer for its own record before it sizes the next trade.

What it takes off you is the discipline: every trade is stored with the reasoning that produced it, recall leans on how trades turned out rather than similarity alone, and a pre-trade check reads sample size, regime experience, streak and drawdown before size is decided. The audit chain sits apart from all of that — records are hashed, chained, and summarised into one daily root, so the decision trail can be verified instead of asserted.

What it is

A memory layer for a trading agent. Trades go in with their context and a written reflection; recall is weighted by outcome, context similarity, recency and confidence; and a separate set of calls discovers, backtests and eliminates candidate patterns. It records decisions rather than making them — it never places a trade or touches an exchange key.

What you get
  • A trade stored with entry, exit, PnL, R multiple, max adverse excursion, confidence, regime and a written reflection
  • Recall ranked by outcome quality, context similarity, recency and confidence, returned with the score breakdown
  • Per-strategy performance aggregates, and behavioural stats: hold times, disposition ratio, lot-size variance and a Kelly comparison
  • The agent's current state — confidence, risk appetite, drawdown, win and loss streaks, and a recommended action
  • Prospective plans that stay armed until their trigger matches, they expire, or they are cancelled
  • OHLCV bars from Binance, LLM-generated candidate patterns, a vectorized backtest reporting Sharpe ratio, win rate, trade count, max drawdown and PnL, and a multi-generation loop that validates survivors out of sample
  • Strategy validation over four statistical tests — Deflated Sharpe Ratio, walk-forward, regime and CPCV — from a trade log or a daily returns CSV
  • A pre-trade check on whether sample size, memory quality, regime experience, streak and drawdown justify full size, and a Decision Quality Score across five factors
  • Trading Decision Records exported for audit, a SHA256 check on one record, a chain walk that reports the first break, and a daily Merkle root
Requirements

Uv, to run `uvx tradememory-protocol`. No exchange credentials: it stores what your agent passes it and nothing more. Trade data stays on the machine — the one outbound call is RFC 3161 timestamping of the daily audit root, a 32-byte hash, which TRADEMEMORY_TSA=off disables. The evolution calls are the exception: they fetch bars from Binance and use Claude to generate candidate patterns, and their run log is held in memory only, so it resets when the server restarts.

Setup effort

One command — uvx tradememory-protocol