Every message you send to a Rasa agent goes through the same loop. Rasa’s framework acts first, Claude decides only what needs judgment, and one message can go round the loop several times. In this part of the Rasa Tutorial, you follow messages through the runtime loop of Rasa Pro’s Mantle engine, pass by pass, in the Rasa Inspector.
By the end, you’ll be able to read any turn of your agent: how many times Claude was called, what it was allowed to do each time, and what the framework did on its own. You don’t change any files in this part.
This is Part 12 of the Rasa Tutorial. The parts in Module D, Orchestration:
- Part 12: The Runtime Loop: How Mantle Handles a Turn (you are here)
- Part 13: Guarantees and Guardrails
- Part 14: Skills and Routing
- Part 15: Context Management
All parts of the Rasa Tutorial
Module A: Start Here
Module B: Building Skills
- Part 3: Write a Skill’s Instructions
- Part 4: Tools: Let Your Agent Run Python
- Part 5: Memory: Remember What Matters
- Part 6: References: Answer from Your Documents
- Part 7: Responses: Control the Exact Wording
Module C: Progressive Control
- Part 8: Tool Constraints: Make Your Agent Ask Before It Acts
- Part 9: Scoped Instructions: Show Claude Only the Rules That Apply
- Part 10: Ordered Blocks: Run Steps in a Fixed Order
- Part 11: Sub-skills: Reuse One Skill Inside Another
Module D: Orchestration
- Part 12: The Runtime Loop: How Mantle Handles a Turn
- Part 13: Guarantees and Guardrails
- Part 14: Skills and Routing
- Part 15: Context Management
Module E: Agent Setup
- Part 16: agent.yml: Identity, Persona and Rules
- Part 17: integrations.yml: Claude, Model Groups and Routing
- Part 18: MCP Tools
- Part 19: Hooks
- Part 20: Build Faster with the Rasa Copilot
Module F: Voice
- Part 21: Talk to Your Agent in the Browser
- Part 22: Designing for Voice
- Part 23: Connect a Phone Line
- Part 24: Monitor Voice Calls
Module G: Channels
- Part 25: The REST Channel and a Website Chat Widget
- Part 26: Microsoft Teams
Module H: Observability
- Part 27: Tracing with Langfuse
- Part 28: Metrics and Conversation Events
Module I: Deploy
- Part 29: Run Your Agent with Docker
- Part 30: CI/CD for a Rasa Agent
- Part 31: Deploy to Kubernetes with Rasa’s Helm Chart
- Part 32: Deploy on AWS
- Part 33: Deploy on Azure
- Part 34: Deploy on Google Cloud
Module J: Rasa Studio
- Part 35: Rasa Studio with a Mantle Agent
Module K: Wrap-up
- Part 36: Final Project, Cheat Sheet and What to Learn Next
Cost: Rasa’s Developer Edition licence is free. Claude is pay-per-use: Claude Sonnet 5.5, the model this series uses, costs $2 per million input tokens and $10 per million output tokens (Claude pricing). In this part you send four messages, which make six calls to Claude: about $0.04. That’s an estimate: in Part 2, eight calls cost $0.05 on the Claude Console.
Prerequisites
- The
my-rasa-agentproject from Part 11: Sub-skills: Reuse One Skill Inside Another.
How the Runtime Loop Works
Rasa’s Runtime Loop page describes what Mantle does each time a message arrives. The framework is Rasa’s own code, and Claude is the LLM your agent calls:
- The framework acts first. It runs everything that’s already decided, such as the next steps of an ordered block, without calling Claude. It also decides what Claude may do next: which skills it can start and which tools it can call.
- It builds a focused prompt from the active skill’s instructions, the tools allowed right now and the memory that matters.
- It calls Claude. Claude replies, calls a tool or starts a skill, but only from what the framework allowed.
- A tool call goes back through the framework. Rasa checks the tool’s constraints, runs it, and goes round the loop again from step 1.
One message can go round the loop several times: call a tool, read its result, then reply. In this part, each time round the loop is a pass.
Step 1: Start Your Agent
Open Terminal, go to your project folder and turn on its virtual environment:
Terminal
cd my-rasa-agent
source .venv/bin/activate
Start your agent with the Rasa Inspector:
Terminal
rasa inspect
When it’s ready, the Inspector opens in your browser with an empty chat. Keep Terminal open: you’ll come back to it in Step 4.
Step 2: Ask a Question That Needs a Tool
In the Inspector, type Is there a branch in Riverton? and press Enter. The agent lists both Riverton branches:
To answer, the agent had to start the Find a Branch skill and run its find_branches tool. Next, see how many passes that took.
Step 3: Follow the Turn in Inspect Mode
Click the Inspector mode button at the top of the chat, the one with three sliders, and choose Inspect. Under your message, the Inspector lists everything that happened in that turn:
Each LLM call is one pass that called Claude. Your one message took three:
- Pass 1: no skill was running, so Claude started one. Find a Branch skill activated shows its choice.
- Pass 2: with Find a Branch running, Claude asked for the skill’s tool. Tool call: find_branches is Rasa running it. Then the loop went round again.
- Pass 3: Claude read the tool’s result and replied in text, so the turn ended: Agent turn ended.
Click the first LLM call. Its Tools list is everything the framework let Claude do in that pass, and the highlighted one is what Claude chose:
With no skill running, Claude could only start a skill (activate), search your documents from Part 6 (search_knowledge) or wait without replying (listen). Now click the second LLM call:
Find a Branch was running, so the framework added its tools: complete and cancel to end the skill, set_memory, and find_branches, which Claude called. Scroll down to its Prompt: it now holds Find a Branch’s instructions too. That’s step 2 of the loop: each pass gets a prompt built for what’s running at that moment.
Step 4: Read the Turn in Terminal
Go back to Terminal. Among its log lines, Rasa writes one line when a turn starts and one when it ends:
Output (the lines that matter)
2026-11-27 11:49:32 INFO rasa.mantle.orchestration.orchestrator - [info ] mantle.turn.started active_flow=None conversation_id=00000000-0000-0000-0000-000000000000 stack_depth=0
2026-11-27 11:49:37 INFO rasa.mantle.orchestration.orchestrator - [info ] mantle.turn.completed conversation_id=00000000-0000-0000-0000-000000000000 error=None iteration_count=3 source=llm_text
active_flow=None: no skill was running when your message arrived.source=llm_text: the turn ended on a text reply from Claude.iteration_countis Rasa’s own loop counter for the turn. Rasa stops a turn when it reaches 20, so a turn can’t loop forever.
Above these lines, your first message also printed warnings: a WARNING that Rasa doesn’t recognise the name claude-sonnet-5-5 (why) and several UserWarning lines about the ReadOnly qualifier (why, and what to do). Neither stops your agent.
Step 5: Watch the Framework Act Without Claude
Click Restart conversation, the circular arrow at the top of the chat, to start a new conversation. Then send these three messages to the Lost or Stolen Card skill from Part 10, one at a time, waiting for each reply:
I lost my debit card4821Yes, freeze it
Each message made one LLM call. In Inspect mode, click the small arrow next to the last LLM call to show the events under it:
- The LLM call is Claude’s only job in this turn: it saved the customer’s yes, freeze_confirmed set to true.
- Everything below it is the framework, in the passes after it. The block’s freeze step ran the tool (Tool call: freeze_card, which saved the reference), and Rasa sent the fixed frozen message. Then it finished the block and the skill, started its built-in Completed skill and asked its fixed wrap-up question.
That’s step 1 of the loop at work: once Claude had saved the answer, every remaining step was already decided, so Rasa ran them all without calling Claude again. Terminal shows how this turn ended:
Output (the lines that matter)
2026-11-27 11:51:41 INFO rasa.mantle.orchestration.orchestrator - [info ] mantle.turn.started active_flow=lost_card__freeze_card conversation_id=00000000-0000-0000-0000-000000000000 stack_depth=2
2026-11-27 11:51:42 INFO rasa.mantle.orchestration.orchestrator - [info ] mantle.turn.completed conversation_id=00000000-0000-0000-0000-000000000000 error=None iteration_count=2 source=phase_response_wait
source=phase_response_wait means the turn ended on a message from the framework’s own steps, and the agent now waits for the customer. active_flow=lost_card__freeze_card is the Lost or Stolen Card skill’s freeze_card block, which was waiting for the yes when your message arrived.
Clean Up
Go back to Terminal and press Ctrl+C to stop the agent. Keep the my-rasa-agent folder: Part 13 builds on it.
Common Mistakes
| Mistake | Do this instead |
|---|---|
| Expecting one Claude call per message | Count the LLM calls in Inspect mode. The Riverton question took three, and the yes to the freeze took one. |
| Thinking Claude runs your tools | Claude only asks for a tool. Rasa checks the tool’s constraints and runs it, as Tool call: find_branches shows. |
| Looking for the passes in Preview mode | Choose Inspect from the Inspector mode menu. |
Taking the UserWarning lines for an error | They don’t stop your agent: it still answers. Why they appear. |
Troubleshooting
| Problem | Fix |
|---|---|
| The chat shows your messages but no LLM calls | You’re in Preview mode. Choose Inspect from the Inspector mode menu. |
The agent replies I'm sorry, but something went wrong. Please try again. | That’s Rasa’s reply when a turn can’t finish, for example after 20 passes or when the call to Claude fails. Look in Terminal for the error just above the turn’s last line. |
| You can’t find the turn lines in Terminal | They’re in the Terminal window that runs rasa inspect, among the other log lines. Press ⌘F and search for mantle.turn.completed. |
FAQ
Does every message cost one Claude call?
No. Claude is called once for each pass that needs a decision. In this part, the Riverton question made three calls, and each Lost or Stolen Card message made one. Steps the framework settles on its own, such as an ordered block’s fixed messages, make no call.
Can a turn loop forever?
No. Rasa Pro 3.22 stops a turn after 20 passes and sends “I’m sorry, but something went wrong. Please try again.”
When does a turn end?
When there’s nothing left for the agent to do until the customer writes again: Claude replied in text, as in Step 3, or a step asked a question that needs the customer’s answer, as the Lost or Stolen Card block did after your first two messages. Claude can also call listen to wait without sending a message. Rasa’s Execution loop reference lists every case.
What are the Session Start events at the top of the chat?
Rasa’s built-in Session Start skill sets up each new conversation without saying anything, so it makes no call to Claude. The Inspector starts it when a conversation begins (Start a conversation).
Conclusion
Every message runs through the same loop. The framework settles what it can, Claude decides the rest from a focused prompt and a short list of tools, and every tool call comes back through Rasa. In Inspect mode, each LLM call is one pass, so you can see exactly what Claude decided and what the framework did on its own.
← Previous: Part 11: Sub-skills: Reuse One Skill Inside Another
Coming next: Part 13: Guarantees and Guardrails.
Additional Resources
- The Runtime Loop (Rasa docs)
- Execution loop reference (Rasa docs)
- Context Management (Rasa docs)
- Builtin skills (Rasa docs)
- Tool Constraints (Rasa docs)
Related
- Rasa Tutorial — Part 11: Sub-skills: Reuse One Skill Inside Another
- Rasa Tutorial — Part 10: Ordered Blocks: Run Steps in a Fixed Order, where the Lost or Stolen Card skill comes from
- Rasa Tutorial — Part 4: Tools: Let Your Agent Run Python, where Find a Branch comes from
- Fixed: “Items ‘device_code’, ‘user_code’, ‘verification_uri’ on TypedDict class ‘_DeviceCode’ are using the ReadOnly qualifier” in Rasa Pro
- Rasa Tutorial for Beginners: Mastering Rasa Pro in Python, with every part of the series
Rasa, Claude and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by Rasa Technologies or Anthropic.
