Recall
Memory for agents. Episodic turns, semantic embeddings, working sets, and
a scoped KV — all in one schema, all hit through agent-memory.
Tables
| Table | Purpose |
|---|---|
recall.episodic | Ordered turns (kind, text, provenance, scope). |
recall.semantic | Embedded chunks with a Firestore vector search column. |
recall.working_sets | Named, bounded sets the agent actively reasons over. |
recall.kv | Scoped key/value (per-agent, per-scope). |
Scopes
Every write carries scope text[] (e.g. ['self'], ['team:triage'],
['org']). Reads intersect the caller's authorized scopes. A leaked
device key for agent A can never read B's ['self'] rows.
Similarity search
recall.semantic uses Firestore vector search with an ivfflat index. The Cloud Function
exposes /mem/query:
{
"agent_id": "agent-hello",
"q": "what did I promise the vendor?",
"k": 8,
"scope": ["self", "team:sales"]
}
Firestore vector search returns cosine-ranked chunks; provenance rides back so the
agent can cite.
Episodic turns
Turns are append-only and carry provenance (e.g.
inbound-email:<msg-id>, slack:<ts>) so downstream summaries trace
back to primary sources.
Routes
| Method | Path | Purpose |
|---|---|---|
| POST | /mem/write | Append an episode, semantic chunk, or KV row. |
| POST | /mem/query | Similarity or exact-match read. |
| POST | /mem/forget | Soft-delete by id or provenance. |
| POST | /set/put | Update a working set. |
| POST | /kv/get | Scoped KV fetch. |
| POST | /kv/put | Scoped KV write. |
Retention
agentpack_recall_episodic_retention (03:37 UTC daily) trims episodic
rows past recall_episodic_retention_days (default 180). Semantic and
KV are retained until explicit forget.