Agent Memory
API Reference

Episodes and procedures

List and search past runs (episodes), list learned procedures and record procedure validations.

Episodes and procedures are produced by consolidation. Both are also included in every recall (relevantEpisodes, procedures); these endpoints let you browse them directly.

Episodes

An episode is one consolidated run:

{
  "id": "…",
  "workspaceId": "…",
  "applicationId": null,
  "runId": "run-1",
  "agentId": "support-bot",
  "goal": "Add vegetarian filtering to the menu service",
  "outcome": "successful",
  "successScore": 0.85,
  "summary": "…",
  "previousEpisodeId": "…",
  "startedAt": "2026-10-01T09:00:00Z",
  "endedAt": "2026-10-01T09:40:00Z",
  "visibility": "workspace",
  "ownerAgentId": "support-bot",
  "userId": null
}

outcome is successful, failed or uncertain. An episode is only as readable as the run it came from: its visibility is the intersection of its events' policies, and both endpoints below return only the episodes the caller may see.

List recent episodes

GET /v1/episodes/{workspaceId}?limit=10

limit is clamped to 1–100 (default 10). Returns an array of episodes, most recent first.

Search episodes

POST /v1/episodes/search — find past runs similar to a goal or situation.

{ "workspaceId": "…", "query": "authentication bug fix", "topK": 5 }

topK is clamped to 1–50 (default 5). Returns an array of episodes. MCP: search_episodes.

Procedures

A procedure is a learned "how-to":

{
  "id": "…",
  "workspaceId": "…",
  "applicationId": null,
  "name": "Add a repository class",
  "trigger": "new aggregate root",
  "goal": "Persist an aggregate with the project conventions",
  "steps": ["…", "…"],
  "preconditions": ["…"],
  "antiPatterns": ["Don't expose IQueryable from repositories"],
  "validationCount": 4,
  "successCount": 3,
  "failureCount": 1,
  "confidence": 0.72,
  "lastValidatedAt": "2026-10-01T09:00:00Z",
  "tags": {},
  "sourceMemoryIds": ["…"],
  "visibility": "workspace",
  "ownerAgentId": null,
  "userId": null
}

List procedures

GET /v1/procedures/{workspaceId}?query=repository&limit=10

query optionally filters procedures; limit is clamped to 1–100 (default 10). Returns an array. MCP: list_procedures.

Validate a procedure

POST /v1/procedures/validate — record that applying a procedure succeeded or failed.

{ "workspaceId": "…", "procedureId": "…", "success": true }

Response: {"status":"validated"}. Validations update the procedure's success and failure counts and its confidence. Reporting an outcome validates the procedures a run applied automatically, so you only need this endpoint for validations outside the outcome flow.

On this page