Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
endpoints.yml and for Mantle agents configured with integrations.yml. Your flows, skills, and channels do not change.
Manual setup: Agnost AI SDK
Install
Install the SDK in the same Python environment as Rasa:1. Add the turn collector
Create anaddons/ folder in the project root, next to endpoints.yml or agent.yml, with an empty addons/__init__.py. Then add addons/agnost_turns.py:
2. Add the broker for your project type
Rasa Pro (CALM)
Addaddons/agnost_broker.py. Rasa Pro publishes flat events such as {"event": "user", ...}, and the turn ends when Rasa runs action_listen.
endpoints.yml:
endpoints.yml
addons can be imported:
event_broker. If you already stream events to Kafka, keep that broker and run the collector in a Kafka consumer instead: create AgnostEventBroker(org_id="<your-org-id>") once and pass each decoded message to its publish method. Rasa writes the same event JSON to the topic.
Mantle
Addaddons/agnost_mantle_broker.py. Mantle publishes nested events such as {"user": {...}}, records tool calls as tool_executed, and ends each turn with bot_turn_ended.
integrations.yml:
integrations.yml
rasa.api.brokers.v1.EventBroker directly, so the Rasa Pro class above does not load in a Mantle agent.
Data mapping
- The Rasa conversation ID (
sender_id, orconversation_idon Mantle events) becomes the Agnost AI conversation ID. - The event’s
user_idbecomes the user ID. When the channel does not set one, the conversation ID is used. - The user message is the event input. All assistant messages until the end of the turn are joined with newlines as the output.
agent_namefrom the broker config becomes the agent name. It defaults torasa.- On Mantle, tools called during the turn are listed in the event’s
tool_callsmetadata with their name and error flag.
Why there is no OpenTelemetry section
Rasa can export traces over OTLP (tracing: type: otlp), but its spans describe Rasa internals with attributes such as sender_id, class_name, and voice.*. They carry no GenAI or OpenInference attributes and no message text, so the Agnost AI collector ignores them. Use the event broker above for conversations, and keep Rasa’s OTLP tracing for your own trace backend if you use one.
Verify
- Start Rasa with the broker configured, then send two messages in one conversation through any channel, such as the Inspector or the REST channel.
- Open Conversations in app.agnost.ai. The conversation ID matches the Rasa conversation ID, and each user message is one event.
- Open an event and confirm the input is the user’s message and the output is the assistant’s full reply.
Troubleshooting
- Rasa logs
The EventBroker type ... could not be found: start Rasa from the project root and confirmaddons/__init__.pyexists. - Rasa fails at startup with
Agnost AI did not initialize: setAGNOST_ORG_IDto your organization ID before starting Rasa. - Mantle says the broker must subclass the published contract: use
AgnostMantleEventBrokerinintegrations.yml, not the Rasa Pro class. - Events appear but outputs are empty: the assistant replied with buttons or custom payloads only. The broker records bot
textonly. - Every conversation shows the same user: your channel does not set a user ID, so the conversation ID is used. Set the user ID in your channel to group conversations per person.
References
- Rasa event brokers and custom brokers
- Mantle custom event broker
- Mantle conversation events
- Rasa tracing
- Agnost AI Python SDK
Next steps
- Conversations: review complete Rasa conversations.
- Events: inspect each user turn and the assistant’s reply.
- Patterns: organize production conversations by what users wanted.