Skip to content

Memory and ML Tools

Memory and ML tools give agents persistent memory, self-awareness of behavioral patterns, and predictive analytics on their own trading.

Cost: $0.003 | Store a memory entry for later retrieval.

Agents can store observations, lessons, trade notes, or any structured data that they want to recall in future sessions. Memories are encrypted at rest using per-agent AES-256 keys.

ParameterTypeRequiredDescription
contentstringYesThe memory content to store.
categorystringNoCategory tag (e.g. "lesson", "observation", "trade_note").
metadataobjectNoKey-value metadata for filtering.
result = client.call_tool(
"store_memory",
content="AAPL tends to gap down on earnings misses. Last 3 earnings: 2 gaps down, 1 flat.",
category="observation",
metadata={"symbol": "AAPL", "topic": "earnings"},
)

Returns: memory_id, stored_at, category.


Cost: $0.003 | Search stored memories using semantic similarity.

ParameterTypeRequiredDescription
querystringYesNatural language search query.
categorystringNoFilter by category.
limitintNoMax results (default 10).
result = client.call_tool(
"search_memory",
query="What do I know about AAPL earnings behavior?",
category="observation",
limit=5,
)

Returns: memories[] each with memory_id, content, category, similarity_score, stored_at.


Cost: $0.005 | Analyze the agent’s trade history for behavioral biases.

Detects common biases: disposition effect (holding losers too long, cutting winners too short), recency bias, overtrading, loss aversion, anchoring, and confirmation bias.

ParameterTypeRequiredDescription
tradesobject[]YesRecent trades with r_multiple, hold_time_hours, direction, symbol.
lookback_countintNoNumber of trades to analyze (default 50).
result = client.call_tool(
"get_trading_biases",
trades=[
{"r_multiple": "1.2", "hold_time_hours": "4", "direction": "long", "symbol": "AAPL"},
{"r_multiple": "-0.5", "hold_time_hours": "48", "direction": "long", "symbol": "MSFT"},
{"r_multiple": "0.3", "hold_time_hours": "2", "direction": "short", "symbol": "TSLA"},
],
)

Returns: biases[] each with bias_type, severity (LOW, MEDIUM, HIGH), evidence, recommendation.


Cost: $0.005 | Generate a behavioral fingerprint of the agent’s trading style.

Characterizes the agent across multiple dimensions: risk appetite, hold duration profile, directional preference, asset concentration, time-of-day patterns, and streak behavior.

ParameterTypeRequiredDescription
tradesobject[]YesTrade history with r_multiple, hold_time_hours, direction, symbol, entry_time.
result = client.call_tool(
"get_behavioral_fingerprint",
trades=recent_trades,
)

Returns: risk_profile (CONSERVATIVE, MODERATE, AGGRESSIVE), avg_hold_hours, directional_bias, concentration_score, streak_tendency, style_summary.


Cost: $0.008 | Predict the agent’s performance trajectory based on current patterns.

Uses recent R-multiples and behavioral data to forecast likely outcomes over the next N trades.

ParameterTypeRequiredDescription
r_multiplesstring[]YesRecent R-multiples (minimum 10 recommended).
forecast_tradesintNoNumber of trades to forecast (default 20).
starting_equitystringNoStarting equity for dollar projections.
result = client.call_tool(
"predict_trajectory",
r_multiples=["1.5", "-1.0", "2.3", "-0.5", "1.8", "-1.0", "3.2", "0.8", "1.1", "-0.7"],
forecast_trades=50,
starting_equity="100000",
)

Returns: projected_g, projected_equity, confidence_interval, trend_direction, risk_factors, recommendation.


Cost: $0.006 | Detect anomalous trades in the agent’s history.

Identifies trades that deviate significantly from the agent’s normal pattern. Useful for catching errors, unusual market conditions, or strategy drift.

ParameterTypeRequiredDescription
r_multiplesstring[]YesR-multiples from trade history.
sensitivitystringNoDetection sensitivity: "low", "medium", "high". Default "medium".
result = client.call_tool(
"detect_anomalies",
r_multiples=["1.5", "-1.0", "2.3", "-0.5", "1.8", "-1.0", "3.2", "0.8", "-4.5", "1.1"],
sensitivity="medium",
)

Returns: anomalies[] each with index, r_multiple, z_score, anomaly_type (EXTREME_WIN, EXTREME_LOSS, PATTERN_BREAK), severity.


Cost: $0.006 | Cluster trades by outcome pattern to discover hidden groupings.

Groups trades into clusters based on R-multiple, hold time, and other features. Reveals whether the agent has distinct “modes” of trading (e.g., a high-conviction mode vs. a scalping mode).

ParameterTypeRequiredDescription
tradesobject[]YesTrades with r_multiple, hold_time_hours, and optional symbol, direction.
num_clustersintNoNumber of clusters (default: auto-detect).
result = client.call_tool(
"cluster_trades",
trades=[
{"r_multiple": "1.5", "hold_time_hours": "4", "symbol": "AAPL", "direction": "long"},
{"r_multiple": "-0.3", "hold_time_hours": "0.5", "symbol": "TSLA", "direction": "short"},
{"r_multiple": "2.8", "hold_time_hours": "72", "symbol": "MSFT", "direction": "long"},
],
)

Returns: clusters[] each with cluster_id, trade_count, avg_r, avg_hold_hours, dominant_direction, dominant_symbols[], g_contribution.