Overview
Creating memories in Azen is straightforward: send text content to the API, and Azen handles encryption, storage, and vector embedding automatically.Creating a Memory
Prepare your content
Memory content can be any text: user preferences, conversation context, facts, or notes.
Basic Example
The
embedding field will show "processing" initially. Embedding typically completes within seconds.What Happens Behind the Scenes
When you create a memory, Azen performs several operations:Encryption
Your text is encrypted using AES-256-GCM with a unique IV and authentication tag before storage.
Database Storage
The encrypted content, IV, and tag are stored in Postgres. The plaintext never touches disk.
Embedding Job
A background job is queued in BullMQ to generate vector embeddings for semantic search.
Implementation Reference
Fromapps/api/src/routes/memory.ts:
Memory Content Guidelines
What to Store
✅ Good memory content:- User preferences: “Prefers dark mode”
- Conversation context: “Discussed AI ethics on March 5th”
- Personal facts: “Lives in San Francisco, works remotely”
- Behavioral patterns: “Usually asks about Python tutorials”
- Sensitive credentials (use a secrets manager)
- Large binary data (Azen is text-optimized)
- Rapidly changing data (use a cache instead)
- PII without user consent
Content Length
- Minimum: 1 character (enforced by validation)
- Maximum: No hard limit, but optimal performance under 2,000 characters
- Recommended: 50-500 characters per memory for best search results
Longer memories are automatically chunked during embedding to maintain search quality.
Batch Memory Creation
For creating multiple memories, make parallel requests:Error Handling
Invalid Request (400)
Missing or empty text:text field is present and non-empty.
Authentication Errors (401, 403)
See Authentication Guide for resolving auth issues.Rate Limited (429)
Server Error (500)
If memory creation fails:Checking Embedding Status
After creating a memory, check if embedding is complete:embedded field indicates whether the memory is ready for semantic search.
Usage Tracking
Memory creation is automatically tracked:- Each successful
POST /api/v1/memoryincrementsmemoryCountin usage metrics - Failed requests increment
errorCount - Tracking is per organization, per API key, per day
Next Steps
Search Memories
Find memories using semantic search
List Memories
Retrieve all memories with pagination
Encryption Details
Learn how memory encryption works
Semantic Search
Understand vector embeddings

