Skip to main content

agent-memory

Base: https://<ref>.firebaseapp.com/functions/v1/agent-memory

POST /mem/write

{
"agent_id": "agent-hello",
"kind": "episode",
"text": "Replied to alice@vendor.com about invoicing",
"provenance": "inbound-email:msg_123",
"scope": ["self"]
}

kind is one of episode, semantic, kv. semantic rows are embedded server-side and indexed.

POST /mem/query

{
"agent_id": "agent-hello",
"q": "what did the vendor promise?",
"k": 5,
"scope": ["self", "team:sales"]
}

Returns { hits: [{ id, text, provenance, score }] } ranked by cosine similarity.

POST /mem/forget

{ "agent_id": "agent-hello", "provenance": "inbound-email:msg_123" }

POST /set/put

{
"agent_id": "agent-hello",
"name": "active-threads",
"add_ids": ["msg_1", "msg_2"],
"remove_ids": ["msg_0"]
}

POST /kv/get · /kv/put

Scoped key/value. scope is required on writes and enforced on reads.