Skip to main content
The memory tool provides persistent storage backed by SQLite. Data survives across sessions, allowing agents to remember facts, user preferences, project context, and past decisions. Memories can be organized with categories and searched by keyword. Each agent gets its own database at ~/.cagent/memory/<agent-name>/memory.db by default.

Available tools

ToolDescription
add_memoryStore a new memory with optional category.
get_memoriesRetrieve all stored memories.
search_memoriesSearch memories by keywords and/or category — more efficient than get_memories.
update_memoryUpdate an existing memory’s content or category by ID.
delete_memoryDelete a specific memory by ID.

Configuration

toolsets:
  - type: memory

Options

path
string
default:"~/.cagent/memory/<agent-name>/memory.db"
Path to the SQLite database file. Use a relative path to store the database alongside your agent configuration.

Custom database path

toolsets:
  - type: memory
    path: ./agent-memory.db

Memory categories

Memories support an optional category field for organization and filtering. Use categories consistently so the agent can search efficiently. Common categories:
CategoryPurpose
preferenceUser preferences and settings
factFactual information about the project or user
projectProject-specific context and conventions
decisionPast decisions and their rationale

Example agent

mem.yaml
agents:
  root:
    model: openai/gpt-4o
    description: Personalized assistant with long-term memory
    instruction: |
      You are a helpful assistant with persistent memory.
      When you learn something important about the user or project,
      store it with add_memory so you can recall it in future sessions.
      Before answering questions, search your memory for relevant context.
    toolsets:
      - type: memory
        path: ./assistant-memory.db
Memory is especially useful for long-running assistants that need to recall context across conversations — such as coding preferences, project conventions, or decisions made in previous sessions.

Think

Reason through problems before acting.

Todo

Track tasks across multi-step workflows.

Agents

Agent configuration reference.

Configuration

Full toolset configuration reference.

Build docs developers (and LLMs) love