Share feedback
Answers are generated based on the documentation.

Memory Tool

Persistent key-value storage backed by SQLite for cross-session recall.

Overview

The memory tool provides persistent key-value 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.

By default, the database is stored at ~/.cagent/memory/<config-name>/memory.db, where <config-name> is derived from the loaded configuration (typically the YAML file name) and falls back to default when unavailable. When the agent is loaded from an OCI reference (e.g. docker/my-agent:latest), characters that are reserved in filesystem paths (such as :) are sanitised in the <config-name> segment — the agent's display name elsewhere is unchanged. Agents declared in the same configuration share this database by default; set an explicit path per toolset to isolate them.

Available Tools

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

Configuration

toolsets:
  - type: memory

Options

PropertyTypeDefaultDescription
pathstring~/.cagent/memory/<config-name>/memory.dbPath to the SQLite database file

Custom Database Path

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

Categories

Memories support an optional category field for organization and filtering. Common categories include:

  • preference — User preferences and settings
  • fact — Factual information about the project or user
  • project — Project-specific context
  • decision — Past decisions and their rationale
Tip

Memory is especially useful for long-running assistants that need to recall information across conversations — like coding preferences, project conventions, or context discovered during previous sessions.