StrategiesLIVE

BTCUSDT 1H

View Live Dashboard →
Open Source MCP Server

AI Trading Memory
Your Agent Never Forgets

Your AI agent forgets every trade after each session. TradeMemory gives it persistent memory — store decisions, discover patterns, evolve strategy automatically via MCP.

tradememory — claude desktop
You: Store my XAUUSD trade: long 0.10 lots, +$1,175
✓ Trade stored: MT5-2350458751 | strategy=VolBreakout
 
You: Run a reflection on my last 73 trades
✓ Analyzing 73 trades across 4 strategies...
→ Pattern: IntradayMomentum BUY PF=2.11 return=+166% n=73
→ Pattern: MeanReversion SELL PF=0.79 return=−21% n=36
 
✓ L3 Adjustment: MeanReversion SELL → disable (consistent losses)
✓ L3 Adjustment: IntradayMomentum BUY → increase size 1.2x
 
Memory updated. 3 layers synced. 10,169 trades analyzed.
1,087Tests Passing
5Memory Types
15MCP Tools
MITLicensed

Everything Your Trading Agent Needs

From trade storage to strategy evolution — a complete memory architecture for AI trading agents.

🧠

Outcome-Weighted Memory

5 cognitive memory types: Episodic, Semantic, Procedural, Affective, Prospective. Each trade scored by outcome quality, context similarity, recency, and confidence.

🔍

Reflection Engine

Rule-based analysis finds patterns in your trade history — win rates by session, strategy, confidence level. Optional LLM layer for deeper insights.

⛏️

Automatic Pattern Mining

L2 discovers which strategies, sessions, and conditions produce winners. L3 generates actionable adjustments: disable losers, size up winners.

📊

Automated Daily Reflection

Schedule daily_reflection.py to run at market close. Summarizes P&L, flags anomalies, and updates memory layers automatically.

🎯

Bias Detection

Procedural memory tracks trading behaviors. Detects overtrading, revenge trading, and session-specific biases from your trade history.

📐

Kelly-from-Memory

Context-weighted Kelly Criterion using recalled win rates and payoff ratios. Quarter-Kelly default with risk appetite adjustment.

🧬

Strategy Evolution

NEW

Discover trading strategies from raw price data. LLM-powered hypothesis generation + vectorized backtesting + Darwinian selection. Finds real alpha — statistically validated.

Three-Layer Architecture

Raw trades → pattern discovery → strategy adjustments. Each layer feeds the next.

L1

L1 — Trade Storage

Raw trade records with full context: entry, exit, P&L, strategy, reasoning, market conditions.

L2

L2 — Pattern Discovery

Reflection engine analyzes L1 data. Finds win rates by session, strategy, and confidence. Discovers what works.

L3

L3 — Strategy Adjustment

Actionable outputs: disable losing strategies, adjust position sizes, flag regime changes.

feeds into
OWM

Outcome-Weighted Memory (OWM)

Cognitive science-based recall. 5 memory types scored by outcome quality, similarity, recency, confidence, and affect. Score = Q × Sim × Rec × Conf × Aff.

📖

Episodic

What happened — individual trades

🧠

Semantic

What it means — aggregated patterns

⚙️

Procedural

How you traded — behavioral habits

💭

Affective

How it felt — confidence & drawdown

🔮

Prospective

What to do next — conditional plans

Score = Q × Sim × Rec × Conf × Aff

Install in 30 Seconds

Works with any MCP-compatible client.

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

15 MCP Tools

Complete trading memory interface via Model Context Protocol.

Core Memory

store_trade

Record a trade with full context: instrument, direction, lots, prices, P&L, strategy, reasoning.

recall_trades

Query trade history with filters: date range, instrument, strategy, session, direction.

get_performance

Calculate win rate, profit factor, average P&L, max drawdown, and Sharpe ratio.

run_reflection

Analyze trade history, discover patterns (L2), and generate strategy adjustments (L3).

OWM Cognitive

remember_trade

Store trade as episodic memory, auto-update semantic/procedural/affective layers.

recall_memories

Outcome-weighted recall with score breakdown per component.

get_behavioral_analysis

Procedural memory bias detection: overtrading, revenge trading, disposition effect.

get_agent_state

Affective state: confidence, risk appetite, drawdown tracking, recommended action.

create_trading_plan

Prospective memory: conditional plans triggered by market conditions.

check_active_plans

Match active plans against current market context, auto-expire old plans.

Evolution Engine

evolve_strategies

Run full evolution cycle: discover signals, generate hypotheses, backtest, select survivors.

discover_signals

Scan raw price data for candidate trading signals and market patterns.

generate_hypothesis

LLM-powered hypothesis generation from discovered signals and market context.

run_backtest

Vectorized backtesting engine for fast strategy evaluation across historical data.

select_survivors

Darwinian selection: rank strategies by Sharpe, filter by drawdown, promote to production.