Member Junction
    Preparing search index...

    Manages the agent's ephemeral scratchpad (notes + task list) during a single run.

    The scratchpad is:

    • In-memory only — not persisted to DB (snapshots are stored in step InputData/OutputData)
    • Ephemeral per run — starts empty, garbage collected when the run ends
    • Private — never shared with parent or sub-agents
    const manager = new ScratchpadManager();

    // Apply changes from LLM response
    manager.applyScratchpadChanges({
    notes: "Found 3 data sources to analyze",
    taskList: {
    upsert: [
    { id: "t1", title: "Analyze sales data", status: "in_progress" },
    { id: "t2", title: "Analyze marketing data", status: "pending" }
    ]
    }
    });

    // Get snapshot for step OutputData
    const snapshot = manager.toJSON();

    // Get prompt-friendly representation
    const promptText = manager.toPromptString();
    Index

    Constructors

    Methods

    • Enforce the maximum task limit by pruning completed tasks (oldest first). Returns the number of tasks pruned.

      Parameters

      • maxTasks: number

      Returns number

    • Generates a compact markdown representation for prompt injection. More token-efficient than raw JSON dump.

      Returns string