Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nonhumans.ai/llms.txt

Use this file to discover all available pages before exploring further.

Your agent remembers nothing by default — unless you give it memory. The memory primitive provides two complementary storage layers: a vector store for semantic recall, and a file drive for raw assets. Everything persists across agent restarts, so context your agent builds today is still available the next time it runs.

Storage Types

Vector Memory

Embed and retrieve experiences, notes, and knowledge using semantic similarity search.

File Storage

Upload and retrieve raw files — PDFs, images, CSVs, audio — attached to your agent.

Vector Memory

Vector memory lets your agent store any text as an embedding and later retrieve the most semantically relevant entries. Use it to remember user preferences, store summaries of past conversations, or build a private knowledge base your agent can query at runtime.

Store a memory

await agent.memory.store({
  content: 'User Alice prefers morning meetings between 9am and 11am.',
  metadata: { userId: 'alice', category: 'preferences' },
});

Search memories

const results = await agent.memory.search({
  query: 'Alice preferences',
  limit: 5,
});

results.forEach((entry) => {
  console.log(entry.content, entry.score);
});
Chunk large documents into 300–500 token segments before storing them. Smaller, focused chunks produce higher-quality similarity scores and more precise retrieval.

File Storage

Use the file drive to attach raw assets to your agent — reports, images, data exports, or any binary content. Files are stored durably and can be retrieved at any time.

Upload a file

import { readFileSync } from 'fs';

const content = readFileSync('./report.pdf');

const file = await agent.memory.files.upload({
  name: 'report.pdf',
  content,
});

console.log('Uploaded:', file.id);

Memory Persistence

Both storage layers survive agent restarts automatically — you don’t need to configure anything. Vector embeddings and uploaded files are durable by default and tied to your agent’s identity.
Memory is scoped per agent handle. Two agents with different handles never share a memory namespace, even within the same project.

Common Use Cases

1

Remember user preferences

Store user-specific context (timezone, communication style, project priorities) as vector memories and retrieve them at the start of each session.
2

RAG over documents

Upload PDFs or text files to file storage, chunk and embed their contents into vector memory, and run semantic search at inference time to ground your agent’s responses.
3

Build a knowledge base

Continuously store summaries, notes, and facts as your agent operates. Over time, your agent accumulates a rich, queryable knowledge base scoped entirely to its own identity.