Overview
Memory stores enable agents to retain, access, and manipulate information during conversations and across sessions. This provides context persistence and stateful behavior without external databases.Memory Types
Agentic Apps support two main types of memory: Session Meta Memory and Custom Memory Stores.Session Meta (Default)
A built-in, read-only store for session-specific data.- Scope: Single session
- Lifetime: Duration of the session
- Access: Read-only in prompts; writable via API
metadata: Contextual data passed via API (e.g., userId, channel, custom fields). Developers can update this field only via API.sessionInfo: System-populated object with the following fields:sessionId— Unique identifier for the sessionappId— Identifier of the applicationsessionReference— Reference string for tracking the sessionuserReference— Reference string associated with the useruserId— Unique identifier for the userrunId— Identifier for the specific execution runtimestamp— Date and time when session info was recorded
Note:sessionMetais read-only within code tools and cannot be updated or deleted programmatically. Themetadatafield can be updated via API only.
Custom Memory Stores
User-defined stores for persistent data.- Scope: Configurable (user, app, or session)
- Lifetime: Configurable retention
- Access: Read/write via code tools
Creating a Memory Store
Define custom memory stores in your agentic app configuration. Each store has a unique technical name and a JSON schema that defines the structure of the data it holds. Navigation: Go to Agentic app > Memory > Create new.Configuration Fields
| Field | Description |
|---|---|
| Name | User-friendly display name |
| Technical Name | Unique identifier for code/prompts (immutable after creation) |
| Description | Purpose documentation |
| Schema | JSON Schema defining data structure |
| Access Type | User, application, or session scope |
| Retention | Session, 1 day, 1 week, or 1 month |
| Require Strict Adherence | Enforce exact schema match; updates that don’t conform to the schema will fail |
Example Schema
Accessing Memory
In Prompts
Use the template syntax:In Code Tools (JavaScript)
Memory methods are async—use withawait:
In Code Tools (Python)
Memory methods are synchronous:In Function Nodes of Workflow Tools
Same syntax as code tools. Memory can be read, updated, or deleted using the Function Node within Workflow Tools.Session Meta Access
Reading Session Data
In Prompts
Passing Metadata via API
Access Scopes
| Scope | Description | Identifiers | Use Case |
|---|---|---|---|
| Session | Data for current session only | AppId + SessionId | Conversation context, multi-turn dialog state |
| User | Data persists across user sessions | AppId + UserId | Preferences, history |
| Application | Shared across all users | AppId | Global settings, counters |
Scope Selection
Choose based on data lifecycle:Retention Policies
| Policy | Duration | Use Case |
|---|---|---|
| Session | Until session ends | Temporary context |
| 1 Day | 24 hours | Short-term cache |
| 1 Week | 7 days | Recent activity |
| 1 Month | 30 days | User preferences |
File Attachments
When users upload files, metadata is stored insessionMeta.artifacts:
Supported File Types
| Format | Content Extraction | URL Access |
|---|---|---|
| PDF, DOCX, TXT, JSON | Yes | Yes |
| CSV, XLS, XLSX | No | Yes |
| PPT, PPTX, HTML | No | Yes |
| Images (PNG, JPG, GIF) | No | Yes |
Best Practices
Use Meaningful Technical Names
Define Clear Schemas
Schemas ensure data consistency:Handle Missing Data
Always check for existence:Clean Up When Done
Delete temporary data to free resources:Import/Export
Memory store configurations are included in app exports:- Schema definitions
- Access settings
- Retention policies