Skip to content

tutorial

Chapter 0 of 6

Tool Scope and Memory Scope in Rasa Mantle

by Rod Rivera Published

Decide where a tool belongs and where a memory field belongs — and build a bank agent that makes the caller verify exactly once.

You call your bank, prove who you are, and get transferred. The next department asks you to prove who you are all over again.

That is not a policy decision. It is an architecture leak: nothing is shared between the two systems, so the second one starts from nothing. The same leak shows up in agents, and Mantle gives you two tools for closing it — tool scope and memory scope.

This tutorial builds Sterling, a small Meridian Bank agent with three skills, and uses it to answer four questions:

  1. When should a tool be local to a skill, and when should it be global?
  2. What belongs in project memory rather than a skill’s own memory?
  3. What is the difference between public and private skill memory?
  4. What makes a skill folder portable to another agent?

What you will end up with

you  my passphrase is bluebird
bot  Welcome back, Dana Okafor. You are now signed in.

you  what is the balance on 10029384
bot  The balance on account 10029384 is 2418.55 GBP.

you  send 25 pounds to Sam Rivera
bot  To confirm, you want to send 25 pounds to Sam Rivera. Is that correct?

One passphrase. The balance and the transfer both run without re-verifying, because the authentication skill wrote the customer id into project memory and the other skills’ tools read it back.

The shape of the project

Sterling's three skills — authenticate, check_balance and transfer_money — each keep a local tool in their own folder, auto-discovered. One global tool, get_customer_info in tools/customer.py, is imported by bare name into the two skills that need it. verify_passphrase in the authenticate skill is the only writer of customer_id, and it writes with a bare name into project memory; all the readers use the qualified project.customer_id form. Each skill also has its own memory split into public and private, and a private field such as passphrase_attempts is readable only by its owning skill.

The asymmetry in those arrows is a real rule, not a drawing convention: you write with a bare name and read with a qualified one, and the qualified form on a write is rejected at train time.

IdeaWhere it lives
Local toolskills/<skill>/tools.py — auto-discovered
Global tooltools/<module>.py + import_tools: in the skill
Project memorymemory.yml at the project root
Skill memoryskills/<skill>/memory.yml, split public / private

Before you start

You need Python 3.11 or 3.12, uv, a Rasa Pro Developer Edition licence, and an OpenAI API key. The agent is text-only on purpose: the subject is architecture, not speech.

The companion project pins rasa-pro==3.20.0.dev6 (kept in sync with the catalog); the transcripts were captured on 3.20.0.dev1, earlier on the same release line.