Docs

Memory and vectors

Per-user memory, and vector indexes to search your own data.

AxAgent has two ways to keep information: memory for facts about each user, and vectors for searching your own data.

Coming Q4 2026

AxAgent launches in Q4 2026. The API below may change before launch.

FeatureWhat it storesScope
MemoryFacts about a userOne agent, one user
VectorsYour documents and dataAn index you create

Enable the modules

const agent = await axerity.agents.create({
  model: 'anthropic/claude-sonnet-5.5',
  modules: {
    memory: true,
    vectors: { indexes: ['help-center'] },
  },
})

Memory

Memory is kept per user. When you build an agent for your own customers, each customer gets their own memory. See sessions.

Add a memory

memories.ts
await axerity.memories.add({
  agent: agent.id,
  user: customer.id,
  text: 'Prefers email over phone. Timezone is CET.',
})

Search memories

const { data } = await axerity.memories.search({
  agent: agent.id,
  user: customer.id,
  query: 'How should we contact them?',
})

Vectors

Vectors let you vectorize your data and search it by meaning. Create an index, add records to it, then query it.

Create an index

const index = await axerity.vectors.indexes.create({
  name: 'help-center',
})

Add records

Each record has an id and the text to vectorize.

await axerity.vectors.upsert(
  index.id,
  articles.map((article) => ({ id: article.slug, text: article.body })),
)

Query the index

const { matches } = await axerity.vectors.query(index.id, {
  text: 'reset my password',
  topK: 5,
})

List an index in the agent's vectors module to give the agent access to it.

On this page