API reference · 14 endpoints
Memory
Retain, recall, and reflect — plus memory listing, decisions, tags, and the knowledge graph.
- POSTRetain memories
- POSTRecall memory
- POSTReflect and generate answer
- GETList memory units
- GETGet memory unit
- DELETEClear memory namespace memories
- GETList tags
- GETGet memory graph data
- POSTReconcile standing decisions
- POSTSupersede a decision
- DELETERevive a decision
- GETGet decision lineage
- GETGet observation history
- DELETEClear observations for a memory
/v1/default/namespaces/{namespace_id}/memoriesRetain memories
Retain memory items with automatic fact extraction.
This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the async parameter.
Features:
- Efficient batch processing
- Automatic fact extraction from natural language
- Entity recognition and linking
- Document tracking with automatic upsert (when document_id is provided)
- Temporal and semantic linking
- Optional asynchronous processing
The system automatically:
- Extracts semantic facts from the content
- Generates embeddings
- Deduplicates similar facts
- Creates temporal, semantic, and entity links
- Tracks document metadata
When async=true: Returns immediately after queuing. Use the operations endpoint to monitor progress.
When async=false (default): Waits for processing to complete.
Note: If a memory item has a document_id that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).
Parameters
namespace_idstringpathrequiredRequest body · application/json
itemsMemoryItem[]requiredcontentstringrequiredtimestampstring (date-time) | stringWhen the content occurred. Accepts an ISO 8601 datetime string (e.g. '2024-01-15T10:30:00Z'), null/omitted (defaults to now), or the special string 'unset' to explicitly store without any timestamp (use this for timeless content such as fictional documents or static reference material).
contextstring | nullmetadatamap<string, string>document_idstring | nullOptional document ID for this memory item.
entitiesEntityInput[]Optional entities to combine with auto-extracted entities.
textstringrequiredThe entity name/text
typestring | nullOptional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT')
tagsstring[]Optional tags for visibility scoping. Memories with tags can be filtered during recall.
observation_scopes"per_tag" | "combined" | "all_combinations" | string[][]How to scope observations during consolidation. 'per_tag' runs one consolidation pass per individual tag, creating separate observations for each tag. 'combined' (default) runs a single pass with all tags together. A list of tag lists runs one pass per inner list, giving full control over which combinations to use.
strategystring | nullNamed retain strategy for this item. Overrides the namespace's default strategy for this item only. Strategies are defined in the namespace config under 'retain_strategies'.
update_mode"replace" | "append"How to handle an existing document with the same document_id. 'replace' (default) deletes old data and reprocesses from scratch. 'append' concatenates new content to the existing document text and reprocesses.
fact_type"world" | "experience" | "decision"Optional fact-type override: every fact extracted from this item is stored with this type ('world', 'experience', or 'decision' — never 'observation'). The deterministic "record this decision" path; omit to let the LLM classify.
asyncbooleandefault falseIf true, process asynchronously in background. If false, wait for completion (default: false)
document_tagsstring[]deprecatedDeprecated. Use item-level tags instead.
/v1/default/namespaces/{namespace_id}/memories/recallRecall memory
Recall memory using semantic similarity and spreading activation.
The type parameter is optional and must be one of:
world: General knowledge about people, places, events, and things that happenexperience: Memories about experience, conversations, actions taken, and tasks performed
Parameters
namespace_idstringpathrequiredRequest body · application/json
querystringrequiredtypesstring[]List of fact types to recall: 'world', 'experience', 'observation', 'decision'. Defaults to world, experience, observation, and decision if not specified on the public recall endpoint.
budgetBudgetdefault "mid"Budget levels for recall/reflect operations.
max_tokensintegerdefault 4096tracebooleandefault falsequery_timestampstring | nullISO format date string (e.g., '2023-05-30T23:40:00'). Used as the query-time anchor for relative temporal expressions and recency scoring.
includeIncludeOptionsdefault {}Options for including additional data (entities are included by default)
entitiesEntityIncludeOptionsdefault {"max_tokens":500}Include entity observations. Set to null to disable entity inclusion.
max_tokensintegerdefault 500Maximum tokens for entity observations
chunksChunkIncludeOptionsInclude raw chunks. Set to {} to enable, null to disable (default: disabled).
max_tokensintegerdefault 8192Maximum tokens for chunks (chunks may be truncated)
source_factsSourceFactsIncludeOptionsInclude source facts for observation-type results. Set to {} to enable, null to disable (default: disabled).
max_tokensintegerdefault 4096Maximum total tokens for source facts across all observations (-1 = unlimited)
max_tokens_per_observationintegerdefault -1Maximum tokens of source facts per observation (-1 = unlimited)
tagsstring[]Filter memories by tags. If not specified, all memories are returned.
tags_match"any" | "all" | "any_strict" | "all_strict"default "any"How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
tag_groupsTagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot[]Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
tagsstring[]requiredmatch"any" | "all" | "any_strict" | "all_strict"default "any_strict"as_ofstring | nullDecision time-travel: ISO timestamp (same forms as query_timestamp). Decision results resolve their supersession chain to the node standing as of this time; non-decision results are untouched.
entity_classstring | nullRestrict the graph retrieval arm's entity expansion to entities of this ontology class (case-insensitive name). Other arms are unaffected.
/v1/default/namespaces/{namespace_id}/reflectReflect and generate answer
Reflect and formulate an answer using namespace identity, world facts, and opinions.
This endpoint:
- Retrieves experience (conversations and events)
- Retrieves world facts relevant to the query
- Retrieves existing opinions (namespace's perspectives)
- Uses LLM to formulate a contextual answer
- Returns plain text answer and the facts used
Parameters
namespace_idstringpathrequiredRequest body · application/json
querystringrequiredbudgetBudgetdefault "low"Budget levels for recall/reflect operations.
contextstring | nulldeprecatedDEPRECATED: Additional context is now concatenated with the query. Pass context directly in the query field instead. If provided, it will be appended to the query for backward compatibility.
max_tokensintegerdefault 4096Maximum tokens for the response
includeReflectIncludeOptionsOptions for including additional data (disabled by default)
factsFactsIncludeOptionsInclude facts that the answer is based on. Set to {} to enable, null to disable (default: disabled).
tool_callsToolCallsIncludeOptionsInclude tool calls trace. Set to {} for full trace (input+output), {output: false} for inputs only.
outputbooleandefault trueInclude tool outputs in the trace. Set to false to only include inputs (smaller payload).
response_schemaobject | nullOptional JSON Schema for structured output. When provided, the response will include a 'structured_output' field with the LLM response parsed according to this schema.
tagsstring[]Filter memories by tags during reflection. If not specified, all memories are considered.
tags_match"any" | "all" | "any_strict" | "all_strict"default "any"How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged).
tag_groupsTagGroupLeaf | TagGroupAnd | TagGroupOr | TagGroupNot[]Compound tag filter using boolean groups. Groups in the list are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}.
tagsstring[]requiredmatch"any" | "all" | "any_strict" | "all_strict"default "any_strict"fact_types"world" | "experience" | "observation" | "decision"[]Filter which fact types are retrieved during reflect. None means all types (world, experience, observation, decision).
exclude_automationsbooleandefault falseIf true, exclude all automations from the reflect loop (skip search_automations tool).
exclude_automation_idsstring[]Exclude specific automations by ID from the reflect loop.
/v1/default/namespaces/{namespace_id}/memories/listList memory units
List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).
Parameters
namespace_idstringpathrequiredtype"world" | "experience" | "observation" | "decision"queryqstring | nullqueryconsolidation_statestring | nullquerystatus"standing" | "superseded"queryorder"asc" | "desc"querysincestring (date-time) | nullqueryuntilstring (date-time) | nullquerylimitintegerqueryoffsetintegerquery/v1/default/namespaces/{namespace_id}/memories/{memory_id}Get memory unit
Get a single memory unit by ID with all its metadata including entities and tags. Note: the 'history' field is deprecated and always returns an empty list - use GET /memories/{memory_id}/history instead.
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequired/v1/default/namespaces/{namespace_id}/memoriesClear memory namespace memories
Delete memory units for a memory namespace. Optionally filter by type (world, experience, observation, decision) to delete only specific types. This is a destructive operation that cannot be undone. The namespace profile (disposition and background) will be preserved.
Parameters
namespace_idstringpathrequiredtypestring | nullqueryOptional fact type filter (world, experience, observation, decision)
/v1/default/namespaces/{namespace_id}/graphGet memory graph data
Retrieve graph data for visualization, optionally filtered by type (world/experience/observation/decision).
Parameters
namespace_idstringpathrequiredtypestring | nullquerylimitintegerqueryqstring | nullquerytagsstring[]querytags_matchstringquerydocument_idstring | nullquerychunk_idstring | nullquery/v1/default/namespaces/{namespace_id}/decisions/reconcileReconcile standing decisions
On-demand sweep pairing the namespace's standing decisions and marking supersessions retain-time detection missed. Capped per invocation; repeated calls converge. Billable LLM pairing.
Parameters
namespace_idstringpathrequired/v1/default/namespaces/{namespace_id}/memories/{memory_id}/supersedeSupersede a decision
Manually mark a standing decision as superseded by another standing decision. Writes the same supersedes link, metadata, and history event as retain-time detection, with source "manual".
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequiredRequest body · application/json
superseded_bystring (uuid)requiredId of the standing decision that replaces this one.
/v1/default/namespaces/{namespace_id}/memories/{memory_id}/supersedeRevive a decision
Undo a supersession: restore the decision to standing (lifecycle metadata keys are removed), delete the incoming supersedes link, and append a revived history event.
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequired/v1/default/namespaces/{namespace_id}/memories/{memory_id}/lineageGet decision lineage
Walk the supersession chain through a memory unit, both directions, returning the ordered chain (newest first), the standing head, and optionally which decision was standing at as_of.
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequiredas_ofstring (date-time) | nullquery/v1/default/namespaces/{namespace_id}/memories/{memory_id}/historyGet observation history
Get the full history of an observation, with each change's source facts resolved to their text.
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequired/v1/default/namespaces/{namespace_id}/memories/{memory_id}/observationsClear observations for a memory
Delete all observations derived from a specific memory and reset it for re-consolidation. The memory itself is not deleted. A consolidation job is triggered automatically so the memory will produce fresh observations on the next consolidation run.
Parameters
namespace_idstringpathrequiredmemory_idstringpathrequired