Memory
Give your agent a persistent knowledge store — facts, past events, and learned procedures that survive across sessions.
Memory
Memory gives agents knowledge that persists across sessions. Instead of starting fresh each conversation, agents can remember user preferences, past outcomes, and domain knowledge.
Memory types
| Type | What it stores | Example |
|---|---|---|
semantic | Facts and knowledge | "User prefers bullet-point summaries" |
episodic | Records of events | "On Apr 5, user asked about Q1 results" |
procedural | How to do things | "To generate a report: fetch → aggregate → format" |
Store a memory
Fields:
| Field | Required | Description |
|---|---|---|
agentId | yes | Which agent this belongs to |
memoryType | yes | semantic, episodic, or procedural |
content | yes | The memory text |
summary | no | Shorter version for display |
tags | no | Labels for filtering |
importanceScore | no | 0.0–1.0 — used for pruning |
sourceType | no | conversation, task, or manual |
Retrieve relevant memories
Find memories that match a query using semantic similarity:
score is cosine similarity (0–1). Higher = more relevant.
List all memories
Memory statistics
Update and delete
Using memory in your agent workflow
The typical pattern: retrieve relevant memories before the agent runs, inject them as context.
Semantic search (embeddings)
Memory retrieval uses vector embeddings stored in Supabase. Each memory is embedded when created and searched by cosine similarity.
You can also use the embedding API directly for custom search:
Index content:
Semantic search: