Method 1 - Add LLM states to your agents via Dashboard

Step 1: Create an agent in Dashboard

Select “Stateful Multi-Prompt Agent”

Step 2: Provide a general prompt

Write the general prompt that will be shared among all states. Usually it will describe the tasks of the agent and its conversional style.

Step 3: Edit the multi-prompt tree

Click the tree to edit it.

Step 4: Create multiple states

In the tree editor, you can create multiple states. You can also create edges between states. Edges will define the criteria how to flow from one state to the other.

Step 5: Store call info as variable to pass to next state (Advanced)

You can pass information from one state to the next. For instance, in the example below, we extract the name from the first state’s transcript and pass it to the subsequent state, where it’s accessible using {{name}}.

Method 2 - Add LLM states to your agents via API

Here’s an example of creating a 2 state LLM of a hospital receptionist. The first state is information_collection and the second state is book_appointment.

You can see that here the first state focus on collecting medical information, and the second state focus on booking an appointment. They share distinct tool calling sets, and by separating them into different states, the prompt is a lot shorter and thus LLM can stick to it better.

Note the variables below like {{user_name}} is populated at call time, read more at Dynamic Variables