Store Memory
Store a new memory in the cognitive memory fabric.
Store Memory
Store a memory into Cerebe's Memory Fabric. Memories are persisted across sessions and become searchable via semantic similarity, graph traversal, and keyword matching.
Endpoint
POST /api/v1/memory/storeRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | object | Yes | The memory content to store |
session_id | string | Yes | Session identifier |
memory_type | string | No | One of semantic, episodic, procedural, sequential. Auto-detected if domain_tag is provided |
domain_tag | string | No | Domain classification: conversation, insight, knowledge, preference |
importance | float | No | Importance score from 0.0 to 1.0 (default: 0.5) |
metadata | object | No | Arbitrary key-value metadata attached to the memory |
Examples
from cerebe import AsyncCerebe
client = AsyncCerebe(api_key="ck_live_...")
result = await client.memory.add(
content="User prefers visual explanations over text",
user_id="user_123",
session_id="session_abc",
type="semantic",
importance=0.8,
metadata={"source": "onboarding", "topic": "preferences"},
)
print(result)
# → {"message": "Memory stored successfully", "data": {...}}import Cerebe from '@cerebe/sdk'
const client = new Cerebe({ apiKey: 'ck_live_...' })
const result = await client.memory.add({
content: 'User prefers visual explanations over text',
userId: 'user_123',
sessionId: 'session_abc',
type: 'semantic',
importance: 0.8,
metadata: { source: 'onboarding', topic: 'preferences' },
})
console.log(result)
// → { message: "Memory stored successfully", data: {...} }curl -X POST https://api.cerebe.ai/api/v1/memory/store \
-H "X-API-Key: ck_live_..." \
-H "Content-Type: application/json" \
-d '{
"content": "User prefers visual explanations over text",
"session_id": "session_abc",
"memory_type": "semantic",
"importance": 0.8,
"metadata": {"source": "onboarding", "topic": "preferences"}
}'Response
Returns 201 Created on success:
{
"message": "Memory stored successfully",
"data": {
"id": "mem_a1b2c3d4",
"session_id": "session_abc",
"memory_type": "semantic",
"importance": 0.8,
"timestamp": "2025-03-07T14:30:00Z"
}
}Memory Types
| Type | Use Case |
|---|---|
semantic | Facts, knowledge, preferences — things that are generally true |
episodic | Events and experiences — things that happened at a specific time |
procedural | Skills and processes — how to do things |
sequential | Ordered sequences — steps in a workflow |
Error Responses
| Status | Description |
|---|---|
400 | Invalid request (empty content, invalid importance range) |
401 | Missing or invalid API key |
503 | Memory fabric unavailable (vector store or graph store error) |
Next Steps
- Search Memories — Find stored memories with semantic search
- Harvest Memories — Automatically extract memories from conversations
- Memory Overview — Full guide to the Memory Fabric