Event-Driven Architecture
Event-driven architecture (EDA) is a software design pattern where system components communicate through events — discrete notifications that something has happened — enabling loose coupling, real-time responsiveness, and scalable reactive systems.
Understanding Event-Driven Architecture
In a traditional request-response architecture, systems communicate by making direct calls and waiting for responses. Event-driven architecture instead has components emit events when things happen (an email arrived, a file was changed, a payment was processed) and subscribes other components to react to relevant events. This decoupling makes systems more scalable, resilient, and responsive. Events are typically published to a message broker — RabbitMQ, Kafka, or Amazon SQS — which stores them durably and delivers them to all interested subscribers. EDA is the backbone of modern real-time applications.
How GAIA Uses Event-Driven Architecture
GAIA's entire backend is built on event-driven architecture using RabbitMQ as the message broker. Email arrivals, calendar updates, Slack messages, and user actions all produce events that are published to queues. ARQ workers subscribe to these events and execute the appropriate agent workflows. This architecture makes GAIA genuinely real-time and scalable — new event types and workflows can be added without disrupting existing processing.
Related Concepts
Event-Driven Automation
Event-driven automation is a pattern where workflows are triggered automatically in response to specific events, such as a new email arriving, a calendar event being created, or a message being posted, enabling real-time, reactive processing.
Webhook
A webhook is an HTTP callback mechanism where a system sends an automated HTTP request to a specified URL whenever a defined event occurs, enabling real-time notification and integration between services without polling.
Message Queue
A message queue is a system that stores messages (tasks or events) sent from producers and delivers them to consumers for processing, decoupling the two and enabling asynchronous, reliable communication between system components.
Pub-Sub (Publish-Subscribe)
Publish-subscribe (pub-sub) is a messaging pattern where publishers emit events to a central broker without knowing who will receive them, and subscribers register interest in specific event types and receive matching events asynchronously.
Trigger
A trigger is a specific event, condition, or schedule that automatically initiates an automated workflow or agent action, serving as the starting point for any automated process.


