Skip to content

memory

Memory: what agents know across conversations.

On this page 6
TypeScript
import { memory } from "copilotz/plugins/agents";

What it keeps

It keeps 2 collections, 1 of them on the record.

CollectionKept asFields
memorydocumentstext, about, core, in, by, source, was, at, updated, forgotten; vectors: embedding
memoryProgressdocumentspending

The access rules cover memory: each document is in a space, and only those who reach the space reach it.

Its named queries read for callers, as the rules let them:

QueryWho outside runs it
memory.corethe app's code
memory.listpeople, agents for a person, keys and routines
memory.relevantthe app's code

What it lets callers do

Of its 2 Actions, people may call 1; agents, contacts and someone signed out may call none.

ActionPersonAgentContactAnyoneKeyRoutineWhat it does
memory.moveyesnononononoMoves a memory to another space.

An agent works for a person, and calls what both may. A key calls only what its scope names. A routine is work done for a person, which they set going.

Only the app's own code calls memory.import: its plugins, its schedules and the system.

Agents act through its 3 tools, as whoever they work for:

ToolWhat it doesCalls
forgetForget a memory that is wrong or no longer wanted, by its [id].
recallSearch what you remember, by meaning and by words: about the people here, yourself, this conversation and everyone.
rememberRemember something worth knowing in later conversations: one self-contained statement naming who it is about, and why it matters if that isn't obvious. about: the person it concerns, by name (by default, the person you're talking with), "me" for a note to yourself, "thread" for this conversation only, or "everyone". core: true for what you should always have in mind about them (who they are, strong preferences).

It also adds rules every read and write keeps to (guard).

Where it shows

Its Views show to the model.

  • To the model: context:memory, context:recall, context:remembered, llm.memory.
  • Agents' tools: forget, recall, remember.
  • Front ends: memory-terminal and memory-web.
  • What it adds to resources: context (memory, recall, remembered).

What it needs

You set it in resources.memory.

SettingTypeRequiredWhat it is
memory.embedderModelRefnoAn embeddings model ("provider/model", …), for semantic recall; without one, recall matches words.
memory.extractorModelRefnoA model ("provider/model", …) that extracts memories from conversations on its own.
memory.everynumbernoShared messages per extraction (8).
memory.quietnumbernoHow long a conversation is quiet, in milliseconds, before what it said since its last extraction is read anyway (10 minutes); 0: only every.
memory.agentsstring[]noThe agents with memory (all by default).

What it requires

The runtime doesn't start without chat: add it too.

It ships with copilotz@1.0.0-rc.38.

Listing

It keeps every listing rule.