Implements TMemoryInstance
Live trading memory adapter with pluggable storage backend.
Features:
Use this adapter for live trading memory storage.
constructor();
MemoryFactory: any
getInstance: any
disposeSignal: (signalId: string) => void
Disposes all memoized instances for the given signalId. Called by MemoryAdapter when a signal is cancelled or closed.
writeMemory: <T extends object = object>(dto: { memoryId: string; value: T; signalId: string; bucketName: string; description: string; }) => Promise<void>
Write a value to memory.
searchMemory: <T extends object = object>(dto: { query: string; signalId: string; bucketName: string; settings?: SearchSettings; }) => Promise<{ memoryId: string; score: number; content: T; }[]>
Search memory using BM25 full-text scoring.
listMemory: <T extends object = object>(dto: { signalId: string; bucketName: string; }) => Promise<{ memoryId: string; content: T; }[]>
List all entries in memory.
removeMemory: (dto: { memoryId: string; signalId: string; bucketName: string; }) => Promise<void>
Remove an entry from memory.
readMemory: <T extends object = object>(dto: { memoryId: string; signalId: string; bucketName: string; }) => Promise<T>
Read a single entry from memory.
useLocal: () => void
Switches to in-memory BM25 adapter. All data lives in process memory only.
usePersist: () => void
Switches to file-system backed adapter (default). Data is persisted to ./dump/memory/<signalId>/<bucketName>/.
useDummy: () => void
Switches to dummy adapter that discards all writes.
useMemoryAdapter: (Ctor: TMemoryInstanceCtor) => void
Switches to a custom memory adapter implementation.
clear: () => void
Clears the memoized instance cache. Call this when process.cwd() changes between strategy iterations so new instances are created with the updated base path.