Buyer-facing conversational AI assistants don’t function in a vacuum. They’re embedded inside well-defined enterprise processes. That’s why these programs are anticipated to reliably and constantly information customers by means of every step of a predetermined workflow.
Nevertheless, present agentic frameworks that leverage an idea of instrument calling or perform calling to work together with programs (resembling APIs or databases) typically fall in need of this objective. They lack the robustness, controllability, and built-in assist for advanced processes required by enterprise-grade functions.
On this article, we’ll discover why that is the case and introduce an alternate strategy: course of calling. This permits the creation of dependable, process-aware, and simply debuggable conversational brokers. We’ll additionally share code examples and stroll you thru easy methods to get began with the Rasa platform.
Within the present paradigm, AI brokers are geared up with instruments that allow them to unravel particular duties. These instruments usually carry out atomic actions, resembling calling an API to learn or write knowledge, updating or fetching knowledge from a database, or related operations. The limitation of such an strategy is that it typically lacks state, making AI brokers unpredictable and typically even unreliable for a number of causes:
- Lack of conversational context: The agent doesn’t bear in mind earlier conversations or choices, resulting in redundant or inconsistent responses.
- Poor adherence to enterprise processes: With out state monitoring, the agent could skip required steps or comply with steps within the mistaken order.
- Inconsistent execution of repeated duties: The identical process could yield completely different outcomes, breaking consumer expectations and decreasing belief.
Alternatively, companies have well-established processes, and AI assistants are anticipated to comply with them, not improvise or create their very own. A conversational AI agent deployed for customer support should perceive customers’ wants, join them to the precise firm processes, clearly clarify the way it can help, and information them by means of every step to attain their targets–all whereas sustaining a easy and pure dialog circulation.
That is the place course of calling is available in. With course of calling, the LLM invokes and collaborates with a stateful course of. The consumer asks the assistant a query, and the LLM predicts which particular, outlined enterprise course of to set off. The method, together with LLM, works collectively to drive the dialog ahead.
Let’s dive into easy methods to construct a dependable AI assistant utilizing the process-calling strategy in follow. We’ll develop a banking AI agent able to dealing with easy processes, together with transferring cash, opening a financial savings account, responding to steadily requested questions (FAQs), and addressing off-topic requests.
How you can Construct Conversational AI Agent with Rasa?
The Rasa Platform is a conversational AI framework that provides an end-to-end resolution for constructing AI assistants. On the coronary heart of the Rasa Platform is CALM (Conversational AI with Language Fashions), Rasa’s AI-driven dialogue orchestration engine. CALM is designed to combine enterprise logic with adaptive dialog administration. CALM’s core options are dialogue understanding, dialogue supervisor, and contextual response rephraser.
With Rasa, you possibly can construct enterprise-grade, fluent textual content and voice AI assistants. Let’s arrange the setting to start constructing your AI banking assistant.
Establishing the Atmosphere
First, it’s worthwhile to get a free Developer Version key right here. A affirmation e mail can be despatched to the e-mail handle you offered, and also you’ll want to repeat your token from that message.
There are two methods to get began with Rasa:
- Utilizing GitHub Codespaces
- Native set up utilizing Python
On this tutorial, we’ll use GitHub Codespaces as a result of it helps you to begin constructing an agent straight in your browser, no native set up required. This feature is right for newcomers and anybody new to Rasa.
What you’ll want:
- A GitHub account
- A Rasa Developer Version key – get it right here.
Creating Your First Conversational AI Agent
To create your first AI agent utilizing Rasa, undergo the next steps:
- Go to Rasa codespaces GitHub and click on “Create codespace on principal.” This may open a brand new Codespace in your browser.
- As soon as the Codespace is prepared, open the .env file and add a brand new setting variable:
RASA_PRO_LICENSE="your-rasa-pro-license-key"
- Then, within the terminal, run the next instructions:
Load the setting variables utilizing:
supply .env
To activate the digital setting:
supply .venv/bin/activate
Create your first agent utilizing the tutorial template offered by Rasa. All through the set up, press Enter or say sure to every query.
Execute the next command within the terminal:
rasa init --template tutorial
A brand new tab with the Rasa Inspector will open. Strive asking your agent a couple of questions, resembling:
- Hey, how are you?
- What are you able to do?
You may also attempt the command:
- “Assist me switch cash.”
Switch cash is an instance of transactional circulation, the place the agent follows a predefined sequence of actions resembling asking for lacking data, calling an API, updating a file in a database, or related.
Constructing a Movement
Keep in mind how we talked about constructing a dependable, deterministic execution of enterprise logic in the beginning? You’ll be able to create such a course of in Rasa utilizing flows. We’ll add performance to our agent for opening a financial savings account to show how course of calling works in follow.
Flows can help you construct a predefined sequence of steps that should be adopted to attain a particular consequence. After all, opening an actual financial savings account at a financial institution would contain many extra steps, resembling authenticating the consumer, checking account eligibility, and many others. All of this may be applied in Rasa utilizing customized actions, that are primarily Python capabilities.
We’ll construct a simplified model the place we ask the consumer for some further data earlier than opening a brand new financial savings account:
- The identify
- The forex
- The time period size
As soon as these steps are outlined, the AI agent will constantly comply with them and execute the enterprise logic as prescribed, whereas additionally enhancing the capabilities of LLMs for higher dialogue understanding.
Add Financial savings Account Movement
We’ll now add this circulation to our assistant by modifying the flows.yml file within the knowledge listing:
open_savings_account:
description: Gather particulars to open a financial savings account.
steps:
- gather: account_name
description: The identify the consumer desires to provide their financial savings account.
- gather: forex
description: The forex for the financial savings account.
- gather: period
description: The period of time (e.g., months or years) for the financial savings account.
- motion: utter_confirm_savings_account_opened
As you possibly can see, flows are written in YAML format. If you wish to perceive the syntax of the flows, you possibly can learn the official documentation at Rasa Docs right here.
Subsequent, replace the area.yml file to outline the mandatory slots and responses. Consider area.yml because the universe of your conversational AI assistant: everytime you add new slots or responses, it’s worthwhile to embody them right here so your assistant is aware of about them.
Add new slots to the slots part:
account_name:
sort: textual content
mappings:
- sort: from_llm
forex:
sort: textual content
mappings:
- sort: from_llm
period:
sort: textual content
mappings:
- sort: from_llm
Add new responses to the responses part:
utter_ask_account_name:
- textual content: "What would you wish to name your new account?"
utter_ask_currency:
- textual content: "Which forex would you want to make use of?"
utter_ask_duration:
- textual content: "What number of months or years would you want to save lots of for?"
utter_confirm_savings_account_opened:
- textual content: "Your financial savings account '{account_name}' has been efficiently opened."
Lastly, run the next instructions to coach your assistant and open the Rasa Inspector:
rasa prepare
rasa examine
Now you can check the brand new financial savings account circulation by chatting along with your agent and saying one thing like:
I wish to open a financial savings account
The assistant will comply with the method you outlined and gather the required particulars step-by-step.
Advantages of utilizing Flows
Among the advantages of utilizing flows are:
- Breaking down advanced processes into reusable items
- Linking flows collectively to construct extra superior interactions
- Scalability – you possibly can develop your assistant’s capabilities whereas protecting issues organised
- Management – you outline precisely how the assistant ought to behave in particular situations
Flows make it simpler to handle structured conversations, particularly when it’s worthwhile to execute enterprise logic constantly and reliably.
Dealing with Informational Questions
Now that you understand how so as to add a circulation, you possibly can broaden your agent’s performance to deal with any variety of duties, every executed exactly in response to your directions. Whether or not you will have 10 flows or 100, Rasa will leverage the ability of LLMs to set off the proper one.
However what if the consumer asks an data query as a substitute of a transactional one?
You don’t wish to create a devoted circulation for each query, resembling “How lengthy does a cash switch take?” or “What’s the fee for worldwide transfers?“
To deal with such questions, Rasa features a part referred to as Enterprise Search. There are a number of methods to get began with Enterprise Search in Rasa and let customers chat along with your docs:
- Add paperwork on to your mission listing and use the FAISS vector retailer
- Use one of many supported exterior vector databases, resembling Qdrant or Milvus
- Join every other vector database of your selection
On this tutorial, we’ll use the primary possibility: FAISS vector retailer. Listed below are the steps to make your AI Agent perceive informational queries:
By default, Enterprise Search makes use of OpenAI because the default LLM supplier, so that you’ll want so as to add your OPENAI_API_KEY
to the .env file.
Put together your knowledge in .txt format and add it to docs/faq.txt in order that your AI agent can reply any questions based mostly on the offered knowledge, with out being explicitly programmed to take action.
Subsequent, in your config.yml, uncomment EnterpriseSearchPolicy
:
- identify: EnterpriseSearchPolicy

