Skip to main content

How to Configure Memory

๐Ÿ”ง Tools ยท ๐Ÿ“‹ Prompt

The agent can maintain persistent memory across conversations. When it learns something worth remembering (user preferences, project context, recurring corrections), it saves a concise fact via the save_memory tool. On the next session, saved memories are loaded into the system prompt automatically, either all of them or only the most recent (see Memory Context Strategy).

Memory Toolsโ€‹

The tools come from the writable store. Which ones the agent gets depends on what that store supports:

ToolPurposeStores
save_memorySave a new factAll
update_memoryReplace a saved memory by its idAll except tag_notes
read_memoryRead a memory's full content by its idsearchable_memory_notes
search_memorySearch saved memories by relevance (knn, keyword, or mixed, the default)searchable_memory_notes

List and Enable Storesโ€‹

za agents capabilities memory-stores list
za agents capabilities memory-stores configure <store-name>

Configure Provider Settingsโ€‹

za agents capabilities memory-stores settings
SettingTypeDefaultDescription
inject_contextbooltrueLoad saved memories into the system prompt each turn
memory_context_strategystr"full"How saved memories are loaded into the prompt: "full" or "recent" (see Memory Context Strategy)
provide_toolsbooltrueExpose the writable store's memory tools to the agent
writable_sourcestr or nullnullWhich store to write to (e.g. "tag_notes", "memory_notes", "searchable_memory_notes", "file", "in_memory"); when null, the first enabled store
read_instructionsstr or nullnullOverride the default memory injection preamble
write_instructionsstr or nullnullAppend domain-specific policy for when/how the agent should save (see Custom Memory Policy)

Memory Storesโ€‹

StoreCLI nameDefaultDescription
Tag Notestag-notesdisabledProduction: memories stored per user in the platform
Memory Notesmemory-notesdisabledPlatform-managed notes with scope filtering
Searchable Memory Notessearchable-memory-notesdisabledPlatform-managed notes the agent can search and cite
FilefiledisabledDevelopment: JSON file on disk
In-Memoryin-memorydisabledTesting only: lost on restart

Tag Notesโ€‹

Stores memories as notes attached to a platform tag. Best for production deployments: memories are per user and persist across sessions.

za agents capabilities memory-stores configure tag-notes

Configurationโ€‹

SettingTypeDefaultDescription
tag_idstr or nullnullSpecific tag to attach memories to; when null, uses the user's favorites tag
use_favoritesboolfalseUse the user's favorites tag as the memory store

Memory Notesโ€‹

Platform-managed memory notes with scope-based access control. Multiple scopes allow separating personal notes from shared ones.

za agents capabilities memory-stores configure memory-notes

Configurationโ€‹

SettingTypeDefaultDescription
include_scopeslist[str]["own"]Which scopes to read from: "own", "shared_with_me"

Searchable Memory Notesโ€‹

Memory notes backed by the search index. On top of save_memory and update_memory, the agent gets search_memory and read_memory, so it can find memories that were not preloaded into the prompt. Search results are snippets; read_memory returns the full content. Each memory carries a source_url (/notes/{id}), which makes it citable.

za agents capabilities memory-stores configure searchable-memory-notes

Configured under searchable_memory_note_memory_store_configuration:

SettingTypeDefaultDescription
enabledboolfalseEnable the store
include_scopeslist[str]["own"]Which scopes to read from: "own", "shared_with_me"
max_preloaded_memoriesint100Most recent memories loaded into the prompt under the full strategy
frontmatter_enabledbooltrueRecord the chats a memory was created and edited from in a YAML frontmatter block (memory_origins); the agent never sees it
search_id_fieldstr"custom_metadata.metadata.identifier"Index field holding the memory id
search_snippet_fieldstr"highlight"Index field returned as the search snippet
search_created_at_fieldstr"custom_metadata.metadata.created"Index field holding the creation date

Fileโ€‹

Stores memories in a JSON file on disk. Useful during development: memories survive restarts but aren't tied to a platform user.

za agents capabilities memory-stores configure file

Configurationโ€‹

SettingTypeDefaultDescription
file_pathstr or nullnullPath to the JSON file; when null, uses a default location

In-Memoryโ€‹

Holds memories in process memory. Lost on restart, so useful only for testing.

za agents capabilities memory-stores configure in-memory

No additional configuration beyond enabled.


Memory Context Strategyโ€‹

memory_context_strategy picks how saved memories enter the system prompt when inject_context is true:

StrategyBehaviour
fullLoads every memory each store returns. searchable_memory_notes caps this at max_preloaded_memories.
recentLoads the most recent memories per store, sized by recent_memory_context_strategy_configuration.size (default 10). When more are saved, the prompt says how many are hidden and, with a searchable store, tells the agent to search before assuming it doesn't know. tag_notes does not support it.
{
"memory_provider_configuration": {
"enabled": true,
"memory_context_strategy": "recent"
},
"recent_memory_context_strategy_configuration": {"size": 20}
}

Memory Citationsโ€‹

To have the agent cite the memories its answer relies on, add memories to the citable resources of the citation instructions:

{
"citation_instruction_source_configuration": {
"enabled": true,
"citable_resources": ["search_results", "memories"]
}
}

The agent cites recalled memories and search_memory results in the [[N]](source_url "extract") form. Only searchable_memory_notes gives memories a source_url.

What the Agent Remembersโ€‹

The agent applies a signal gate: it only saves facts genuinely valuable for future sessions:

  • User identity and role
  • Stated preferences ("I prefer bullet-point answers")
  • Corrections and recurring conventions
  • Project decisions

It skips transient task progress, raw data, and information the user wouldn't want persisted.

Custom Memory Policyโ€‹

Add domain-specific guidance via the write_instructions setting:

za agents capabilities memory-stores settings

When prompted for write_instructions, provide your policy:

Never save credentials or API keys. Summarize project decisions concisely. When in doubt, ask the user before saving.