Skip to main content
Agents on the platform use two kinds of memory: session memory and persistent memory. Learn how to declare, access, and manage session variables, persistent memory, and set up auto-recall using the ABL Editor.

Key Concepts

Session Memory

Session variables hold data that is relevant only during a single conversation. They are created when the session starts and discarded when the session ends (unless RESET: never is specified).

Configure session variables in the UI

Open the agent, go to Capabilities > Memory in the left nav, and scroll to the SESSION VARIABLES section. Click + Add Variable to add a new session variable. Each variable has the following fields.

Declare session variables via ABL

Add a MEMORY: block with a session: section to your agent definition in the ABL editor.
Session Variable Properties Reset Behavior For simple tracking without type metadata, declare a bare name:
Fields with initial values and reset control:

Access session variables in response templates

Reference session variables by name inside {{ }} in RESPOND blocks.

Access session variables in step conditions

Use session variables in CHECK, constraint expressions, and ON_INPUT transition logic.

Troubleshooting

  • Variable is undefined in template. The variable has not been set yet in the current flow. Ensure the step that sets it executes before the step that reads it.
  • Variable resets unexpectedly. Check RESET. Variables with RESET: per_step clear at each step transition. Use per_session or never for longer-lived values.
  • Type mismatch at runtime. TYPE enables runtime validation. If you declare TYPE: number but assign a string, the runtime logs a warning. Coerce tool results and user inputs to the declared type.

Persistent Memory

Persistent variables are stored in the platform’s fact store and survive across sessions. Persistent memory fields are scoped to a user, a execution chain or an entire project.

Configure persistent variables from UI

Navigate to Memory > Persistent Paths. Persistent Paths: Use persistent paths when you want the agent to automatically preserve information without requiring a predefined schema. Examples:
Structured Persistent Paths: Structured Persistent Paths allow you to define persistent memory using a predefined structure or schema. Use structured persistent paths when you want to organize long-term memory into structured objects instead of individual dotted paths. Examples:
Read Access Paths: Stores fields as persistent memory paths with read access. Write Access Paths: Stores as persistent memory paths with write access. Use READS/WRITES for quick, intent-clear declarations of access-only paths without other metadata for the fields.

Declare persistent variables via ABL

Add a persistent: section under MEMORY:. Use dot-notation paths to name each variable and bind them to a scope.
Persistent Variable Properties

Scoping rules

Access Control

Restrict whether the agent can read, write, or both for each persistent path.

Access Persistent Variables in Expressions

Use the full dot-notation path within {{ }} to read persistent variables in SET expressions and RESPOND templates.

Troubleshooting

  • Persistent value is null on first session. The value has not been stored yet. Use DEFAULT to provide a fallback, or use COALESCE() in expressions.
  • Value not persisting across sessions. Ensure the value is written using a remember trigger or SET statement. Declaring a persistent path does not automatically populate it.
  • Wrong user sees another user’s data. Verify SCOPE: user is set. Project-scoped variables are shared. User-scoped variables require user authentication to resolve correctly.

Remember Triggers

Remember triggers write values to persistent memory when a condition evaluates to true during conversation. To configure a Remember trigger, provide the following fields:
  • When: Specifies the condition under which the trigger is executed and the memory value is stored.
  • Store Value: The value to be written to persistent memory when the trigger condition is met.
  • Store Target: The persistent memory field where the value will be stored.
  • TTL: The duration for which the stored value remains in memory. After the specified time elapses, the value is automatically deleted. This field is optional. If not specified, the value is retained indefinitely.
When user_name gets a value during the conversation (from a GATHER step, SET assignment, or tool result), the trigger fires and stores it to user.name. TTL: "90d" means the stored fact expires after 90 days. Remember Trigger Properties

Store computed values

Store a computed object instead of a raw variable value.

Recall

Recall automatically stores values into persistent memory when conditions are met, and loads stored facts back into the session at specific lifecycle events.

Add recall instructions

When a new session starts, the platform loads user.name, user.language, and user.preferred_agent from persistent memory and injects them into the session context. Recall Properties Recall Events Recall Actions

Recall before search operations

Load relevant user context before a knowledge base search executes.
This loads all facts tagged with the travel_preferences domain into the session, allowing the search to incorporate user preferences.

Inject recalled data as an LLM instruction

Instead of directly injecting variables, pass an instruction to the LLM on how to use the recalled information.

Combined remember and recall pattern

A complete pattern that stores user preferences during a conversation and recalls them at the start of future sessions.

Troubleshooting

  • Remember trigger never fires. The WHEN condition references a variable that is never set during conversation. Verify the variable name matches what your flow or tools produce.
  • Recalled value is stale. The fact may have expired (TTL elapsed). Check the TTL setting and extend it if needed.
  • Recall injects null values. The persistent path has not been written to yet. Use DEFAULT on the persistent variable declaration to provide a fallback.

Manipulate State: SET, CLEAR, and TRANSFORM

Use SET, CLEAR, and TRANSFORM directives in flow steps to assign values, remove variables, and reshape data arrays during execution.

SET a variable

Use SET in a flow step to assign a value to a session variable. The expression is resolved at execution time.
SET expressions support arithmetic, string interpolation, dot-notation access, and function calls. From tool results:
Nested objects using dot notation:
In ON_INPUT branches:

CLEAR a variable

Use CLEAR to remove one or more variables from the session. After a CLEAR, the variable is undefined and any template reference to it renders as empty.
In sub-intents — allow users to clear and re-enter specific fields:

TRANSFORM an array

Use TRANSFORM to filter, map, sort, and limit array data in a single pipeline. In the following example TRANSFORM creates a new array affordable_hotels without modifying the source array. Full pipeline:
Filter only:
Map only:

Troubleshooting

  • SET expression produces null. The right-hand variable may not be defined yet. Verify the data source (tool result, gathered field, or prior SET) runs before this step.
  • CLEAR does not reset a GATHER field. Clearing a variable removes it from the session, but the GATHER step may not re-prompt for it unless the step is re-entered. Use CLEAR within a SUB_INTENT or DIGRESSION that resumes the same step.
  • TRANSFORM produces empty array. The FILTER condition may be too strict, or the source array is empty. Check the source variable and filter expression.

Best Practices

  • Use meaningful variable names. Use names like user_preferences, order_history, or conversation_context. Avoid generic names like var1, data, or temp.
  • Use COALESCE() for persistent variables. Persistent paths may not be populated on a user’s first session. Use COALESCE(user.name, "valued customer") to provide a safe fallback.
  • Set defaults on persistent variables. Declare DEFAULT values so the agent behaves correctly before any data has been stored.
  • Use CLEAR within sub-intents to reset state. Clearing a variable removes it from the session, but a GATHER step only re-prompts when the step is re-entered. Pair CLEAR with a SUB_INTENT or DIGRESSION that resumes the same step.
  • Prefer per_session reset over never. Variables with RESET: never persist for the lifetime of the runtime process. Reserve this for counters or flags where cross-session accumulation is intentional.

Further Reading