Overview
Memory in AXON defines semantic storage for AI agents—how information is stored, retrieved, and managed across executions. Unlike traditional databases, AXON memory is designed for semantic retrieval and knowledge persistence.Memory Definition
Syntax
Fields
store (optional)
Type: One of session, persistent, ephemeral
Defines the lifetime scope of the memory.
| Scope | Lifetime | Use Case |
|---|---|---|
ephemeral | Single flow execution | Temporary working memory |
session | Current session/conversation | Chat contexts, multi-turn interactions |
persistent | Permanent | User profiles, learned knowledge, historical data |
backend (optional)
Type: Identifier
Specifies the storage backend implementation.
| Backend | Characteristics | Best For |
|---|---|---|
vector_db | Semantic search, embeddings | Knowledge bases, semantic retrieval |
in_memory | Fast, volatile | Session state, temporary data |
redis | Distributed, fast, TTL support | Session management, caching |
postgres | Relational, structured | Structured data, relations |
s3 | Object storage, scalable | Large objects, archives |
custom | User-defined | Special requirements |
retrieval (optional)
Type: One of semantic, exact, hybrid
Defines the retrieval strategy for querying memory.
| Strategy | How It Works | Use Case |
|---|---|---|
semantic | Embedding similarity, vector search | Natural language queries, fuzzy matching |
exact | Key-value lookup, exact match | IDs, structured keys, fast lookup |
hybrid | Combine semantic + exact | Best of both: semantic + structured |
decay (optional)
Type: Duration or policy identifier
Defines how memory degrades or expires over time.
| Type | Example | Behavior |
|---|---|---|
none | decay: none | Never expires |
| Duration | decay: 7d | Expires after duration |
daily | decay: daily | Daily cleanup |
weekly | decay: weekly | Weekly cleanup |
monthly | decay: monthly | Monthly cleanup |
Complete Examples
Conversation Memory
Knowledge Base
User Profile Store
Temporary Working Memory
Recent Activity Cache
Memory Operations
Remember (Store)
Syntax:Recall (Retrieve)
Syntax:Combining Remember and Recall
Memory with Context
Combine memory definitions with context for execution control:Best Practices
1. Match Memory Scope to Use Case
2. Use Appropriate Backends
3. Set Appropriate Decay Policies
4. Choose Retrieval Strategy Wisely
5. Clean Up Memory
Common Patterns
Conversation Context
Knowledge Accumulation
Multi-Source Retrieval
Learning System
Type Checking
The AXON type checker validates: ✅ Store scope: Must be valid scope (session, persistent, ephemeral)✅ Retrieval strategy: Must be valid strategy (
semantic, exact, hybrid)✅ Memory references: Referenced memories must exist
