POST /agentmemory/remember
Saves an observation or insight to long-term memory. Use this to explicitly capture decisions, patterns, or facts that you want available in future sessions — even if no session hook fired. Returns201 Created on success.
Request
string
required
The memory content to save. Be specific — Agent Memory uses this text for BM25 keyword indexing and vector embedding, so precise wording improves future recall accuracy.
string
Memory classification. One of:
pattern— a recurring code pattern or approachpreference— a developer or team preferencearchitecture— an architectural decisionbug— a known bug or gotchaworkflow— a workflow or process stepfact— a general factual statement
fact if not supplied.string
Project name to scope this memory. If set, the memory is included in project-scoped recalls and profile queries.
string[]
Concept tags used to improve retrieval. These are indexed separately from the content and used by the BM25 and graph search streams.
string[]
Related file paths. Used by the enrichment and file-context endpoints to surface this memory when the agent opens these files.
number
Number of days after which this memory should begin to decay. Agent Memory will set a
forgetAfter timestamp and evict the memory during the next decay sweep.string[]
IDs of observations that this memory was derived from. Provides provenance — you can trace any memory back to the raw session event.
Response
string
Unique identifier for the saved memory. Use this to retrieve, evolve, or delete the memory later.
number
Initial memory strength between
0.0 and 1.0. Strength increases each time the memory is recalled and decays over time via the Ebbinghaus curve.POST /agentmemory/forget
Deletes observations or memories. You can delete bymemoryId (removes a specific long-term memory) or by sessionId (removes all observations for a session).
Delete a specific memory
Delete all observations for a session
sessionId and observationIds together to delete specific observations within a session:
string
ID of a long-term memory to delete. Required unless
sessionId is provided.string
Session ID to clear. Removes all observations for the session. Required unless
memoryId is provided.string[]
Specific observation IDs to delete within the given
sessionId. If omitted, all observations for the session are removed.GET /agentmemory/memories
Lists stored long-term memories with optional filtering and pagination. For large corpora, uselimit and offset to page through results.
Response
GET /agentmemory/memories/:id
Retrieves a single memory by its ID.{ "memory": Memory } or 404 if the memory does not exist.
GET /agentmemory/profile
Returns the memory profile for a project — the top concepts, most-accessed files, learned conventions, and common error patterns that Agent Memory has built up across all sessions for this project.string
required
The project name to retrieve the profile for. Returns
400 if omitted.Response
POST /agentmemory/evolve
Updates an existing memory with new content while preserving its version history. Use this when you learn that a previous memory was incorrect or incomplete. The old version is retained and marked as superseded.string
required
ID of the memory to evolve.
string
required
The updated memory content. The previous version is stored and linked as a
supersedes relation.string
Optional new title for the evolved memory.
GET /agentmemory/export
Exports all memory data as a single JSON object. Use this to back up your memory store, migrate to a new machine, or inspect raw state.maxSessions and offset:
Response
The response is anExportData object containing:
POST /agentmemory/import
Imports memory data from a previous export. Wrap theExportData object in an exportData field:
object
required
An
ExportData object from a previous GET /agentmemory/export call.string
Import conflict strategy. One of:
merge(default) — combine imported data with existing datareplace— replace existing data with the importskip— skip any records that already exist
GET /agentmemory/audit
Returns the full audit trail of memory operations — everyremember, forget, consolidate, evolve, import, export, and governance operation, with timestamps, function IDs, target memory IDs, and agent IDs.
Response
Governance Endpoints
DELETE /agentmemory/governance/memories
Bulk-deletes specific memories by ID with a mandatory audit log entry.POST /agentmemory/governance/bulk-delete
Bulk-deletes memories matching a filter. SupportsdryRun=true to preview what would be deleted.
Memory Consolidation
POST /agentmemory/consolidate
Manually triggers the 4-tier memory consolidation pipeline. RequiresCONSOLIDATION_ENABLED=true and a configured LLM provider.
503 with { "flag": "CONSOLIDATION_ENABLED", "enableHow": "..." } if consolidation is not enabled.
POST /agentmemory/consolidate-pipeline
Runs a specific consolidation tier. Accepts an optionaltier field ("working", "episodic", "semantic", "procedural").
POST /agentmemory/evict
Evicts memories that have decayed below the retention threshold. Supports?dryRun=true to preview evictions.