Skip to main content
Back to how-to guides Use this pattern when customers give several details in one message, in any order, and the agent must capture them all and ask only for what is missing.

Concept

Collection works on all missing fields at once, not one at a time. When the customer says “Boston to Denver next Friday”, one extraction pass can fill the origin, destination, and date. The agent then asks only for what is still empty. Three settings shape how well this works. You have three ways to collect several fields.

Minimal working example

A flight search agent collects the origin, destination, and date. The customer can give them in any order. The agent calls the search tool when the required fields are complete. The search tool is a project-local assumption. Bind it to your flight search service in Project Tools. agents/flight-search-agent.agent.abl
Variable sources:
  • origin, destination, depart_date, and passengers are GATHER fields. The customer supplies them, in any order.
  • The tool reads origin, destination, and depart_date from the collected values.

How it works

Without inline_gather (the default):
  1. Before the model replies, the runtime makes one extraction call for all missing fields.
  2. It validates and stores the good values.
  3. The model sees what is collected and asks for the rest. It chooses the order of the questions.
With inline_gather: true:
  1. The model receives an _extract_entities tool built from the active fields. It calls the tool in the same turn, in parallel with domain tools.
  2. The prompt shows “Already collected” and “Still needed” lists.
  3. The separate extraction pass is skipped.
  4. Until the required fields are complete, the runtime removes domain tools from the model. Handoff, delegate, internal, and _extract_entities tools stay. A domain tool call that gets through returns GATHER_INCOMPLETE with the missing field names.
  5. If the model never calls _extract_entities, a fallback extraction runs after the reply. It helps the next turn.
Rules that apply:
  • A supervisor that routes with a model tool does not offer the extraction tool. It carries inferred values in the routing context instead.
  • On voice channels with the voice latency profile, inline_gather is on by default. An explicit false turns it off. Write true and false in lowercase. True or yes reads as false.
  • extraction_hints appear in the tool description as “(hints: …)”. They do not change the question.
  • description falls back to prompt when you omit it.
  • Field order is declaration order. There is no scheduling. Put the most important fields first.

Common variations

One combined question in a FLOW step

A FLOW step asks for all missing fields in one question. Set PRESENT for the introduction and PROMPT for the question. Use {{_missingList}} for the missing field names. Set CORRECTIONS: true so the customer can fix a value. Set MAX_ATTEMPTS and ON_EXHAUSTED to hand off. agents/beneficiary-setup.agent.abl
Because the field prompts are noun phrases, such as “account number or IBAN”, they read well inside the combined question.

Capture a fixed-shape value with a pattern

Set extraction_pattern and extraction_group for a value such as a reference number. The pattern runs on the raw message and needs no model call. See Silently extract values without asking the user.

Pick the extraction engine

strategy sets the engine per field: auto, ml, llm, hybrid, or pattern. In a FLOW step, a block-level STRATEGY applies to the whole step. A field setting wins over the block, and the block wins over the project setting. An ml field does not fall back to llm. A pattern field with no extraction_pattern extracts only built-in email and phone values.

Verification

  1. Run the validator. Expect no errors and no warnings.
  2. Say “I need a flight from Boston to Denver next Friday”. Expect the agent to search without asking for the origin, destination, or date.
  3. Say “I need a flight to Denver”. Expect the agent to ask for the origin and the date.
  4. Give the missing values in one reply. Expect the search to run.
  5. In the beneficiary example, give the name and account in one message. Expect the country to stay empty and the flow to move on.
  6. In the trace, open the dsl_collect events. The mode is inline_gather, reasoning_gather, or gather. Check the extracted fields.
  7. When a tool call arrives too early, look for the GATHER_INCOMPLETE result.

Production readiness checklist

  • Each field has a description. Fields that are hard to extract have extraction_hints.
  • Each fixed-format field has a validate rule and a retry_prompt.
  • Required fields are first in the list.
  • inline_gather is set to a lowercase true or false on purpose.
  • Tools that need collected values are listed in the agent, with parameter descriptions.
  • Tests cover all values in one message, values in any order, a partial message, and a correction.

Common mistakes

Troubleshooting

Related articles: