BTCUSDT 1H
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.
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
NEWDiscover 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 — Trade Storage
Raw trade records with full context: entry, exit, P&L, strategy, reasoning, market conditions.
L2 — Pattern Discovery
Reflection engine analyzes L1 data. Finds win rates by session, strategy, and confidence. Discovers what works.
L3 — Strategy Adjustment
Actionable outputs: disable losing strategies, adjust position sizes, flag regime changes.
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.
{
"mcpServers": {
"tradememory": {
"command": "uvx",
"args": ["tradememory-protocol"]
}
}
}15 MCP Tools
Complete trading memory interface via Model Context Protocol.
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).
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.
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.