Skip to content

Memories API

Base URL: http://localhost:4545/api/v1

All endpoints below require auth once REMEM_API_KEY is set — see Authentication.

POST /memories

Fires connection discovery asynchronously in the background; the response returns before discovery finishes.

FieldTypeDefaultNotes
contentstringrequired1–100,000 bytes
memory_type"short_term" | "long_term"short_term
tagsstring[][]max 50
importancefloat 0–10.5
emotional_valencefloat -1–10.0
arousalfloat 0–10.0>= 0.8 creates a protected “flashbulb” memory — see Memory Lifecycle
healthfloat 0–100100.0active-forgetting health score
ttlinteger (seconds)noneonly meaningful for short_term
sourcestringnonefree-text provenance tag
graph_extractionobjectnone{entities: [{name, entity_type?, description?}], relationships: [{source, target, relationship_type?, strength?}]} — max 100 entities / 200 relationships. Lets the calling LLM supply entities/relationships it already extracted; each entity becomes a linked long-term memory.
{
"content": "User prefers dark mode.",
"memory_type": "long_term",
"tags": ["preference", "ui"],
"importance": 0.7,
"emotional_valence": 0.2
}

Response: 201 Created with the full Memory object. 422 on empty/oversized content or too many tags/entities. 500 on embedding or storage failure.

Setting arousal >= 0.8 at creation time force-promotes the memory to long_term, floors importance at 0.9, and exempts it from importance decay and active forgetting for 30 days (tracked via flashbulb_until). This only applies at creation — raising arousal on an existing memory via PUT does not retroactively apply it.

GET /memories/{id}?include_connections=false

Response: 200 OK with Memory, or 404 Not Found. Fetching a memory boosts its health by +10 (capped at 100) — see Memory Lifecycle.

PUT /memories/{id}

Partial update — body accepts any subset of content, tags, importance, emotional_valence, arousal, health, source.

{
"content": "User prefers dark mode (updated preference).",
"importance": 0.9,
"tags": ["preference", "ui", "confirmed"]
}

Response: 200 OK with the updated Memory, 404 if not found, 422 on oversized content/tags.

DELETE /memories/{id}?hard=false

hard=false (default): soft-archives the memory (archived: true, excluded from search/list/stats). hard=true: permanently removes it.

Response: 200 OK with {"success": true, "message": "memory deleted"}, 404 if not found.

POST /memories/search
FieldTypeDefaultNotes
querystringrequired
search_type"semantic" | "keyword" | "hybrid"semantic
limitinteger10max 500
memory_type"short_term" | "long_term"none
tagsstring[][]
min_importance, max_importancefloat 0–1none
related_toUUIDnoneboosts memories graph-connected to this memory
{
"query": "user interface preferences",
"search_type": "hybrid",
"limit": 10,
"tags": ["preference"],
"memory_type": "long_term",
"min_importance": 0.5
}

Response: 200 OK

{
"results": [
{
"memory": { "id": "...", "content": "...", "importance": 0.7 },
"score": 0.91
}
],
"total": 1
}

422 on empty query or unknown search_type.

GET /memories?limit=10&offset=0
Query paramNotes
limitdefault 10, max 100
offsetdefault 0
memory_typeshort_term | long_term
tagscomma-separated, e.g. tags=rust,async
min_importance, max_importance0.0–1.0
created_after, created_beforeRFC-3339, e.g. 2024-01-01T00:00:00Z
include_connectionsdefault false

Response: 200 OK with {"total": n, "limit": n, "offset": n, "memories": [Memory, ...]}.

GET /memories/{id}/related?depth=1&relationship_types=&limit=20

See the full traversal and connection-management reference in Connections API.

{
"id": "uuid",
"content": "string",
"memory_type": "short_term | long_term",
"metadata": {
"created_at": "timestamp",
"updated_at": "timestamp",
"accessed_at": "timestamp",
"access_count": "integer",
"source": "string | null",
"tags": ["string"],
"importance": "float (0-1)",
"emotional_valence": "float (-1 to 1)",
"arousal": "float (0-1)",
"health": "float (0-100)",
"last_recalled_at": "timestamp | null",
"flashbulb_until": "timestamp | null",
"ttl": "integer (seconds) | null"
},
"connections": [
{
"target_id": "uuid",
"relationship_type": "related_to | caused_by | part_of | references | contradicts | supports | similar_to | derived_from",
"strength": "float (0-1)",
"created_at": "timestamp"
}
]
}

connections is only populated when a request opts in via include_connections=true — list/get calls omit it by default to keep responses small.

Business — Coming soon. Bulk memory insert (POST /memories/bulk) is not part of the Community Edition today. To insert many memories now, call POST /memories in a loop or in parallel.