Capture, reuse, and runtime binding of values in ABS sessions.
Variables let you write a session once and run it with many different concrete values. They also allow later Behaviors to reference data captured from earlier ones.
Use capture: on any Behavior to name a value you want to save:
- actor: assistant
action: calls
target: Order MCP
capture:
order_id: "{{response.body.id}}"
The capture key (order_id) becomes available as {{order_id}} for all subsequent Behaviors in the same Session.
- actor: assistant
action: informs
content: "Your order {{order_id}} is on the way."
Values can also be provided at execution time — via dataset row, CLI flag, or environment variable:
abslang run session.abs.yaml --var user_name="Alice"
session: Greeting
behaviors:
- actor: user
action: says
content: "Hi, I'm {{user_name}}"
When resolving {{variable}}, implementations MUST follow this precedence:
capture: of that name in the same Session.Placeholders without runtime bindings are a feature, not a bug. A session with {{user_name}} is a template — it describes the shape of an interaction without committing to concrete values. The same session can be run against a dataset of 100 user names, or with a different value each time via CLI.