WhoBuilt

Let's integrate AI Agents in Event-Sourced Systems

Jul 30, 2026· 22 min· 1.6K views·Watch on YouTube

Speaker

Divakar Kumar of FlyersSoft explains how to integrate AI agents into event-sourced and event-driven systems, using real-time fraud detection as the example at an AI Engineer conference.

Use agents for uncertain fraud cases

Kumar describes adding an agentic second tier to existing rule-based or machine-learning fraud checks. The first tier handles clear cases, while the agentic tier assesses transactions in the gray area where existing systems struggle to decide.

Build a shared view across contexts

The example spans transaction, account, device, and payment contexts, each with its own data. Kumar’s architecture propagates events through CDC or a message broker and a worker process to build a materialized view with context for the agents.

Connect agents to tools and short-term memory

Kumar outlines agents built from a language model, tools, and memory. The example uses in-memory short-term memory to meet a transaction target of under 500 milliseconds, and he advises setting limits so the agent loop can stop.

Orchestrate a multi-agent verdict

In Tier 2, the system fans a transaction out to risk and behavior analysis agents, which use tools to inspect fraud history, device trust, business rules, and transaction patterns. A third agent weighs their responses, publishes a verdict as an event, and lets the saga flow continue through the relevant contexts.

Demonstrate the event flow

Kumar presents a proof of concept using synthetic data across transaction, account, device, and payment contexts. Events flow through projections into the semantic layer; the planned result is a decision event that returns to the message broker and continues the saga.

Takeaways

  • Keep existing rules or ML for clear fraud decisions and reserve agent processing for ambiguous cases.
  • Aggregate relevant data across bounded contexts into a materialized view agents can query.
  • Use tools to give agents access to business rules and domain data instead of relying on model context alone.
  • Set explicit loop limits and latency targets; Kumar’s example targets processing under 500 milliseconds.
  • Publish the final agent verdict as an event so existing saga orchestration can continue.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • feature
    Change data capture: Propagates event-store changes to different read models
    “those changes can be propagated to different read models”
    YouTube
    Unverified1 source· Talk
  • feature
    event sourcing: Appends events as business facts instead of mutating state
    “We don’t mutate state; instead, we append events as they arrive.”
    YouTube
    Unverified1 source· Talk
  • feature
    Azure Cosmos DB: Used as the event store in the presented system
    “We currently use Cosmos DB as our event store”
    YouTube
    Unverified1 source· Talk
  • feature
    semantic layer: Gathers data from different contexts for agent use
    “gather all the data from these different contexts and build a semantic layer”
    YouTube
    Unverified1 source· Talk
  • metric
    short-term memory: Transaction processing target: under 500 milliseconds
    “A transaction should be processed in under 500 milliseconds”
    YouTube
    Unverified1 source· Talk
  • feature
    AI agents: Risk and behavior agents feed a third agent that makes the final verdict
    “we fan it out to two agents: the risk analyzer and the behavior analyzer”
    YouTube
    Unverified1 source· Talk

Related talks