Architecture of an assistant built with CALM

Video



In this chapter, you'll explore the key components of an assistant built using CALM. By the end, you'll have a better understanding of the essential files and components involved in building your application.

The architecture of an assistant

First, let's examine a simple interaction between a user and an assistant (refer to the image included below). The user's input is processed by the dialogue understanding component, which interprets the input and generates a sequence of commands to progress the conversation. Assistants built with CALM aim to efficiently fulfill user requests by leveraging the CommandGenerator component, which can use LLMs or traditional NLU methods.

The commands generated might involve setting a specific slot, calling an API, or performing a particular action. The assistant takes into account the user's inputs and the conversation history to ensure that the follow-up is natural and helps achieve the user's goal.

Once the sequence of commands is created, the Dialogue Manager executes them. This could involve initiating a specific flow that corresponds to business logic, setting a slot mid-flow, executing a custom action, or performing an Enterprise Search. The Dialogue Manager's output is a sequence of responses produced by the Contextual Response Rephraser, responsible for generating actual responses.

Key files of the assistant built with CALM

Here are the key files and components you'll be working with to implement this behavior:

  • flows.yml: Defines the business logic rules of your assistant. Future sections will cover flows in detail.
  • config.yml: Configures your dialogue understanding components and parameters, such as defining the LLM component.
  • domain.yml: Defines the "universe" of your assistant, including responses, custom actions, and slots.
  • actions.py: Contains the code for custom actions, like calling an API or setting a slot.
  • endpoints.yml: Specifies how your assistant runs a custom action server.

With this high-level overview of the architecture of an assistant built using CALM, the next sections will delve into these components in more detail.


2016-2024 © Rasa.