Archival Memory
What is archival memory?
Section titled “What is archival memory?”Archival memory is a semantically searchable database where agents store facts, knowledge, and information for long-term retrieval. Unlike memory blocks that are always visible, archival memory is queried on-demand when relevant.
Key characteristics:
- Agent-immutable - Agents cannot easily modify or delete archival memories (though developers can via SDK)
- Unlimited storage - No practical size limits
- Semantic search - Find information by meaning, not exact keywords
- Tagged organization - Agents can categorize memories with tags
Best for: Event descriptions, reports, articles, historical records, and reference material that doesn’t change frequently.
When to use archival memory
Section titled “When to use archival memory”Use archival memory for:
- Document repositories (API docs, technical guides, research papers)
- Conversation logs beyond the context window
- Customer interaction history and support tickets
- Reports, articles, and written content
- Code examples and technical references
- Training materials and educational content
- User research data and feedback
- Historical records and event logs
Don’t use archival memory for:
- Information that should always be visible → Use memory blocks
- Frequently changing state → Use memory blocks
- Current working memory → Use scratchpad blocks
- Information that needs frequent modification → Use memory blocks
How agents interact with archival memory
Section titled “How agents interact with archival memory”Agents have two primary tools for archival memory: archival_memory_insert and archival_memory_search.
Inserting information
Section titled “Inserting information”Agents can insert memories during conversations using the archival_memory_insert tool:
# What the agent does (agent tool call)archival_memory_insert( content="Deckard retired six replicants in the off-world colonies before returning to Los Angeles", tags=["replicant", "history", "retirement"])Developers can also insert programmatically via the SDK:
await client.agents.passages.insert(agent.id, { content: "The Tyrell Corporation's motto: 'More human than human'", tags: ["company", "motto", "tyrell"],});client.agents.passages.insert( agent_id=agent.id, content="The Tyrell Corporation's motto: 'More human than human'", tags=["company", "motto", "tyrell"])Searching for information
Section titled “Searching for information”Agents can search semantically using the archival_memory_search tool:
# What the agent does (agent tool call)results = archival_memory_search( query="replicant lifespan", tags=["technical"], # Optional: filter by tags page=0)Developers can also search programmatically via the SDK:
const results = await client.agents.passages.search(agent.id, { query: "replicant lifespan", tags: ["technical"], page: 0,});results = client.agents.passages.search( agent_id=agent.id, query="replicant lifespan", tags=["technical"], page=0)Results return semantically relevant information - meaning the search understands concepts and meaning, not just exact keywords. For example, searching for “artificial memories” will find “implanted memories” even though the exact words don’t match.
Learn more about search and querying →
Real-world examples
Section titled “Real-world examples”Example 1: Personal knowledge manager
Section titled “Example 1: Personal knowledge manager”An agent with 30k+ archival memories tracking:
- Personal preferences and history
- Technical learnings and insights
- Article summaries and research notes
- Conversation highlights
Example 2: Social media agent
Section titled “Example 2: Social media agent”An agent with 32k+ memories tracking interactions:
- User preferences and conversation history
- Common topics and interests
- Interaction patterns and communication styles
- Tags by user, topic, and interaction type
Example 3: Customer support agent
Section titled “Example 3: Customer support agent”- Stores ticket resolutions and common issues
- Tags by product, issue type, priority
- Searches archival for similar past issues
- Learns from successful resolutions over time
Example 4: Research assistant
Section titled “Example 4: Research assistant”- Stores paper summaries with key findings
- Tags by topic, methodology, author
- Cross-references related research
- Builds a semantic knowledge graph