#MEMORY

What an agent learns.Still there next time.

Facts recalled by meaning and JSON records recalled by key. An agent, a function, your backend and the dashboard read the same store.

#WHAT IT HOLDS

Facts, by meaning

Text is embedded when it is written. A search ranks what is stored by similarity to the question, not by keyword.

Records, by key

JSON documents in a collection, read back by their key. Up to two indexed fields per collection, to query by field instead.

Three scopes

The project, one contact, or one conversation. A search in one scope never returns a fact from another.

No code needed

Add memory to an agent from the dashboard and it gets two skills together: remember and recall.

In your code

ctx.memory inside any function handler, client.memory in the TypeScript SDK, and plain REST under /v1/memory.

Expiry when you want it

A fact or a record can delete itself after a time you set, from 60 seconds to two years.

#FROM YOUR BACKEND

import Zavudev from "@zavudev/sdk"

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY })

// A fact, filed against the person it is about.
await zavu.memory.add({
  text: "Prefers WhatsApp over email.",
  scope: "contact",
  contactId: "jd7x2k3m4n5p6q7r8s9t0abc",
})

// Recalled by meaning. minScore makes "nothing on record" a real answer.
const { items } = await zavu.memory.search({
  query: "how they prefer to be contacted",
  scope: "contact",
  contactId: "jd7x2k3m4n5p6q7r8s9t0abc",
  minScore: 0.3,
})

// A JSON record, recalled by key.
await zavu.memory.collections.items.put("ORD-12345", {
  collection: "orders",
  scope: "contact:jd7x2k3m4n5p6q7r8s9t0abc",
  value: { status: "shipped", total: 42.5 },
})

#HOW AN AGENT USES IT

  1. 01

    It remembers

    The remember skill saves one fact about the person the agent is talking to. If Zavu has not identified who is writing, it refuses.

  2. 02

    It recalls

    Before answering, recall searches that contact first and then the project. Matches under a similarity of 0.3 are not returned.

  3. 03

    You can see it

    The Memory screen in the dashboard shows what was stored in each scope, and lets you search and delete it.

#BEFORE YOU BUILD ON IT

  • Free includes 250,000 units a month and 0.5 GB, and stops there: new writes are refused until the 1st, while reads and deletes keep working.
  • Pro includes 2,000,000 units a month and 5 GB. Past that it is $5 per million units and $1 per GB a month.
  • A unit is the capacity a request uses, and a write counts five times a read. Saving one fact is about 25 units; a recall over a contact holding 100 facts is about 30.
  • Scopes have caps: 10,000 facts for the project (5,000 on Free), 2,000 per contact, 1,000 per conversation.
  • Everything defaults to the project scope. A fact about one customer written there can be recalled in every other customer's conversation, so file it against the contact.
  • A collection's indexed fields are declared when it is created and cannot be added later. A record holds up to 200 KB.

Give your agent a memory.

Memory is on every plan, Free included. Start with the two skills, move to code when you need to.

Memory for AI agents | Zavu | Zavu