Skip to main content
Memories are distinct from Session State. They are semantic facts stored in a Vector Database for retrieval across different sessions or long time horizons.

Create Memory

Manually inject a memory into the graph. (Usually handled automatically by SNAP, but useful for initial knowledge seeding).
session_id
string
required
Associate with a session context.
content
string
required
The text content to store and embed.
type
string
default:"general"
Classification: fact, preference, summary, or correction.
tags
array
List of string tags for filtering.
embed
boolean
default:"true"
If true, triggers the embedding generation pipeline immediately.
curl -X POST https://api.statebase.org/v1/memories \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "sess_123",
    "content": "User prefers concise python code without type hints.",
    "type": "preference",
    "tags": ["coding", "style"]
  }'

Search Memories

Perform RAG (Retrieval Augmented Generation) on your agent’s memory.
query
string
required
The semantic search query.
threshold
float
default:"0.75"
Minimum cosine similarity score (0-1).
top_k
integer
default:"3"
Number of results to return.
curl "https://api.statebase.org/v1/memories?query=python+style&threshold=0.8" \
  -H "Authorization: Bearer <token>"