Function writeMemory

  • Writes a value to memory scoped to the current signal.

    Resolves the active pending or scheduled signal automatically from execution context. Automatically detects backtest/live mode from execution context.

    Type Parameters

    • T extends object = object

    Parameters

    • dto: { bucketName: string; description: string; memoryId: string; value: T }
      • bucketName: string

        Memory bucket name

      • description: string

        BM25 index string for contextual search

      • memoryId: string

        Unique memory entry identifier

      • value: T

        Value to store

    Returns Promise<void>

    Promise that resolves when write is complete

    import { writeMemory } from "backtest-kit";

    await writeMemory({ bucketName: "my-strategy", memoryId: "context", value: { trend: "up", confidence: 0.9 }, description: "Signal context at entry" });