CerebeCerebe Docs

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/store

Request Body

ParameterTypeRequiredDescription
contentstring | objectYesThe memory content to store
session_idstringYesSession identifier
memory_typestringNoOne of semantic, episodic, procedural, sequential. Auto-detected if domain_tag is provided
domain_tagstringNoDomain classification: conversation, insight, knowledge, preference
importancefloatNoImportance score from 0.0 to 1.0 (default: 0.5)
metadataobjectNoArbitrary 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

TypeUse Case
semanticFacts, knowledge, preferences — things that are generally true
episodicEvents and experiences — things that happened at a specific time
proceduralSkills and processes — how to do things
sequentialOrdered sequences — steps in a workflow

Error Responses

StatusDescription
400Invalid request (empty content, invalid importance range)
401Missing or invalid API key
503Memory fabric unavailable (vector store or graph store error)

Next Steps

On this page