Skip to main content
0 reactions

Rasa Tutorial — Part 2: Create Your First Mantle Agent

A designed card reading Rasa Tutorial, Part 2: Create Your First Mantle Agent, with a chat window illustration and two labels: Claude Sonnet 5.5, and rasa init, train and inspect.
Rasa Tutorial — Part 2: Create Your First Mantle Agent

In this part of the Rasa Tutorial, you create your first AI agent with Rasa Pro’s Mantle engine, connect it to Claude, and chat with it in your browser. You’ll run Rasa’s setup wizard, change one file and run two commands.

By the end, you’ll have a working demo agent in your my-rasa-agent folder. It answers in the Rasa Inspector, a chat page that also shows what the agent did behind each reply.

This is Part 2 of the Rasa Tutorial. The parts in Module A, Start Here:

All parts of the Rasa Tutorial

Module A: Start Here

Module B: Building Skills

Module C: Progressive Control

  • Part 8: Tool Constraints
  • Part 9: Scoped Instructions
  • Part 10: Ordered Blocks
  • Part 11: Sub-skills and Composition

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

Module F: Testing

  • Part 20: Simulate and Evaluate Your Agent
  • Part 21: Scenarios and Assertions
  • Part 22: Build Faster with the Rasa Copilot

Module G: Voice

  • Part 23: Talk to Your Agent in the Browser
  • Part 24: Designing for Voice
  • Part 25: Connect a Phone Line
  • Part 26: Test and Monitor Voice

Module H: Channels

  • Part 27: The REST Channel and a Website Chat Widget
  • Part 28: Microsoft Teams

Module I: Observability

  • Part 29: Tracing with Langfuse
  • Part 30: Metrics and Conversation Events

Module J: Deploy

  • Part 31: Run Your Agent with Docker
  • Part 32: CI/CD for a Rasa Agent
  • Part 33: Deploy to Kubernetes with Rasa’s Helm Chart
  • Part 34: Load Testing
  • Part 35: Deploy on AWS
  • Part 36: Deploy on Azure
  • Part 37: Deploy on Google Cloud

Module K: Rasa Studio

  • Part 38: Rasa Studio with a Mantle Agent

Module L: Wrap-up

  • Part 39: 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 (opens in a new tab)). In this part, each message you send makes three calls to Claude. Every Claude call I made for this part cost $0.05 in total, as shown on the Cost page of the Claude Console.

Prerequisites

Step 1: Add Your Claude API Key

Open Terminal, go to your project folder and turn on its virtual environment:

TerminalBash
cd my-rasa-agent
source .venv/bin/activate

Your prompt now starts with (my-rasa-agent), so every rasa command uses the Rasa Pro you installed in this folder.

Your agent needs an LLM to think with, and this series uses Claude. If you don’t have a Claude API key yet, How to Get a Claude API Key (opens in a new tab) shows how to create one in the Claude Console.

Add the key to the .env file, under your Rasa licence key. Replace YOUR_CLAUDE_API_KEY with your key:

TerminalBash
echo 'ANTHROPIC_API_KEY=YOUR_CLAUDE_API_KEY' >> .env

>> adds a line to the end of the file. A single > would replace the file and delete your licence key. ANTHROPIC_API_KEY is the name Rasa’s docs use for Claude’s key; Anthropic is the company that makes Claude.

Step 2: Create Your Mantle Agent with the Setup Wizard

Rasa’s setup wizard creates a starter agent in the current folder:

TerminalBash
rasa init --engine mantle

rasa init creates a new project, and --engine mantle picks Mantle, Rasa’s LLM-native engine. Mantle is in beta, so Rasa commands print a warning that it’s experimental.

The wizard asks three questions. Answer them like this:

  1. Please enter a path where the project will be created: press Enter to use the current folder.
  2. Enter your OpenAI API key: press Enter. The wizard only asks for an OpenAI key, and this series uses Claude instead. It asks three times, so press Enter each time.
  3. Validate and train your agent now? Type n. The new agent is set up for OpenAI, so you’ll switch it to Claude before training it.

The wizard found your licence key in .env by itself. Here’s what it printed:

Output (the lines that matter)Plain text
Welcome to Rasa! 🤖
? Please enter a path where the project will be created [default: current directory]
Created project directory at '/Users/user/my-rasa-agent'.

Setting up your Mantle agent...
2026-11-18 23:30:59 WARNING  rasa.utils.beta  - Mantle is currently experimental and under active development 🔬.
Reusing RASA_LICENSE from your environment.
Enter your OpenAI API key (input hidden):
OpenAI API key cannot be empty.
Enter your OpenAI API key (input hidden):
OpenAI API key cannot be empty.
Enter your OpenAI API key (input hidden):
OpenAI API key cannot be empty.
No OpenAI API key provided; its entry in .env will be blank.
Wrote secrets to /Users/user/my-rasa-agent/.env (permissions 0600).
Installing agent skills...
Registered the Rasa MCP server for Claude Code, Cursor.
Downloading Mantle documentation for your coding agent...
? Validate and train your agent now? No
Skipping validation and training.
Ok 👍🏼. You can train and inspect your agent any time by running 'rasa train' and 'rasa inspect' inside the project directory.