Edit the patterns.yml
file within the knowledge
folder to incorporate the next search sample:
pattern_search:
description: Movement for dealing with knowledge-based questions
identify: sample search
steps:
- motion: action_trigger_search
Retrain and re-run your agent. Now you can check each transactional and informational queries.
Dealing with Out-of-Scope Questions
The very last thing we wish to cowl is what to do when customers ask questions that may’t be answered with a circulation or Enterprise Search.
In Rasa, there’s a default sample, pattern_chitchat
, designed to deal with such conditions. All out-of-scope queries can be routed there, and you’ve got a few choices:
- Reply with a predefined message, resembling “I’m unsure easy methods to reply that.”
- Use an LLM and a customized immediate to generate extra diversified and pure responses.
pattern_chitchat:
description: Handles off-topic or common small speak
identify: sample chitchat
steps:
- motion: action_handle_chitchat
You’ll be able to then outline your action_handle_chitchat
as both a static response or use it to hook up with an LLM for dynamic replies.
This ensures that your assistant at all times responds gracefully, even when the query falls outdoors its core enterprise logic or data base.
Conclusion
On this article, we explored the conversational AI framework Rasa and easy methods to use it to construct a dependable and scalable AI Agent that strictly follows well-defined enterprise processes. We demonstrated easy methods to implement the method calling strategy, which ensures predictability, management, and alignment with real-world enterprise necessities.
You discovered easy methods to:
- Arrange the setting and launch Rasa in GitHub Codespaces
- Create transactional flows resembling transferring cash and opening a financial savings account
- Use Enterprise Search to deal with informational queries
- Deal with out-of-scope and common questions utilizing fallback patterns
Now you will have all of the instruments to construct AI Assistants that may confidently function inside clearly outlined enterprise logic. Strive it your self, get your developer version license key, and create your first assistant at present.
Login to proceed studying and revel in expert-curated content material.