Memory
The Brain API provides long-term memory storage and semantic retrieval to personalize responses.
Memory is part of the RAG (Retrieval-Augmented Generation) system. See Architecture for system overview and Configuration Reference for RAG configuration options.
Endpoints
GET /v1/memory — Search memories (semantic)
POST /v1/memory — Create memory
DELETE /v1/memory/<id> — Delete memory
Search Memories
curl "http://localhost:7000/v1/memory?search=preferences&limit=5"
Query Parameters:
search: Semantic search query (required for retrieval)entity: Optional entity/topic scopelimit: Max results (default 20, capped at 20)
Create Memory
curl -X POST http://localhost:7000/v1/memory \
-H "Content-Type: application/json" \
-d '{
"text": "User prefers concise answers",
"importance": 4,
"scope": "global"
}'
Fields:
text(required): Memory textimportance(1-5, default 3)scope(defaultglobal)entity(optional): Topic/entity scope
Delete Memory
curl -X DELETE http://localhost:7000/v1/memory/memory-id-here
Notes
RAG must be enabled (
RAG_ENABLED=true) and Chroma reachable. See Configuration Reference for RAG setup.Memories are retrieved semantically; include clear, concise facts.
Entity scopes (
entity:project-x) let you isolate context by topic. See Data Model Reference for metadata schemas.Memory saves from chat occur after completion of a turn/stream. See Streaming for SSE implementation.