Besides your agent, the wizard set up helpers for two AI coding assistants, Claude Code and Cursor: Rasa’s agent skills, a connection to Rasa’s tools, and a copy of the Mantle docs. You don’t need them for this series.

Step 3: Look Around Your Agent’s Project

Your folder now holds a complete agent. These are the files you’ll work with:

Project folderPlain text
my-rasa-agent/
├── agent.yml
├── integrations.yml
├── AGENTS.md
├── .env
└── skills/
    └── view_transactions/
        ├── skill.md
        ├── memory.yml
        └── tools.py
FileWhat it holds
agent.ymlThe agent itself: its language, its persona (how it talks), the model group it uses and its global rules.
integrations.ymlThe LLM the agent calls, and the channels it talks on.
skills/view_transactions/skill.mdOne skill: what it does, when to use it, and its instructions in plain English.
skills/view_transactions/memory.ymlWhat the skill remembers during a conversation, such as the account the user picked.
skills/view_transactions/tools.pyPython functions the skill can call. Here they return made-up demo accounts and transactions.
AGENTS.mdNotes about the project for AI coding assistants.
.envYour keys. Never share it.

The starter is a small banking agent that shows recent transactions. The later parts of this series go through each of these files.

Step 4: Switch Your Agent to Claude

The agent’s LLM is set in integrations.yml. Open it in a text editor, such as TextEdit or VS Code. The wizard set it to OpenAI:

integrations.yml (excerpt)YAML
model_groups:
  - id: main_model
    models:
      - provider: openai
        model: gpt-5.2
        api_key: ${OPENAI_API_KEY}

Change the three lines under models: so the block reads:

integrations.yml (excerpt)YAML
model_groups:
  - id: main_model
    models:
      - provider: anthropic
        model: claude-sonnet-5-5
        api_key: ${ANTHROPIC_API_KEY}
  • provider: anthropic sends the agent’s requests to Claude.
  • model: claude-sonnet-5-5 picks Claude Sonnet 5.5. You’ll find every model name on Claude’s models overview (opens in a new tab).
  • api_key: ${ANTHROPIC_API_KEY} reads your key from .env, so the key itself never sits in this file.
  • id: main_model names this model group. agent.yml uses that name to pick the LLM for the agent.

Save the file. Here’s the complete integrations.yml. The channels section turns on the REST channel, for apps that talk to your agent, and the Inspector. The commented lines at the end show how to connect remote tools, which a later part covers.

integrations.ymlYAML
# External integrations for your Mantle agent.
# The orchestrator names its group in agent.yml (`orchestrator.model_group`).

model_groups:
  - id: main_model
    models:
      - provider: anthropic
        model: claude-sonnet-5-5
        api_key: ${ANTHROPIC_API_KEY}

channels:
  rest:
    enabled: true
  inspector:
    enabled: true

# Optional — remote MCP tools (uncomment and set MCP_BANKING_TOKEN).
# Import a tool in skill.md with: import_tools: [mcp/banking:get_balance]
#
# mcp_servers:
#   - name: banking
#     url: http://localhost:8000/mcp/
#     token: ${MCP_BANKING_TOKEN}
#     # tool_timeout: 30
#     # meta_map:
#     #   static:
#     #     source: "rasa_agent"
#     #   from_memory:
#     #     - field: user_id
#     #       param: user_id

Advertisement

Step 5: Train Your Agent

TerminalBash
rasa train

rasa train checks your agent’s files and packs them into a model file in a new models folder. It took about 10 seconds:

Output (the lines that matter)Plain text
2026-11-18 23:32:09 WARNING  rasa.mantle.config.agent_spec  - [warning  ] The agent config '/Users/user/my-rasa-agent/agent.yml' is missing a unique value for 'agent.id'. Proceeding with generated id '20261118-233209-ragged-rating' and overwriting 'agent.id' in the file.
2026-11-18 23:32:09 INFO     rasa.mantle.model_archive.snapshot  - [info     ] Mantle model package saved at 'models/20261118-233209-either-halibut.tar.gz'.

The first time, Rasa warns that agent.yml has no agent.id and adds one for you, so the warning doesn’t come back (here’s how to set your own id). The last line names your trained agent.

Step 6: Chat with Your Agent in the Rasa Inspector

TerminalBash
rasa inspect

rasa inspect starts your agent on your computer and opens the Rasa Inspector in your browser. It was ready after about 15 seconds:

