👀 A Message Protocol, Metrics, Traces and some sweet new endpoints!
With this release, mahilo can now help you see how agents communicate through message tracking, agent metrics and traces of all major events in your mahilo system.
📨 Message Protocol & Broker
Finally tackled one of our biggest challenges - making inter-agent communication more robust and trackable. Now every message between agents:
- Has its own unique identity and signature (using HS256 encryption)
- Can be tracked through its entire lifecycle
- Supports message acknowledgments and retries
- Uses a SQLite store to persist all communications
Here's what a message looks like now:
json
{
"message_id": "550e8400-e29b-41d4-a716-446655440000",
"sender": "agent1",
"recipient": "agent2",
"message_type": "direct",
"payload": "Hello, agent2!",
"timestamp": 1710234567.89,
"correlation_id": "123",
"reply_to": "agent1",
"signature": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}
🔍 New Message Query Endpoints
All your agent messages are now available through some handy endpoints:
- `/messages` - Get all messages with flexible filtering:
- `?sender=agent1` - Filter by sender
- `?recipient=agent2` - Filter by recipient
- `start_time` and `end_time` - Get messages within a time range
- `/conversations/agent1/agent2` - Quick way to fetch all conversations between two specific agents
📊 OpenTelemetry Integration: See Everything!
Added comprehensive observability with OpenTelemetry! You can now track:
- Message processing times
- Queue sizes
- Retry counts
- Active agents
- And much more!
All these metrics and traces are available through new endpoints:
- `/metrics` - Get all your metrics
- `/traces` - Check out the traces
- `/metrics/prometheus` - Prometheus format (custom implementation to keep dependencies light)
🎙️ Voice Improvements: Smoother Than Ever
Made some serious improvements to the voice interface:
- No more Azure deployment needed - just use your OpenAI key!
- Fixed an annoying event loop starvation bug
- Function calls now work with voice responses
- Much smoother audio output by reusing output streams
- Better voice quality overall
🤔 What's Next?
This release lays the groundwork for some really cool features I'm planning. The message broker and telemetry will help make agent interactions more reliable and observable.
Try it out and let me know what you think! If you run into any issues or have ideas for improvements, don't hesitate to open an issue.
---
As always, thanks for using mahilo! 🙏
PRs
* Improve Realtime API integration (smoother and more powerful) by wjayesh in https://github.com/wjayesh/mahilo/pull/19
* Create a message protocol and broker. Add telemetry 🦸 by wjayesh in https://github.com/wjayesh/mahilo/pull/20
* In-memory exporter and an http endpoint to serve metrics and traces by wjayesh in https://github.com/wjayesh/mahilo/pull/21
**Full Changelog**: https://github.com/wjayesh/mahilo/compare/0.4.2...0.5.0