Skip to main content

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. 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.
Install the skill once in your coding-agent environment:
Run the framework-specific prompt below from the application root. Review the resulting diff before deploying it.
Rasa sends every conversation event to an event broker. A small custom broker turns each user turn into one Agnost AI event: the user message is the input and the assistant’s replies are the output. It works for Rasa Pro projects configured with 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 an addons/ folder in the project root, next to endpoints.yml or agent.yml, with an empty addons/__init__.py. Then add addons/agnost_turns.py:
Latency comes from Rasa’s own event timestamps, from the user message to the end of the assistant’s turn.

2. Add the broker for your project type

Rasa Pro (CALM)

Add addons/agnost_broker.py. Rasa Pro publishes flat events such as {"event": "user", ...}, and the turn ends when Rasa runs action_listen.
Register it in endpoints.yml:
endpoints.yml
Start Rasa from the project root so addons can be imported:
Rasa accepts one 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

Add addons/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.
Register it in integrations.yml:
integrations.yml
Mantle requires a custom broker to subclass 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, or conversation_id on Mantle events) becomes the Agnost AI conversation ID.
  • The event’s user_id becomes 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_name from the broker config becomes the agent name. It defaults to rasa.
  • On Mantle, tools called during the turn are listed in the event’s tool_calls metadata 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

  1. Start Rasa with the broker configured, then send two messages in one conversation through any channel, such as the Inspector or the REST channel.
  2. Open Conversations in app.agnost.ai. The conversation ID matches the Rasa conversation ID, and each user message is one event.
  3. 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 confirm addons/__init__.py exists.
  • Rasa fails at startup with Agnost AI did not initialize: set AGNOST_ORG_ID to your organization ID before starting Rasa.
  • Mantle says the broker must subclass the published contract: use AgnostMantleEventBroker in integrations.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 text only.
  • 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

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.