Output (the lines that matter)Plain text
2026-11-18 23:33:45 INFO     root  - Rasa server is up and running.
Development inspector for channel inspector is running. To inspect conversations, visit http://localhost:5005/webhooks/inspector/inspect.html?projectUrl=http%3A%2F%2Flocalhost%3A5005&channel=inspector

The log also shows a few WARNING lines, for example that Rasa doesn’t recognise the name claude-sonnet-5-5 when it estimates prompt sizes (why that one is harmless). They don’t stop your agent. If the browser doesn’t open, copy the address from the last line into it.

Claude writes the agent’s greeting:

The Rasa Inspector in Preview mode right after it opens: a new session banner and the agent’s greeting, which offers to show recent transactions on a checking or savings account.
The Inspector opens with the agent’s greeting.

Type Show my recent transactions and press Enter. The agent lists two demo accounts and asks which one you want. Type Everyday Checking, and it shows that account’s transactions:

A conversation in the Rasa Inspector: the user asks to see recent transactions, the agent lists two demo accounts, the user picks Everyday Checking, and the agent replies with four transactions in a Markdown table shown as plain text.
The starter agent lists the demo accounts, then shows the transactions.

Claude formats some replies with Markdown, such as ** around names and a table made of | characters. The Inspector shows those characters as they are.

Now click Inspect at the top of the page. Inspect mode shows what happened behind each reply:

The Rasa Inspector in Inspect mode: the conversation with each LLM call to claude-sonnet-5-5 and each tool call on the left, the active View Transactions skill and its instructions in the middle, and the skill history and memory on the right.
Inspect mode shows each Claude call, each tool call, the active skill and its memory.
  • Left: the conversation, with every LLM call to claude-sonnet-5-5 and how long it took, and every tool call, such as get_recent_transactions. Click one to see its details.
  • Middle: the active skill, View Transactions, with the instructions from its skill.md.
  • Right: the skills used so far, and the agent’s memory, which now holds the account you picked.

When you’re done, go back to Terminal and press Ctrl+C to stop the agent.

Clean Up

If the agent is still running, press Ctrl+C in Terminal to stop it. Claude charges only when your agent calls it, so a stopped agent costs nothing. Keep the my-rasa-agent folder: the next part builds on it.

Common Mistakes

MistakeDo this instead
Adding the Claude key with > instead of >>> replaces .env and deletes your licence key. Add the licence line back with >>.
Answering Yes to “Validate and train your agent now?”Answer No, switch integrations.yml to Claude, then run rasa train.
Pasting your Claude key into integrations.ymlKeep the key in .env. integrations.yml only names it with ${ANTHROPIC_API_KEY}.
Changing a skill or agent.yml without training againRun rasa train, then rasa inspect, so the Inspector uses your changes.
Opening a new Terminal window and running rasa straight awayRun source .venv/bin/activate in the project folder first.

Troubleshooting

ProblemFix
zsh: command not found: rasaTurn on the virtual environment: source .venv/bin/activate.
Unknown model name 'claude-sonnet-5-5', using 'cl100k_base' encoding as fallbackHarmless. Rasa estimates prompt sizes with a tokenizer that doesn’t know Claude’s model names, so it uses a general one. Here’s why.
missing a unique value for 'agent.id' on the first rasa trainHarmless. Rasa adds an id to agent.yml, so it appears only once. Set your own id.
Replies show ** and | charactersThat’s Markdown. The Inspector shows it as plain text.
The browser doesn’t openCopy the address that rasa inspect prints into your browser.

FAQ

Do I need an OpenAI API key?

No. The wizard asks for one, but this series uses Claude. Leaving it empty adds a blank OPENAI_API_KEY= line to .env, which does no harm.

Can I use a different Claude model?

Yes. Change model: in integrations.yml, for example to claude-opus-5-5 (Claude Opus 5.5, $4 and $20 per million input and output tokens) or claude-haiku-5-5 (Claude Haiku 5.5, $0.10 and $0.50). Then start rasa inspect again.

What are the .claude and .cursor folders?

Hidden folders the wizard made for the AI coding assistants Claude Code and Cursor. Your agent doesn’t use them.

Where are my conversations saved?

By default, only in the agent’s memory, so they’re gone when you stop it. To keep them, set a tracker store, such as SQL or Redis, in the tracker_store section of integrations.yml (integrations.yml reference (opens in a new tab)).

Is Mantle ready for production?

Not yet. Mantle is in beta and may change, which is why Rasa commands say it’s experimental.

Conclusion

You created a Mantle agent with Rasa’s setup wizard, switched it to Claude Sonnet 5.5, trained it and chatted with it in the Rasa Inspector, where you saw each Claude call and tool call behind its replies. In the next part, you’ll write a skill’s instructions yourself.

← Previous: Installing Rasa Pro: Setting Up Your Development Environment

Next → Part 3: Write a Skill’s Instructions

Additional Resources

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.

0 comments