How rasahq/rasa works
Main components
• Core Conversational Engine – This includes the NLU components (tokenizers, featurizers, classifiers in the rasa/nlu directory) and the dialogue management parts (policies, actions, story processing in the rasa/core directory).
• Graph/Engine & Training Pipelines – The engine directory (rasa/engine) and training/training_data components are used for managing models, processing conversation graphs, caching, and training.
• Channel Connectors & API Endpoints – There are many connectors under rasa/core/channels (e.g., for Facebook, Slack, Telegram) that handle incoming and outgoing messages, as well as a REST API.
• Action Server/Custom Actions – Components found in examples as well as the action code within the initial_project and examples directories showing how custom business logic is integrated.
• External Integrations – Event brokers (Kafka, Pika, SQL, etc. in the brokers folder) and support for external libraries (spacy, mitie, Hugging Face transformers, etc.) form an important part of the system.
• Configuration and Domain Management – Multiple configuration files (YAML for domains, stories, rules) and the configuration management provided in the “data” folder.
• Developer/Testing Infrastructure – The project includes extensive tests, CI/CD pipelines (GitHub workflows, Dockerfiles, and Makefiles), documentation, and scripts for building/deployment. Although these are not “runtime” components, they are integral to the overall system design.
Relationships and interactions
• User or Messaging Channel (client endpoints) → Connector/Channel Layer (rasa/core/channels) receives input.
• Incoming messages are then passed to the NLU module (rasa/nlu) which extracts intents and entities.
• The processed NLU output is sent into the dialogue manager (rasa/core/agent, policies in rasa/core/policies, and the engine/graph modules) where conversation state is maintained.
• If required, control passes to the action server (custom actions defined in examples or the Rasa SDK integration) to execute business logic.
• Responses and follow-up events are then generated and relayed back via the channel connectors.
• Data artifacts such as training data, domain files, and log/tracker data are stored and managed (represented in the “data” and “tests/tracker_stores” directories).
Architectural patterns and key design decisions
• Modular Design – The separation between the NLU, Core (dialogue management), connectors, and training/persistence clearly follows modular principles.
• Extensibility – The use of plugins, custom components (graph components, custom action triggers), and a clear separation between configuration, code, and tests are integral design principles.
• Pipeline Architecture – The conversational flow is designed as a pipeline (input → NLU → dialogue management → actions → output) with each module having clear inter–dependencies.
• Integration with external tooling – Dockerfiles, GitHub workflows, CI/CD pipelines, and documentation directories show a robust deployment and development automation strategy.
Relevant technology and libraries
• Python as the main programming language.
• Tools such as Poetry for dependency management.
• Integration libraries/frameworks: Spacy, Mitie, Hugging Face Transformers for NLU; and Docker, Kubernetes, and CI/CD pipelines for deployment.
• Testing frameworks: pytest and numerous integration tests across directories.