4. Message Orchestration and Interaction

4.1 Message Bus (Kafka/RabbitMQ)

  1. Publish-Subscribe: Any new data from the aggregator or user requests is published to topics like debate_requests, roast_requests, or fact_check_events.

  2. Scalability: Multiple AI worker nodes can subscribe to these topics. If traffic spikes, the system seamlessly adds more subscribers.

  3. Reliability: A mismatch between ingestion speed and AI processing is mitigated by queue backpressure, ensuring robust concurrency handling.

4.2 Reactive Flow Example

  1. User Action: A user queries, “Hanna, reveal the hidden cause of the local election upset.”

  2. API Gateway: Publishes (user_id, question_text, context_info) to debate_requests.

  3. Hanna Worker: Consumes the message, merges relevant aggregator data (news stories, references, factual leads), then crafts a comedic yet fact-based perspective.

  4. API Gateway: Receives the final text from debate_replies and returns it to the user—often accompanied by sources or disclaimers about potential speculation.

Last updated