BSc Thesis · Event-Driven AI
Event-driven AI agents collaborating over microservices (BSc thesis)

N+M
coupling - down from N×M
10K+/s
Kafka event throughput
99.9%
agent uptime
My bachelor's thesis: an event-driven multi-agent AI system that analyzes Mongolian Stock Exchange data and delivers personalized investment advice - in Mongolian. Five specialized agents cooperate over Apache Kafka instead of calling each other directly.
Direct agent-to-agent APIs create N×M coupling; routing every message through Kafka brings it down to N+M. Agents fail independently, scale horizontally by adding instances, and any event can be replayed for debugging or model retraining - with Apache Flink handling stateful multi-step execution plans.
The Orchestrator classifies intent with a ReAct loop on Gemini 2.0 Flash and routes work to the Investment, News and Knowledge agents - the latter a pgvector RAG over an MSE company knowledge base. AI queries complete end to end in ~15–20s, API calls in ~200–500ms, and the whole system idles at ~123MB with 99.9% agent uptime.
Event-driven AI agents coordinating over Apache Kafka
Frontend
Next.js 16 + React 19 · dashboard · AI chat · watchlist
API gateway
Express · JWT auth · Kafka producer
Event broker
Apache Kafka
user.requests · agent.tasks · agent.responses · planning.tasks
AI agents
Orchestrator
ReAct · intent routing
Investment
MSE analysis · advice
News
Finnhub · sentiment
Knowledge
RAG · pgvector
PyFlink planner
Flink 1.18 · multi-step
Data layer
PostgreSQL 16 · Redis 7 · pgvector

Aruarian Dance
Nujabes