Kafka Topics
Page Outline
Kafka Topics
DIA uses Kafka as the primary event bus for asynchronous communication with other agents and services. This event-driven architecture enables real-time reactivity to system changes without blocking operations.
Event-Driven Architecture Benefits:
- Decoupling: Agents can communicate without direct dependencies
- Scalability: Events can be processed in parallel across multiple consumers
- Resilience: Failed events can be retried without affecting the sender
- Auditability: All events are logged and can be replayed for debugging
The following Kafka topics are used by DIA:
| Topic | Direction | Message Format | Purpose | Consumer Group |
|---|---|---|---|---|
train.results | MSA → DIA | Model training completion events | Notifies DIA when model training completes, enabling analysis of training patterns and outcomes | dia-group |
model.metrics | MSA → DIA | Continuous model performance metrics | Streams real-time metrics (drift, AUC, latency) for continuous monitoring and anomaly detection | dia-group |
decision.simulation.request | PSA → DIA | Simulation job requests | Receives simulation requests from Prompt Studio Agent for async processing | dia-simulator-group |
decision.simulation.result | DIA → PSA/UI | Simulation completion events | Publishes simulation results for consumption by PSA and UI components | N/A (multiple consumers) |
governance.alerts | GA → DIA | Policy violation and alert events | Receives governance alerts to incorporate policy changes into decision-making | dia-group |
Message Flow Example:
-
Model Training Completion Flow:
- MSA completes model training and publishes to
train.results - DIA consumer receives the event
- DIA updates its knowledge base with new model information
- DIA may trigger analysis to understand training patterns
- MSA completes model training and publishes to
-
Simulation Request Flow:
- PSA publishes simulation request to
decision.simulation.request - DIA consumer receives and validates the request
- DIA creates simulation job and processes it
- DIA publishes results to
decision.simulation.result - PSA and UI components consume results for display
- PSA publishes simulation request to
Consumer Group Strategy:
dia-group: Main consumer group for general events (train.results, model.metrics, governance.alerts)dia-simulator-group: Dedicated consumer group for simulation requests to enable parallel processing- Multiple partitions per topic enable horizontal scaling of consumers
Related Documentation
- Implementation Overview - Back to implementation index
- Example Code Snippets - Kafka consumer code examples
- Scaling & Reliability Patterns - Kafka scaling strategies