Memory
FinancialSituationMemory
Memory system for storing and retrieving financial situations using BM25.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Name identifier for this memory instance. |
required |
|
dict | None
|
Configuration dict kept for API compatibility. BM25 memory does not use it. Defaults to None. |
None
|
Methods:
| Name | Description |
|---|---|
add_situations |
Add financial situations and their corresponding advice. |
get_memories |
Find matching recommendations using BM25 similarity. |
clear |
Clear all stored memories. |
Source code in src/tradingagents/agents/utils/memory.py
add_situations
Add financial situations and their corresponding advice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
list[tuple[str, str]]
|
Situation and recommendation pairs to store. |
required |
Source code in src/tradingagents/agents/utils/memory.py
get_memories
Find matching recommendations using BM25 similarity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The current financial situation to match against. |
required |
|
int
|
Number of top matches to return. Defaults to 1. |
1
|
Returns:
| Type | Description |
|---|---|
list[dict]
|
list[dict]: Dictionaries containing |