Kafka Events

4 event topics across 3 categories published to Amazon MSK Serverless.

Event Format: CloudEvents 1.0

All events follow the CloudEvents 1.0 specification. Events are partitioned by tenant_id and published to Amazon MSK Serverless. aibrain-svc produces events for request lifecycle, streaming, and ZAR consensus tracking.

Brokers

EnvironmentBrokerAuth
Stagingboot-gpm4u49z.c2.kafka-serverless.us-east-1.amazonaws.com:9098SASL/OAUTHBEARER (IAM)
Productionb-1.eventzr-msk-prod.ap-south-1.amazonaws.com:9098SASL/OAUTHBEARER (IAM)

Event Envelope

CloudEvents 1.0 envelopejson
{
  "specversion": "1.0",
  "type": "eventzr.aibrain.response.generated.v1",
  "source": "aibrain-svc",
  "id": "evt-550e8400-e29b-41d4-a716-446655440000",
  "time": "2026-02-28T12:00:00.000Z",
  "datacontenttype": "application/json",
  "subject": "tenant-uuid",
  "data": {
    "tenantId": "tenant-uuid",
    "userId": "user-uuid",
    "conversationId": "conv-uuid",
    "mode": "zar",
    "modelsUsed": ["claude-3-sonnet", "gpt-4-turbo", "llama-3"],
    "consensusReached": true,
    "inputTokens": 250,
    "outputTokens": 800,
    "totalTokens": 1050,
    "latencyMs": 3200,
    "costCredits": 60,
    "costUsd": 0.012
  }
}

Event Topics (4)

Request Lifecycle2

TopicDescription
eventzr.aibrain.request.initiated.v1Emitted when an AI orchestration request starts processing
eventzr.aibrain.response.generated.v1Emitted when an AI response is generated successfully (includes cost, latency, tokens)

Streaming1

TopicDescription
eventzr.aibrain.streaming.chunk.v1Emitted for each streaming chunk (high-volume, optional consumer)

ZAR Ensemble1

TopicDescription
eventzr.aibrain.consensus.failed.v1Emitted when ZAR ensemble fails to reach consensus across 3 models