Memory

Procedural Memory

Learn about tracking agent execution history

Procedural Memory allows agents to "remember" their past actions, making it possible to resume interrupted tasks, review execution history, or understand the context of current operations.

How it Works

When an agent performs an action (like searching a file or running a test), it can store that action as a specific type of memory (procedural). These memories are linked by runId and agentId.

Usage

To use procedural memory, include the procedural object in your request to the /memories/ask endpoint.

Store a Step

To record a step in the agent's execution:

{
  "query": "Where is the auth config?",
  "userId": 1,
  "agentId": "coding-agent",
  "runId": "task-123",
  "procedural": {
    "store": true,
    "stepNumber": 1,
    "action": "Searching for configuration files",
    "taskObjective": "Fix login bug",
    "context": "Exploring file structure"
  }
}

The system will:

  1. Perform the RAG search/answer generation as usual.
  2. Store the query, answer, and action details as a new memory with type procedural.

Retrieve History

To get the full history of the current run along with the answer:

{
  "query": "What should I do next?",
  "userId": 1,
  "agentId": "coding-agent",
  "runId": "task-123",
  "procedural": {
    "includeHistory": true
  }
}

Generate Summary

To get a concise summary of all steps taken so far in the current run:

{
  "query": "Summarize progress",
  "userId": 1,
  "agentId": "coding-agent",
  "runId": "task-123",
  "procedural": {
    "summarize": true
  }
}

The response will include a procedural.summary field containing an LLM-generated summary of the entire execution log.

On this page