Memory and ML Tools
Memory and ML tools give agents persistent memory, self-awareness of behavioral patterns, and predictive analytics on their own trading.
store_memory
Section titled “store_memory”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The memory content to store. |
category | string | No | Category tag (e.g. "lesson", "observation", "trade_note"). |
metadata | object | No | Key-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.
search_memory
Section titled “search_memory”Cost: $0.003 | Search stored memories using semantic similarity.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query. |
category | string | No | Filter by category. |
limit | int | No | Max 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.
get_trading_biases
Section titled “get_trading_biases”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
trades | object[] | Yes | Recent trades with r_multiple, hold_time_hours, direction, symbol. |
lookback_count | int | No | Number 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.
get_behavioral_fingerprint
Section titled “get_behavioral_fingerprint”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
trades | object[] | Yes | Trade 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.
predict_trajectory
Section titled “predict_trajectory”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
r_multiples | string[] | Yes | Recent R-multiples (minimum 10 recommended). |
forecast_trades | int | No | Number of trades to forecast (default 20). |
starting_equity | string | No | Starting 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.
detect_anomalies
Section titled “detect_anomalies”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
r_multiples | string[] | Yes | R-multiples from trade history. |
sensitivity | string | No | Detection 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.
cluster_trades
Section titled “cluster_trades”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).
| Parameter | Type | Required | Description |
|---|---|---|---|
trades | object[] | Yes | Trades with r_multiple, hold_time_hours, and optional symbol, direction. |
num_clusters | int | No | Number 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.