{
  "video": {
    "id": "o6U_2vd967Y",
    "title": "Let's integrate AI Agents in Event-Sourced Systems — Divakar Kumar, FlyersSoft",
    "duration": 1297,
    "upload_date": null,
    "channel": "AI Engineer",
    "source": "AI Engineer",
    "event_format": "In person"
  },
  "analysis": {
    "video_id": "o6U_2vd967Y",
    "title": "Let's integrate AI Agents in Event-Sourced Systems — Divakar Kumar, FlyersSoft",
    "one_liner": "A production account of bolting an agentic \"tier two\" onto an existing event-sourced fraud-detection system so AI agents only adjudicate the gray-zone transactions the rule engine and ML model can't decide — with the real work being a CDC-fed semantic layer that gives those agents cross-bounded-context data.",
    "summary": "Divakar Kumar argues that AI agents pay off not as chatbots or coding assistants but when dropped into existing business workflows, and uses real-time fraud detection as the case. His team kept their rule-based tier one and third-party ML risk score for the transactions that clearly pass or clearly fail, and added an agentic tier two only for the uncertain gray zone — the cases where, as in his own declined $3,500 laptop purchase, nobody including the bank could say why a transaction was blocked. The architectural core is getting data out of separate DDD bounded contexts (transaction, accounts, device, payment) via Cosmos DB change feed and a message broker into a worker process and projection layer, producing a semantic/materialized view the agents' tools read. Tier two fans out to a risk analyzer and a behavior analyzer agent, and a third verdict agent reconciles them and emits the decision back as an event into the saga flow.",
    "key_points": [
      "Framing story: his own $3,500 laptop purchase was declined twice, and when customer service called to verify, they could not say why it was blocked — the decision came from a static rule or an ML threshold nobody could explain.",
      "Rule-based engine worked for years but failed on maintainability: fraudsters keep finding new routes in, so the static rules need updating day by day. A third-party provider then trained an ML model on transaction history and features to return a risk score.",
      "Both approaches only cleanly handle transactions below (approve) or above (block) a threshold; the gray zone in between is where neither can conclude, and that is the only place the agents are introduced — tier one is explicitly not replaced.",
      "Four bounded contexts hold the relevant data separately: transaction (merchants, amounts), accounts (KYC status, account age, customer), device (device and browser fingerprints, OS, trust score, location and IP history), payment (chargebacks, recent payments).",
      "Cosmos DB is the event store, using event sourcing — commands append events as business facts rather than mutating state. CDC / the NoSQL \"change feed\" propagates changes into read models optimized for querying: one for timelines, one for customer information, one for fraud indicators (the risk view).",
      "Because other teams don't do event sourcing, the same data is also pushed as integration events through a message broker to a worker process that massages them into the projection layer, forming the semantic layer / materialized view the agents consume.",
      "Tier two uses a fan-out pattern: the event goes to a risk analyzer agent and a behavior analyzer agent in parallel, each with tools over the projection layer (fraud history, device trust, migrated business rules, transaction-pattern analysis via two plugins).",
      "A metric- or if-condition-based verdict produced many false positives — \"again going back to the same criteria\" as the rule engine — so a third agent in the verdict layer reads both agents' responses and decides; the verdict is emitted as an event so the saga continues into the payment context and back.",
      "Agents are language model + tools + memory; the model need not be an LLM (an SLM or open-source model works), and memory is deliberately short-term and in-memory because transactions must be processed in under 500 milliseconds.",
      "The live POC on synthetic data only partially ran — the serverless-mode database was slow to wake — so the three-agent verdict was described rather than shown."
    ],
    "takeaways": [
      "Don't replace a working rule engine or ML scorer with agents; segment traffic and route only the uncertain gray-zone cases to an agentic tier two.",
      "Before adding agents to an event-driven or event-sourced system, build the semantic layer first — use CDC/change feed and a message broker into a worker and projection layer so agents get denormalized cross-context context they otherwise cannot see across bounded contexts.",
      "Don't collapse multiple agents' outputs with a threshold or an if-condition; that reintroduces the rule-engine false-positive problem. Use a reconciling agent over their responses.",
      "Size the memory layer to the SLA: with a sub-500ms transaction budget, use in-memory short-term memory rather than long-term memory.",
      "Put an explicit break-out metric on the agent's reason–act loop; the stopping condition differs per use case and without one you get an infinite loop.",
      "Migrate business-specific rules out of the rule engine and into agent tools so the agent can apply them with real-time context."
    ],
    "topics": [
      "agents",
      "event-sourcing",
      "fraud-detection",
      "multi-agent",
      "ddd",
      "cqrs",
      "architecture",
      "cdc"
    ],
    "tools": [
      "Cosmos DB",
      "FlyersSoft",
      "saga orchestration",
      "change feed / CDC",
      "SLMs and open-source models"
    ],
    "quotes": [
      {
        "text": "So, the real value that you could bring out of these AI agents is like when you start to apply these into your business workflows.",
        "at": "01:00",
        "url": "https://www.youtube.com/watch?v=o6U_2vd967Y&t=60s"
      },
      {
        "text": "Now, you might be thinking like what a great idiot, right? Because it is already an uncertain case like why do you want to introduce an AI agent because it is also a non-deterministic by nature, right?",
        "at": "02:46",
        "url": "https://www.youtube.com/watch?v=o6U_2vd967Y&t=166s"
      },
      {
        "text": "our thought process is not to exclude the systems that we already had. We we are just trying to handle few of the areas like that is the gray zone areas with the help of agentic AI processing.",
        "at": "05:32",
        "url": "https://www.youtube.com/watch?v=o6U_2vd967Y&t=332s"
      },
      {
        "text": "if we are using just the metrics, it is again going back to the same criteria like where we had this rule-based um mechanism.",
        "at": "14:58",
        "url": "https://www.youtube.com/watch?v=o6U_2vd967Y&t=898s"
      }
    ],
    "words": 4096
  },
  "summary_url": "/#o6U_2vd967Y",
  "transcript": {
    "html": "/transcripts/o6U_2vd967Y.html",
    "txt": "/transcripts/o6U_2vd967Y.txt",
    "vtt": "/transcripts/o6U_2vd967Y.vtt"
  }
}