MongoDB, Mastra Unveil Autonomous Fraud Detection System Marshal

Fraud Detection Agents at Scale, Built on MongoDB And Mastra — Ai4

Ai4

Consolidating data retrieval and workflow state in a single platform allows AI fraud agents to remain fully auditable and compliant under regulatory oversight.

AI-assisted summary of Fraud Detection Agents at Scale, Built on MongoDB And Mastra — original source. Check the original for full context.

Source published:

Detailed notes

## Background Ai4 published this video on YouTube on August 18, 2026. According to the page description, the session features Brandon Barros from Mastra and Mohammad Daoud Farooqi from MongoDB presenting "Marshal," an AI-driven fraud investigation console that combines MongoDB Atlas's unified vector, text, and graph retrieval with Mastra's durable workflows and audit trails.

## TL;DR The presentation addresses the operational and financial challenges of modern fraud detection, where balancing rapid legitimate transaction approvals with fraud prevention is critical. The speakers introduce Marshal, an AI agent system that leverages MongoDB Atlas for hybrid vector search, full-text search, and multi-hop graph retrieval alongside Mastra's durable workflow control plane. They walk through common fraud scenarios—including clean approvals, immediate rejections, A-B-C mule networks, and transaction structuring—to illustrate how deterministic workflows and human-in-the-loop steps operate. Finally, they highlight production readiness through Mastra's Trace Intelligence and runtime observability while advocating for data infrastructure consolidation on MongoDB Atlas.

## Atmosphere & style The session carries a practical, technical, and solution-oriented tone characteristic of an engineering tech talk. The dynamics between Mohammad and Brandon are collaborative and balanced, moving seamlessly from real-world human stakes and business dilemmas to technical architecture diagrams and workflow mechanics. Watching the talk feels like a structured deep dive for developers, grounding advanced AI agent concepts in concrete enterprise engineering and regulatory compliance.

## Key takeaways - [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) Mastra equips TypeScript developers with agent primitives, built-in observability, and evaluation metrics to build, track, and refine AI agents. - [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) MongoDB Atlas unifies OLTP transaction records, full-text search, vector search, hybrid search, and graph lookups in a single data layer. - [02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) Effective fraud detection requires surrounding AI models with multi-source evidence, strict policy guardrails, and audit trails rather than relying on simple LLM prompts. - [02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) When AI agents operate with low confidence, they must gracefully escalate flagged transactions to human review through human-in-the-loop workflows. - [05:21](https://www.youtube.com/watch?v=xw2c-M6svKc&t=321s) The Marshal console combines MongoDB's hybrid search and graph traversal with Mastra's durable workflows to process flagged payments. - [05:21](https://www.youtube.com/watch?v=xw2c-M6svKc&t=321s) Marshal detects complex financial fraud schemes like mule account traversal (A-B-C fraud) via graph lookups and amount structuring through historical aggregation. - [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) Mastra workflows bring determinism to agentic systems through sequential steps, branching, loops, and durable state snapshots. - [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) State snapshots in Mastra enable execution resilience, suspend-and-resume human approvals, retries, and time-travel debugging. - [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Mastra's Trace Intelligence categorizes agent execution traces across Goal, Behavior, Outcome, and Sentiment to drive a self-improving agentic learning loop. - [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Consolidating transactional, vector, graph, and full-text search workloads onto MongoDB Atlas prevents enterprise infrastructure sprawl.

## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) Introduction and Session Agenda

Mohammad Daoud Farooqi, Partner Solutions Architect for AI at MongoDB, and Brandon Barros, Founding Technical GTM and Special Projects Engineer at Mastra, introduce their presentation on building fraud detection agents at scale using MongoDB and Mastra. They outline a five-part agenda starting with an overview of both platforms, moving into fraud detection as a business problem, and showing how AI acts as a solution via a live demo of "Marshal"—an AI agentic fraud detection system. They then promise a look under the hood at how MongoDB and Mastra power Marshal, explain how to take a demo into a production-ready system, and wrap up with key takeaways.

Brandon introduces Mastra as a leading TypeScript AI agent framework and platform that equips developers with primitives to build, observe, and iterate on AI agents. He highlights Mastra's built-in observability for tracking execution traces step-by-step, along with evals, metrics, experiments, and trace intelligence to refine agents over time.

Mohammad explains that MongoDB serves as the essential data layer. Its flexible JSON document model functions as an OLTP system of record for application transactions. Beyond raw document storage, MongoDB Atlas provides full-text search, vector search, hybrid search, graph lookups via `$graphLookup` to traverse network hops, ACID transactions, and change streams to reliably trigger and capture every data change.

- Mastra boasts over 1.3 million weekly downloads on GitHub and is used by over 100,000 companies building TypeScript AI agents. - MongoDB unifies operational data storage with semantic retrieval (vector + full-text) and relationship graph traversal.

---

[02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) The Business Challenge of Fraud Detection and the Evolution of AI Solutions

Mohammad paints a vivid scene of the human and financial stakes in fraud detection: it is 4:47 p.m. on a Friday afternoon, and Maya, owner of a small construction business, submits a $3,200 payroll transaction. Her employees are depending on those funds on time for rent and childcare. Simultaneously, a massive $75,000 transaction hits the system and gets flagged. A human analyst faces a tough dilemma: rushing through approvals risks letting actual fraud slip by, but moving too slowly forces innocent people like Maya to suffer severe real-world delay.

The fundamental issue in modern fraud detection is not simply asking an LLM "is this fraud or not?" Instead, it requires surrounding the agent with scattered evidence, clear policy rules, and immutable audit trails, while identifying complex hidden relationships across account networks. Crucially, when an AI agent lacks high confidence, it must gracefully escalate the case to human review. Mohammad maps out how the industry reached this point: starting from basic manual database searches, advancing to Retrieval-Augmented Generation (RAG) for basic context, and culminating in modern autonomous AI agents capable of using tools, retrieving complex multi-source evidence, and logging fully auditable decisions.

- High-impact false positives create major friction for innocent users, while false negatives cause severe financial loss. - Audit trails must remain clear and intact so that decisions can be inspected by regulators or used for reinforcement learning even 6 months or years later.

---

[05:21](https://www.youtube.com/watch?v=xw2c-M6svKc&t=321s) Introducing Marshal: Features, Workflows, and Specific Scenarios

The speakers present "Marshal," a fraud investigation console and AI agentic system designed to handle flagged transaction queues. Every flagged payment enters a queue where MongoDB executes hybrid searches—blending vector similarity search for semantic matching with full-text search to pinpoint exact account numbers, amounts, and historical patterns—while Mastra orchestrates the agentic reasoning workflows. Policies and governance rules are maintained in MongoDB, enabling the agent to execute decisions against deterministic guardrails or flag low-confidence items for human review.

``` +-----------------------------------------------------------------+ | Flagged Transaction | +-----------------------------------------------------------------+ | v +-----------------------------------------------------------------+ | MongoDB Atlas Data Layer | | - Full-Text Search - Vector Search - Graph Hops ($lookup) | +-----------------------------------------------------------------+ | v +-----------------------------------------------------------------+ | Mastra Agent Control Plane | | - Reasoning & Prompts - Durable Workflows - Audit Traces | +-----------------------------------------------------------------+ | | v v [ High Confidence ] [ Low Confidence ] | | v v +-----------------+ +-----------------+ | Approve / Reject| | Human-in-Loop | | Auto-Resolution | | Review Queue | +-----------------+ +-----------------+ ```

Brandon and Mohammad walk through several distinct transaction patterns handled by Marshal: 1. **Clean Approval:** A routine, recurring payroll transaction to a known vendor is quickly matched against historic patterns with zero red flags and instantly approved. 2. **Strong Rejection:** A payment directed to an unknown overseas merchant immediately following a suspicious account login attempt is flagged and flatly rejected. 3. **Mule Account Traversal (A-B-C Fraud):** Entity A wants to send money to Entity C without triggering fraud alerts, so it routes funds through intermediary Entity B (a known "mule"). Marshal runs graph lookups, identifies previous A-to-B and B-to-C payments, uncovers the hidden link, and catches the scheme. 4. **Amount Structuring:** A user attempts to bypass a $5,000 regulatory reporting threshold (which requires SSN or PAN card details) by splitting transactions into multiple smaller amounts just below $5,000. Marshal tracks and aggregates these split transfers over time, flagging them for human review or rejecting them based on risk scoring. 5. **High-Value Escalation ($75,000 Transaction):** The agent gathers evidence, runs reasoning chains over historical data, and routes the transaction directly to a human reviewer alongside its chain of thought. Once the human takes action, the decision is written to an immutable audit log for future reinforcement learning.

---

[10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) Deep Dive into the Architecture: MongoDB Data Layer & Mastra Workflows

Mohammad details how MongoDB serves as the agent's memory and evidence engine while Mastra functions as its brain and control plane. On the database side, MongoDB Atlas provides vector search for semantic recall, `$search` for precise full-text search, reciprocal rank fusion (RRF) to combine text and vector scoring, and `$graphLookup` to trace financial hops across complex network graphs. Furthermore, every action and decision taken by the agent is preserved in a tamper-proof event stream.

On the application side, Brandon breaks down Mastra's core agentic control plane into three pillars: LLM reasoning logic, workflow orchestration, and deep runtime observability. He clarifies that workflows introduce deterministic structure into inherently non-deterministic AI architectures.

- **Sequential Steps:** Linear transitions from step A to B to C. - **Parallel Steps:** Simultaneous execution of independent sub-workflows. - **Branching:** Conditional routing based on intermediate logic (e.g., approve vs. suspend vs. reject). - **Loops:** Repeated retrieval or tool execution steps to gather additional context until confidence targets are met. - **Snapshots & Durability:** Workflows store full execution snapshots at every state transition. This powers suspend/resume for human-in-the-loop approvals, state retries, time-travel debugging, and multi-server execution resilient to system crashes.

---

[14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Moving from Demo to Production: Observability and Infrastructure Consolidation

Transitioning an AI agent from a controlled demo into a resilient, enterprise-scale production system requires robust observability and simplified infrastructure. Because Mastra integrates both the application framework and observability layer, it captures full execution traces directly at agent runtime—tracking every individual line of code, model invocation, and tool call without relying on manual instrumentation. Developers can evaluate token usage and monetary cost down to specific model, tool, or workflow steps.

Brandon highlights Mastra's newly released **Trace Intelligence** capability, which automatically categorizes execution traces across four dimensions: - **Goal:** The intended target or objective of the execution run. - **Behavior:** The concrete sequence of tool calls and actions taken. - **Outcome:** The final output or resolution achieved. - **Sentiment:** The tone or "vibes" recorded during the interaction.

Trace intelligence serves as the foundation for Mastra's self-improving "agentic learning loop," creating an automated iteration layer between evaluation metrics and source code. Mohammad concludes by warning against "infrastructure sprawl." Instead of maintaining four separate niche databases—one for transactional records, another for vector search, a third for graph processing, and a fourth for full-text search—enterprises can consolidate all workload types onto MongoDB Atlas to keep architecture simple, maintainable, and easy to scale under regulatory scrutiny.

- Attendees are invited to test the demo app, review the public GitHub repository, or reach out to `mongodbpartners@mongodb.com`. - Free copies of the AI agent development book authored by Mastra's CEO, Sam, are distributed by team member Ashwin after the session.

## Notable quotes > [02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) it is 4:47 p.m. on a Friday afternoon, and Maya, owner of a small construction business, submits a $3,200 payroll transaction. — Mohammad Daoud Farooqi

> [02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) High-impact false positives create major friction for innocent users, while false negatives cause severe financial loss. — Mohammad Daoud Farooqi

> [02:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=149s) Audit trails must remain clear and intact so that decisions can be inspected by regulators or used for reinforcement learning even 6 months or years later. — Mohammad Daoud Farooqi

> [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Goal, Behavior, Outcome, and Sentiment — Brandon Barros

## Mentioned Brandon Barros, Mohammad Daoud Farooqi, Mastra, MongoDB, MongoDB Atlas, Marshal, Ai4, GitHub, Sam, Ashwin

## Video description Brandon Barros - Founding Technical GTM, Masta Mohammad Daoud Farooqi - Partner Solutions Architect, A.I., MongoDB

Fraud detection in an agentic world is hard: evidence for a decision is scattered, only some calls should reach a human, and all must stay auditable. This talk builds Marshal, a fraud investigation console. It assembles the evidence server-side in MongoDB Atlas, running vector, text, and graph retrieval over one collection. Mastra's durable workflows wrap that in a deterministic flow that suspends for an approver and resumes. You get an audit trail, PII protection, and a clear path to self-improvement from production traces. Come if you're putting an agent where a regulator will look.

[Source](https://www.youtube.com/watch?v=xw2c-M6svKc)

中文简报

MongoDB 与 Mastra 推出自主欺诈检测系统 Marshal 将数据检索和工作流状态整合至单一平台,使 AI 反欺诈智能体在监管审查下保持完全可审计与合规。 本次演讲探讨了现代欺诈检测中的运营与财务挑战,即在快速审批合法交易与防范欺诈之间取得平衡至关重要。演讲者介绍了 Marshal,这是一个利用 MongoDB Atlas 进行混合向量搜索、全文搜索和多跳图检索,并结合 Mastra 持久工作流控制平面的 AI 智能体系统。他们详细讲解了常见的欺诈场景——包括合规通过、直接拒绝、A-B-C 钱骡网络以及拆分交易规避监管——以阐述确定性工作流与人机协同步骤的运作机制。最后,他们通过 Mastra 的 Trace Intelligence 与运行时可观测性展示了生产就绪能力,并倡导在 MongoDB Atlas 上整合数据基础设施。 Mastra 为 TypeScript 开发者提供智能体原语、内置可观测性和评估指标,用于构建、追踪与优化 AI 智能体。 (0:04) MongoDB Atlas 在单一数据层中统一了 OLTP 交易记录、全文搜索、向量搜索、混合搜索及图查询。 (0:04) 有效的欺诈检测需要为 AI 模型配备多源证据、严格的策略防线和审计追踪,而非仅依赖简单的 LLM 提示词。 (2:29) 当 AI 智能体置信度较低时,必须通过人机协同工作流顺畅地将标记交易上报进行人工审核。 (2:29) Marshal 控制台结合了 MongoDB 的混合搜索与图遍历能力以及 Mastra 的持久工作流,用以处理被标记的支付交易。 (5:21)

Reading summary

Mohammad Daoud Farooqi of MongoDB and Brandon Barros of Mastra demonstrate that production-grade fraud detection requires pairing unified data layers with durable, observable agent workflows rather than isolated LLM evaluations. Using their reference system, 'Marshal,' they show how combining hybrid search, graph traversal, and human-in-the-loop controls resolves complex financial fraud while preserving regulatory compliance. The Operational Tension Between Speed and Accuracy (2:29) Modern fraud operations face a continuous trade-off between user friction and risk exposure. Farooqi illustrates this dynamic with a scenario where an analyst must evaluate a routine $3,200 payroll transfer critical to a small business alongside a concurrent $75,000 flagged transaction. Rushing decisions creates severe financial losses through false negatives, whereas over-flagging delays legitimate transfers, disrupting essential customer operations. Farooqi argues that fraud detection cannot rely on simple, ungrounded binary prompts like asking a language model whether a payment is fraudulent. To address this dilemma, systems have evolved from static database lookups to Retrieval-Augmented Generation (RAG) and, finally, to autonomous agentic architectures. An effective fraud agent must evaluate surrounding evidence, enforce policy rules, trace relational account networks, and maintain immutable audit records. When confidence thresholds are not met, the system must deterministically escalate cases to human specialists so that decisions can be inspected by regulators or used for reinforcement learning months later. Targeting Complex Schemes with Graph and Pattern Analysis (5:21) The speakers present Marshal, an agentic fraud console built to evaluate flagged transaction queues through hybrid data querying and structured reasoning paths. Marshal executes deterministic actions for clear-cut items—such as auto-approving historical payroll or rejecting transfers initiated after suspicious logins to unverified overseas merchants—while deploying targeted logic for sophisticated criminal patterns. For intermediary evasion, known as 'A-B-C fraud,' the system uses graph lookups to discover hidden connections where Entity A routes capital to restricted Entity C through an intermediate mule account. To catch amount structuring (smurfing), the agent monitors and aggregates repeated transfers intentionally kept beneath regulatory reporting triggers, such as the $5,000 threshold that mandates tax identifier submissions. In high-value anomalies, such as an ambiguous $75,000 transfer, Marshal synthesizes historic evidence, details its chain of thought, and routes the case to human analysts, recording the final outcome to an immutable audit log. Architecting Deterministic Workflows on Unified Data (10:00) Marshal's technical design splits responsibilities between MongoDB Atlas as the underlying memory engine and Mastra as the orchestration control plane. Mastra introduces deterministic structures to non-deterministic model calls by utilizing sequential steps, parallel branches, and iterative retrieval loops. Barros highlights that Mastra captures complete state snapshots across every transition, which provides fault tolerance against crashes, enables time-travel debugging, and allows workflows to pause indefinitely until a human approves or rejects an escalation. Simultaneously, MongoDB acts as both the transactional store and the multi-modal evidence engine. Rather than moving data across disparate tools, the agent queries MongoDB using reciprocal rank fusion (RRF) to combine semantic vector search with full-text search (`$search`) for exact account IDs. It also leverages `$graphLookup` to trace entity relationships across multiple transactional hops, feeding real-time context into Mastra while logging every agentic intervention in an immutable change stream. Production Observability and Consolidating Infrastructure (14:02) Transitioning agentic systems from prototype to production requires granular observability and architectural simplicity. Barros explains that Mastra captures traces at the framework runtime—tracking every line of code, model invocation, tool call, token tally, and operational cost without separate instrumentation. Mastra's Trace Intelligence feature categorizes execution logs across four dimensions: goal, behavior, outcome, and sentiment, which creates a structured iteration loop to refine agent performance against real-world traffic. Farooqi cautions against 'infrastructure sprawl,' which occurs when organizations stitch together standalone engines for transactional records, vector search, graph analysis, and full-text search. Maintaining fragmented architectures complicates governance, multiplies failure points, and weakens audit integrity under regulatory scrutiny. Consolidating transactional workloads, vector indexing, text search, and graph traversal into MongoDB Atlas preserves a single source of truth for both autonomous agents and regulatory reviews. The presentation concludes that scalable agentic fraud detection depends on eliminating fragmented database architectures and bounding autonomous model reasoning with durable, observable workflows. The speakers emphasize that while agents can automate pattern analysis and routine decisions, regulatory accountability demands persistent audit trails and clear escalation paths for human intervention.

精炼阅读摘要

MongoDB与Mastra展示了名为“Marshal”的端到端AI反欺诈系统架构,主张通过将MongoDB的多模态数据层与Mastra的工作流编排及可观测性结合,解决传统反欺诈在误报摩擦、多跳资金网络洗钱与合规审计方面的挑战。 反欺诈业务痛点与决策两难 (2:29) MongoDB的AI合作伙伴解决方案架构师Mohammad Daoud Farooqi指出,金融欺诈侦测面临速度与合规的双重压力。例如在周五下午提交的3,200美元常规薪资交易,若被系统延误,会直接影响小微企业员工的日常生活;而若为了速度放行高风险的75,000美元交易,则可能导致巨额资产损失。误报不仅给无辜用户带来摩擦,漏报还会引发严重财务及声誉风险。 演讲者认为,现代反欺诈系统不能仅依赖大语言模型做出“是否欺诈”的二元判断,而必须为智能体提供结构化政策规则、分散的上下文证据以及防篡改的审计追踪链条。行业实践已从最初的单纯人工数据库查询,发展到利用检索增强生成(RAG)补充上下文,进而演化为具备工具调用、多源线索搜集以及低置信度优雅移交人工审查(Human-in-the-Loop)的自主智能体方案。 Marshal智能体系统与典型处置场景 (5:21) 基于MongoDB与Mastra构建的“Marshal”系统针对交易队列提供了自主调查与判定能力。该系统通过MongoDB执行混合检索,将向量相似度搜索与针对账号、金额及历史模式的全文检索相结合,并依托Mastra调度推理流程与确定性防护护栏。系统对高置信度场景实现自动审批或拒绝,低置信度场景则推送至人工审核队列。 团队展示了Marshal处理的具体业务场景:针对已知收款方的常规薪资发放,系统可在历史模式匹配无误后直接快速批准;面对可疑登录后立即向未知海外商户付款的操作,系统执行直接拒绝;在“A-B-C”钱骡洗钱链路中,系统通过图遍历追查中介账户资金流向并截获交易;针对规避5,000美元报备门槛的分拆交易(Amount Structuring),系统支持多笔交易的累计追踪;而在75,000美元等高金额异动中,智能体会整理证据链条并附带思维链推演,提交人工最终核验并记录至不可变日志。 数据底座与确定性工作流架构 (10:00) 在底层技术分工上,Farooqi将MongoDB定义为智能体的“记忆与证据引擎”,Mastra工程师Brandon Barros则将Mastra定位于“大脑与控制平面”。MongoDB Atlas在此方案中提供联机事务处理(OLTP)记录、向量检索、`$search`全文检索、结合两者的倒数排名融合(RRF)以及用于多跳网络分析的`$graphLookup`图查找,同时利用变更流(Change Streams)与事务机制生成防篡改审计轨迹。 为了给非确定性的大模型引入确定性业务结构,Mastra提供了支持顺序执行、并行处理、条件分支与循环检索的工作流引擎。Barros强调,该工作流具备快照与持久化能力,可在每次状态转换时完整记录执行状态,这支持了面对人工审核时的中断与恢复(Suspend/Resume)、状态重试、时间旅行调试,并提升了跨服务器运行时的系统抗崩溃容错性。 端到端可观测性与精简基础架构 (14:02) 将智能体从概念验证推向生产环境面临系统可观测性与架构复杂度的考验。Barros介绍,Mastra将应用框架与可观测层深度整合,在运行时无需手动插桩即可捕获涵盖代码行、模型调用与工具执行的完整调用链路,并支持细化至特定步骤的Token消耗与成本分析。其新推出的“Trace Intelligence”功能可从目标(Goal)、行为(Behavior)、结果(Outcome)与情绪(Sentiment)四个维度自动对执行轨迹进行分类,为智能体迭代提供闭环学习支持。 Farooqi针对系统架构提出了避免“基础设施蔓延”(Infrastructure Sprawl)的建议。他主张企业无需为了事务记录、向量检索、图遍历与全文搜索分别采购和维护四套独立的专用数据库,而是应将这些工作负载统一整合到MongoDB Atlas中,以在满足监管审计要求的同时,降低系统维护成本并简化生产扩展路径。 演示者展示了通过整合单一数据底座与强类型智能体框架构建生产级反欺诈系统的可行路径;但在大规模金融生产环境中,诸如智能体跨多跳复杂图网络分析的延迟上限、自学习闭环应对新型未知欺诈模式的鲁棒性,以及不同辖区合规要求的具体落地适配,仍有待更深入的实践检验。

Detailed notes — zh

## Background 本内容由 Ai4 频道于 2026 年 8 月 18 日发布在 YouTube 平台。视频由 Mastra 创始技术 GTM 专家 Brandon Barros 与 MongoDB AI 解决方案架构师 Mohammad Daoud Farooqi 共同主讲,介绍了如何利用 MongoDB Atlas 统一数据底座与 Mastra 持久化工作流框架,构建具备合规审计追踪与人机协同能力的大规模反欺诈 Agent 系统 Marshal。 ## TL;DR 演讲围绕金融风控场景下的反欺诈痛点展开,针对多源证据离散、误报代价高以及合规审计严苛等挑战,展示了 AI 反欺诈 Agent 系统 Marshal 的实战能力。系统利用 MongoDB Atlas 单一集合实现向量检索、全文搜索与图关联(Graph Lookup)的深度融合,并结合 Mastra 提供的持久化工作流(Durable Workflows)实现确定性流程控制与人机协同审核(Human-in-the-loop)。此外,演讲还深入拆解了 Mastra 的 Trace Intelligence 四维分析体系与 Agent 自进化闭环,为从实验 Demo 迈向生产级合规 Agent 提供了完整的落地架构方案。 ## Atmosphere & style 整场演讲兼具工程务实性与技术前瞻性,两位讲者配合默契、节奏紧凑,开篇以极具画面感的小企业发薪与大额欺诈对立故事迅速抓住听众注意力。随后的 Live Demo 与架构拆解层层递进,既展现了复杂的风控推演逻辑,又清晰呈现了代码级的工作流挂起与恢复机制,现场互动氛围热烈且充满极客探索感。 ## Key takeaways - [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) MongoDB 与 Mastra 联合推出用于规模化反欺诈的 AI Agent 架构,将统一数据底座与 TypeScript Agent 编排框架深度整合。 - [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) MongoDB Atlas 通过单套引擎统一承载 OLTP 事务、全文检索、向量混合检索与图查询(Graph Lookup),有效消除了多数据库并存的架构膨胀。 - [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) Mastra 提供开箱即用的 Agent 构建原语、全链路 Trace 追踪与 Evals 评估体系,支持生产级 TypeScript Agent 的快速构建与优化。 - [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 反欺诈系统正经历从传统人工搜索、RAG 检索增强向自主工具调用与人机协作(Human-in-the-loop)AI Agent 的演进。 - [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 反欺诈场景面临证据分散与误报代价高的挑战,所有 Agent 决策均需留存长达数年的不可篡改审计追踪(Audit Trails)以满足合规监管。 - [00:52](https://www.youtube.com/watch?v=xw2c-M6svKc&t=52s) 在演示系统 Marshal 中,已知供应商发薪可实现秒级直接批准,而异地异常登录与陌生海外转账会被系统直接拦截。 - [00:52](https://www.youtube.com/watch?v=xw2c-M6svKc&t=52s) 针对骡子账户中转与金额拆分避限(Structuring)等隐蔽欺诈,系统利用图查询穿透多跳交易网络以捕捉隐藏关联。 - [00:52](https://www.youtube.com/watch?v=xw2c-M6svKc&t=52s) 对于大额高风险交易(如 75,000 美元),Agent 会自动组装证据推理链并挂起工作流,实时推送到人工审核队列由分析师复核。 - [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) Mastra 凭借顺序、并行、分支与循环等工作流原语,在具备随机性的 LLM 之上构建出确定性的风控决策流程。 - [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) 持久化工作流(Durable Workflows)具备自动快照、挂起(Suspend)、人工恢复(Resume)与历史回放能力,支持跨服务器分布式长效运行。 - [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Mastra Trace Intelligence 从意图(Goal)、行为(Behavior)、结果(Outcome)和倾向(Sentiment)四个维度深度解析 Agent 生产环境运行轨迹。 - [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) 通过生产环境 Trace、Evals 评估与 Agent 优化层的闭环联动,系统能够实现代码与 Prompt 的持续迭代和自进化(Self-Improvement Loop)。 - [17:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=1022s) 从演示走向生产环境的核心挑战不在于构建 Demo,而在于建立具备合规审计追踪、完整证据链与高容错机制的生产级基础设施。 ## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) 架构与技术栈概览 演讲在热烈的氛围中开场。MongoDB 的 AI 合伙伙伴解决方案架构师 Mohammad Dawood Farooqi 与 Mastra 的创始技术 GTM 兼特种项目工程师 Brandon 共同登台,宣布了本次演讲的主题:如何在规模化场景下,结合 MongoDB 与 Mastra 构建反欺诈 Agent(Fraud Detection Agents)。 两位讲者迅速勾勒了整场演讲的脉络,涵盖系统框架介绍、业务痛点剖析、AI 解决方案与 demo 演示(演示系统名为 Marshal)、底层架构拆解、生产环境落地路径以及核心要点总结。接着,他们分别对各自的技术栈进行了直观定位: ```mermaid flowchart LR accTitle: System Architecture Overview subgraph Mastra["Mastra (Agent 框架与控制平面)"] direction TB A["Agent 构建 primitive"] B["可观测性与 Trace 追踪"] C["Evals 评估与实验迭代"] end subgraph MongoDB["MongoDB Atlas (数据与存储底层)"] direction TB D["JSON 文档模型 (OLTP)"] E["向量 / 全文 / 混合检索"] F["Graph Lookup / 变更流"] end Mastra <-->|工作流编排与证据调取| MongoDB ``` - **Mastra:** 作为领先的 TypeScript AI Agent 框架与平台,Mastra 提供了开箱即用的 Agent 构建原语、全流程可观测性(追踪 Agent 执行的每一步 Trace),以及用于持续优化的 Evals 评估与指标分析。 - **MongoDB Atlas:** 作为统一的数据底层,MongoDB 提供了灵活的 JSON 文档模型(作为应用事务的 OLTP 系统)、全文检索、向量检索以及两者融合的混合检索(Hybrid Search),同时具备图关联查找(Graph Lookup)、ACID 事务与变更流(Change Streams)。 - **Mastra 开发者生态数据:** GitHub 每周下载量已突破 130 万次,全球超过 10 万家公司正基于 Mastra 构建生产级 TypeScript Agent。 - **MongoDB 核心能力:** 通过单套引擎整合 OLTP 事务、混合检索与图查询,极大地简化了 Agent 所需的数据架构。 --- ### [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 反欺诈业务痛点与 AI Agent 的引入 Mohammad 用一个极具画面感的故事切入业务场景:在一个星期五的下午 4 点 47 分,小建筑公司老板 Maya 发起了一笔 3,200 美元的发薪交易。这笔钱对她的员工至关重要——有人等着交房租,有人等着付小孩的托儿费。这不仅仅是一笔转账,更是对员工的承诺。然而在同一时刻,银行系统中一笔高达 75,000 美元的交易触发了欺诈警报。 风控分析师面临着两难抉择:如果审得太快、草率批准,欺诈交易就会溜之大吉;如果查得太慢,像 Maya 这样合法合规的普通人就会深受其害。 ```mermaid flowchart TD accTitle: Evolution of Fraud Detection Systems A["传统简单搜索<br/>(分析师人工检索与关联数据)"] --> B["RAG 检索增强系统<br/>(基于上下文提供参考信息)"] B --> C["AI Agent 智能体系统<br/>(工具调用 + 混合检索 + 审计留痕 + 人机协作)"] ``` 过去依靠分析师手动在海量数据中摸索,后来演进到基于上下文的 RAG 系统,而如今则迈化为具备自主工具调用(Tool Use)、多模态检索与人机协作(Human-in-the-loop)能力的 AI Agent 时代。AI 之所以成为破局关键,是因为欺诈证据往往分散在不同的异构系统中,误报(False Positive)会造成极高的业务影响,且任何决策都必须留存长达数年的不可篡改审计追踪(Audit Trails),以应对监管合规要求。 - **多源分散证据:** 欺诈痕迹往往隐藏在跨账户、跨时间的离散事件中,需要图关联与语义检索协同。 - **合规审计要求:** 所有 Agent 作出的自动化决策,必须具备可溯源的推演链条,满足监管机构 6 年甚至更久的合规审计,并为后续的强化学习(Reinforcement Learning)积累数据。 --- ### [00:52](https://www.youtube.com/watch?v=xw2c-M6svKc&t=52s) 演示实战:Marshal 系统反欺诈案例解析 讲者现场展示了名为 **Marshal** 的 AI 反欺诈 Agent 系统。每笔被标记的疑虑交易都会进入人机协作队列,MongoDB 负责精准调取相关交易与治理策略,Mastra 则充当大脑进行逻辑推理与流程编排。 演讲中针对四种典型的欺诈/合法场景进行了逐一演示与分析: ```mermaid flowchart TD accTitle: Marshal Transaction Handling Flow Tx["待审交易输入"] --> Check{"分析与分类"} Check -->|已知供应商定时发薪| Pass["直接批准 (Clean Approve)"] Check -->|异地异常登录 + 陌生海外付款| Reject["直接拒绝 (Strong Reject)"] Check -->|骡子账户中转 / 拆分避限| Deep["深度图查询与规则校验"] Check -->|大额高风险交易 (75,000 美元)| HITL["挂起并推送到人工审核队列"] ``` 1. **直接批准(Clean Approve):** 已知供应商的定期发薪请求,系统匹配历史记录无异常后秒级通过。 2. **直接拒绝(Strong Reject):** 账户刚发生异常登录,紧接着向陌生海外商户发起大额转账,判定为高危欺诈并直接拦截。 3. **骡子账户与链路穿透(Mule Account & ABC Fraud):** 针对试图绕过风控的“A $\rightarrow$ B $\rightarrow$ C”间接交易(B 为骡子中转账户),Marshal 自动通过图查询与历史检索穿透链路,发现潜在的 A 到 C 隐藏关联并标记拦截。 4. **金额拆分与大额审核(Structuring & Human-in-the-loop):** 针对故意压低金额(如略低于 5,000 美元申报门槛)的频发拆分交易(Structuring),系统精准捕捉;而对于 75,000 美元的极高风险交易,Agent 生成完整推理链后挂起工作流,实时推送到前端供人工分析师复核决策。 - **混合检索与图查询组合拳:** 利用 Vector Search 捕捉语义相似性,`$search` 处理精确账号/金额匹配,Reciprocal Rank Fusion (RRF) 进行结果融合,再叠加 Graph Lookup 探测多跳网络。 - **不可篡改审计追踪:** 所有的判定证据链与人工审核动作均实时存入 MongoDB 审计日志,不仅满足合规要求,还可反哺模型自进化。 --- ### [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) 深入底层:MongoDB 与 Mastra 的协同机制 在探讨架构实现时,讲者详细拆解了 MongoDB 与 Mastra 如何分工协作:MongoDB 构筑了 Agent 的“记忆与证据链”,Mastra 则是 Agent 的“大脑与控制平面”。 为了在天然具备随机性(Non-deterministic)的 LLM 之上构建出确定性(Deterministic)的风控系统,Mastra 提供了极其丰富的工作流编排原语(Workflow Orchestration): ```mermaid flowchart TD accTitle: Mastra Workflow Primitives subgraph Flow["工作流编排模式"] direction LR S["顺序执行<br/>Sequential"] --> P["并行分支<br/>Parallel"] P --> B["条件分支<br/>Branching"] B --> L["循环检索<br/>Loops"] end subgraph Durability["状态持久化与状态机"] Snap["步骤快照 Snapshot"] --> Wait["暂停/挂起 Suspend"] Wait --> Resume["人工介入后恢复 Resume"] Resume --> Replay["重试与历史回放 Replay"] end Flow <--> Durability ``` - **状态快照与人机协作:** 工作流在每一步骤都会自动保存快照(Snapshots)与元数据。当需要人工审核时,工作流可直接“挂起(Suspend)”,待分析师在 UI 上点击确认后再“恢复(Resume)”,甚至支持历史步骤回放(Time Travel)与失败重试。 - **持久化工作流(Durable Workflows):** 支持跨服务器分布式部署,赋予工作流极高的容错性,使其不仅能运行几分钟,更能稳定持续运行数天甚至数周。 - **无代码 Agent 构筑器:** Mastra 正将持久化工作流能力集成至无代码 Agent Builder 中,降低复杂风控 Agent 的开发门槛。 - **MongoDB 数据层特质:** 提供高并发 OLTP 存储、语义检索层(Vector Search)以及账务图谱穿透能力。 - **Mastra 控制平面特质:** 提供 LLM 推理控制、确定性路由编排以及全栈运行时的可观测性。 --- ### [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) 迈向生产环境:持久化、可观测性与 Trace 智脑 从一个惊艳的 Demo 走向严苛的生产环境,核心在于持续的可观测性与长效稳定性。Brandon 特别强调,Mastra 兼具框架层与可观测性层,这使其能够深入 Agent 运行时的最底层——不只是捕捉 Agent 主动暴露的信息,还能追踪到每一次工具调用、每一行代码与工作流的具体执行 Trace。 此外,Mastra 刚刚发布了全新的 **Trace Intelligence** 功能,并展示了 Agent 闭环自进化(Agentic Learning Loop)的蓝图: ```mermaid flowchart LR accTitle: Mastra Trace Intelligence and Self-Improvement Loop subgraph TraceIntel["Trace Intelligence 四维分类"] G["Goal (意图)"] B["Behavior (行为)"] O["Outcome (结果)"] S["Sentiment (氛围/倾向)"] end subgraph LearningLoop["Agentic Learning Loop (自进化闭环)"] Traces["生产环境 Traces"] --> Eval["Evals 评估与瓶颈识别"] Eval --> AgentLayer["Agent 优化层"] AgentLayer --> Code["迭代源码与 Prompt"] Code --> Traces end TraceIntel --> LearningLoop ``` - **Trace Intelligence 四大维度:** 1. **Goal(意图):** 探究本次 Trace 运行的原始目标是什么。 2. **Behavior(行为):** 记录 Agent 采取了哪些具体的行动与工具调用。 3. **Outcome(结果):** 评估最终的产出与判定是否准确。 4. **Sentiment(氛围/倾向):** 分析 Agent 在执行过程中的交互特征与潜在偏置。 - **消除架构膨胀(Infra Sprawl):** 使用 MongoDB 替代以往需要分别搭建 OLTP 数据库、图数据库、向量数据库与全文检索系统的碎片化方案,极大地降低了运维与扩容成本。 - **细粒度成本监控:** 支持在 Model 级别、Agent 级别以及 Workflow 级别精确统计 Token 消耗与计费。 - **自进化闭环(Self-Improvement Loop):** 在 Evals 评估系统与源代码之间插入 Agent 优化层,实现基于生产环境 Trace 数据的自动迭代升级。 --- ### [17:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=1022s) 总结与资源获取 Mohammad 与 Brandon 总结道:构建一个 Agent Demo 并不难,真正的挑战在于将 Demo 转化为具备合规审计追踪、完整证据链与明确责任归属的生产级系统。MongoDB 与 Mastra 的结合,为这一演进路径提供了切实可行的技术底座。 演讲最后,讲者分享了相关资源并热情邀请现场观众交流: - **现场互动与试用:** 观众可扫描屏幕上的二维码体验基于 Mastra 运行的 Marshal 应用,或访问 GitHub 开源仓库获取全套代码与文档,直接部署在自己的基础设施上。 - **技术咨询与书籍赠送:** 两位讲者在会后留场解答问题,官方支持邮箱为 `mongodbpartners@mongodb.com`。此外,Mastra CEO Sam 撰写了关于 AI Agent 开发的新书,现场工作人员 Ashwin 为参会者免费赠送了实体书。 --- ## Notable quotes > [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 这笔钱对她的员工至关重要——有人等着交房租,有人等着付小孩的托儿费。这不仅仅是一笔转账,更是对员工的承诺。 — Mohammad Dawood Farooqi > [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 如果审得太快、草率批准,欺诈交易就会溜之大吉;如果查得太慢,像 Maya 这样合法合规的普通人就会深受其害。 — Mohammad Dawood Farooqi > [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) AI 之所以成为破局关键,是因为欺诈证据往往分散在不同的异构系统中,误报(False Positive)会造成极高的业务影响,且任何决策都必须留存长达数年的不可篡改审计追踪 — Mohammad Dawood Farooqi > [00:29](https://www.youtube.com/watch?v=xw2c-M6svKc&t=29s) 所有 Agent 作出的自动化决策,必须具备可溯源的推演链条,满足监管机构 6 年甚至更久的合规审计,并为后续的强化学习积累数据。 — Mohammad Dawood Farooqi > [00:04](https://www.youtube.com/watch?v=xw2c-M6svKc&t=4s) 通过单套引擎整合 OLTP 事务、混合检索与图查询,极大地简化了 Agent 所需的数据架构。 — Mohammad Dawood Farooqi > [00:52](https://www.youtube.com/watch?v=xw2c-M6svKc&t=52s) 针对试图绕过风控的‘A → B → C’间接交易(B 为骡子中转账户),Marshal 自动通过图查询与历史检索穿透链路,发现潜在的 A 到 C 隐藏关联并标记拦截。 > [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) MongoDB 构筑了 Agent 的‘记忆与证据链’,Mastra 则是 Agent 的‘大脑与控制平面’。 > [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) 为了在天然具备随机性(Non-deterministic)的 LLM 之上构建出确定性(Deterministic)的风控系统,Mastra 提供了极其丰富的工作流编排原语 — Brandon Barros > [10:00](https://www.youtube.com/watch?v=xw2c-M6svKc&t=600s) 当需要人工审核时,工作流可直接‘挂起(Suspend)’,待分析师在 UI 上点击确认后再‘恢复(Resume)’,甚至支持历史步骤回放(Time Travel)与失败重试。 — Brandon Barros > [14:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=842s) Mastra 兼具框架层与可观测性层,这使其能够深入 Agent 运行时的最底层——不只是捕捉 Agent 主动暴露的信息,还能追踪到每一次工具调用、每一行代码与工作流的具体执行 Trace。 — Brandon Barros > [17:02](https://www.youtube.com/watch?v=xw2c-M6svKc&t=1022s) 构建一个 Agent Demo 并不难,真正的挑战在于将 Demo 转化为具备合规审计追踪、完整证据链与明确责任归属的生产级系统。 — Mohammad Dawood Farooqi ## Mentioned MongoDB, MongoDB Atlas, Mastra, Marshal, Mohammad Dawood Farooqi, Brandon Barros, Sam, Ashwin, Maya, GitHub, Ai4 ## Video description Brandon Barros - Founding Technical GTM, Masta Mohammad Daoud Farooqi - Partner Solutions Architect, A.I., MongoDB Fraud detection in an agentic world is hard: evidence for a decision is scattered, only some calls should reach a human, and all must stay auditable. This talk builds Marshal, a fraud investigation console. It assembles the evidence server-side in MongoDB Atlas, running vector, text, and graph retrieval over one collection. Mastra's durable workflows wrap that in a deterministic flow that suspends for an approver and resumes. You get an audit trail, PII protection, and a clear path to self-improvement from production traces. Come if you're putting an agent where a regulator will look. [Source](https://www.youtube.com/watch?v=xw2c-M6svKc)

Source quotes

[0:29] Mohammad Dawood Farooqi: 这笔钱对她的员工至关重要——有人等着交房租,有人等着付小孩的托儿费。这不仅仅是一笔转账,更是对员工的承诺。 [0:29] Mohammad Dawood Farooqi: 如果审得太快、草率批准,欺诈交易就会溜之大吉;如果查得太慢,像 Maya 这样合法合规的普通人就会深受其害。 [0:29] Mohammad Dawood Farooqi: AI 之所以成为破局关键,是因为欺诈证据往往分散在不同的异构系统中,误报(False Positive)会造成极高的业务影响,且任何决策都必须留存长达数年的不可篡改审计追踪 [0:29] Mohammad Dawood Farooqi: 所有 Agent 作出的自动化决策,必须具备可溯源的推演链条,满足监管机构 6 年甚至更久的合规审计,并为后续的强化学习积累数据。 [0:04] Mohammad Dawood Farooqi: 通过单套引擎整合 OLTP 事务、混合检索与图查询,极大地简化了 Agent 所需的数据架构。 [0:52] 针对试图绕过风控的‘A → B → C’间接交易(B 为骡子中转账户),Marshal 自动通过图查询与历史检索穿透链路,发现潜在的 A 到 C 隐藏关联并标记拦截。 [10:00] MongoDB 构筑了 Agent 的‘记忆与证据链’,Mastra 则是 Agent 的‘大脑与控制平面’。 [10:00] Brandon Barros: 为了在天然具备随机性(Non-deterministic)的 LLM 之上构建出确定性(Deterministic)的风控系统,Mastra 提供了极其丰富的工作流编排原语 [10:00] Brandon Barros: 当需要人工审核时,工作流可直接‘挂起(Suspend)’,待分析师在 UI 上点击确认后再‘恢复(Resume)’,甚至支持历史步骤回放(Time Travel)与失败重试。 [14:02] Brandon Barros: Mastra 兼具框架层与可观测性层,这使其能够深入 Agent 运行时的最底层——不只是捕捉 Agent 主动暴露的信息,还能追踪到每一次工具调用、每一行代码与工作流的具体执行 Trace。 [17:02] Mohammad Dawood Farooqi: 构建一个 Agent Demo 并不难,真正的挑战在于将 Demo 转化为具备合规审计追踪、完整证据链与明确责任归属的生产级系统。

Source quotes

[2:29] Mohammad Daoud Farooqi: it is 4:47 p.m. on a Friday afternoon, and Maya, owner of a small construction business, submits a $3,200 payroll transaction. [2:29] Mohammad Daoud Farooqi: High-impact false positives create major friction for innocent users, while false negatives cause severe financial loss. [2:29] Mohammad Daoud Farooqi: Audit trails must remain clear and intact so that decisions can be inspected by regulators or used for reinforcement learning even 6 months or years later. [14:02] Brandon Barros: Goal, Behavior, Outcome, and Sentiment

Original transcript

[0:04] Thanks you all for joining us today.  Today we'll be discussing about fraud [0:08] detection agents at scale using MongoDB  and Mastra. I'm Mohammad Dawood Faruqi, [0:12] a partner solutions architect for AI at MongoDB.  And My name is Brandon. I'm the founding technical [0:18] go-to-market and special projects engineer at  Mastra. Now to start off, a quick summary of what [0:24] we're going to go over today. First, we're just  going to do an overview of Mastra and MongoDB. [0:29] In section two, we're going to talk about fraud  detection as a business problem. In section three, [0:35] we're just we're then going to go into where AI  comes in as a perfect solution to this problem [0:40] and demo Marshall, which is our AI agentic system  that helps you detect fraud. In section four, [0:47] we're going to take a look under the hood and  see how MongoDB and Mastra build out Marshall. [0:52] And in section five, we're going to journey over  to how you take something like this, a great demo, [0:57] and get it ready for production. And then  to wrap up, we're just going to talk about [1:01] some of the takeaways from today's chat.  And so to start off as an introduction, [1:08] what is Mastra? Mastra is a leading  TypeScript AI agent framework and platform. [1:14] So it gives you all the tools you need to  build, observe, and iterate on AI agents. [1:20] First, you can build out great agents with our  framework that has a ton of powerful primitives [1:24] out of the box. You can use our observability  functionality to see exactly where your agents [1:30] are at and track their traces every single step  they're taking. And you can also use our evals, [1:36] metrics, and experiments, and trace intelligence  to help build your agents over time. Mastra has [1:43] over 1.3 million weekly downloads on GitHub, and  over 100,000 companies are building their agents [1:48] on Mastra. So if you're looking to get TypeScript  agents into production, Mastra is a great place [1:54] to get started. And so what is MongoDB giving  you? MongoDB is providing you the data layer. [2:00] It is giving you the documents, a flexible JSON  document model that can store your transactions, [2:05] serve as your OLTP system of records for your  app. It gives you search, full-text search, [2:11] vector search, and a combination of both being the  hybrid search. It also gives you the graph look [2:16] up, so you can traverse the network hops. And it  gives you asset transactions and change streams, [2:22] so that every change gets triggered  and captured and stored safely. [2:29] So, the fraud detection problem. So, consider  it's Friday afternoon around 4:47 p.m. And Maya, [2:37] who owns a small construction company, makes  a transaction to pay payroll of around $3,200. [2:43] And one of her employees needed for  rent, the other needs it for child care. [2:49] It's not just a transaction that Maya made, it's  a promise to her employees that the money will [2:54] reach on time when they need it. And at the  same time, there is a $75 $75,000 transaction [3:01] happening in the bank, which got flagged.  Now, the problem for the analyst, it has to [3:10] analyze all these transactions. And  if he's too quick to approve them, [3:16] a fraudulent transaction might miss out. And if  he takes a lot of time, people like Maya suffer. [3:24] Now, it's not the problem that we have to ask the  agent whether it's a fraud or not. It's providing [3:33] the AI agent with evidence, the auditable trails,  the right policies with consistency, the rules [3:39] that are hardcoded every time, and making it  get the relationships between the transactions [3:46] and having the human review it when the AI is not  able to make the decision with a high confidence. [3:54] Now, how does AI come into picture and how is AI  going to support these financial transactions? [4:03] Why do we need AI for this one? Because  evidence is scattered across different systems. [4:10] The false positive cases could  provide a higher impact to a larger uh [4:20] audience. And ambiguity must be escalated  when it's not sure on how to act clearly. [4:31] And every decision must must have an audit  trail so that the decision could be used for [4:35] reinforcement learning and it can be traced when  an auditor is looking into it after 6 months. [4:42] Now, how did we get from these searches  to the agent state that we are here today? [4:46] Initially, we just had simple searches.  You can look into your data. The uh [4:51] the analyst could look into your data sets.  They all the transactions and would have to find [4:57] uh meaning themselves to figure out whether  these transactions are fraudulent or not. Then, [5:01] we got the rack. The rack system helped the uh  transaction analyst to analyze with some context. [5:08] And now we have the AI agents which have the  capability to extract your data using tools, [5:14] retrieve them, uh show the results,  and have decisions logged properly. [5:21] Now, we have the Marshall app, a fraud detection  demo that we built on Mastra and [ __ ] [5:27] Every transaction that gets flagged  is in the queue for a human review. [5:32] MongoDB helps you retrieve the relevant  transaction based on the full-text searches, [5:36] the hybrid search that gets you the similar  transactions uh based on the vector similarities, [5:42] and also combines the full-text search results  for finding exact accounts, exact amounts, [5:47] and exact transactions that has  happened similarly to the current one. [5:52] Mastra gives you the brain for the AI agent.  It helps you orchestrate the complete workflow, [5:59] and when a review is required, the human  in the loop gets the notification for it. [6:06] The governance and the policies are the rule  sets that we provide are stored into MongoDB, [6:11] and the agents can retrieve it and take action  according to the rules and policies, and provide [6:16] a govern governance-ready auditable trail that  is tamper-proof. So, what we get from this one? [6:24] We get speed, and we get audit audit uh traces,  and we get accuracy over time. And you can [6:33] justify your decisions even after 6 years or so.  And you can see all this in our live dashboard. [6:41] All right. Now, we're going to dive in  and actually take a look at Marshall. So, [6:45] we're going to leave that QR code up for a  moment if you want to actually follow along [6:49] and play with Marshall yourself, but then I'm  going to dive in into a few specific cases. [6:55] So, I'll leave it up for a few more moments. I  see a lot of excited people here. Are you trying [6:58] it out? So, I'll give you all a chance. There  will also be a QR code again at the end. So, [7:02] don't feel like if you missed it now, you won't be  able to get it. All right. So, let's run through [7:07] a few example transactions that Marshall tackles.  First, let's start with a simple, clean approve. [7:14] Here, we have a use case where it's a recurring  payroll payment from a known vendor. So, [7:19] what Marshall is going to do is going to look for  previous transactions, recognize that this is a [7:24] common transaction, no red flags at all, can  just approve and move forward. Pretty simple. [7:32] Now, on the other side, let's look at  something that's a strong reject. In this case, [7:37] this is a payment to an unknown overseas  merchant that immediately follows a specific [7:44] a suspicious login attempt from the payee. So,  here we'll see that Marshall is going to go in, [7:51] figure out all this information, and flag this  as a very clear fraudulent transaction attempt. [7:58] So, those are two sort of extreme ends of  the spectrum. Let's take a look at something [8:01] that's a bit more in the middle. Here, we  have a transaction between two vendors, [8:07] but the vendor paying is known to be a mule.  Which what a mule does is it sits in the middle [8:13] of two different entities and helps control their  payment. So, if A wants to control wants to pay C, [8:20] but knows that it will be flagged as fraud,  they'll use B as a payment in the middle to [8:24] get around that. So, what we'll see here,  and I'll start the video from the front, [8:32] what we'll see here is this is the B to C  payment. It's going to then search to see [8:36] if it can find any payments from A to C. It found  them and recognizes this as an ABC fraud attempt. [8:48] The next one we have is the amount structuring. [8:55] Consider you're only allowed to uh transact  around $5,000, and above that you need an SSN [9:02] or a PAN card, usually in India. Someone making  such transaction can just lower the amount just [9:08] below the threshold and do multiple transactions.  Those transactions could be traced, dragged, and [9:13] we can have it reviewed, and the LLM could himself  reject those if needed based on the score. And the [9:19] agents do that as well. The next one. Now, this is  the $75,000 transaction that we are talking about. [9:28] For this one, the agent is going to retrieve  the relevant transactions, reason over it, [9:35] and give it for the human review with reasoning  chain whether it should be approved or not and [9:41] it depends on the human in the loop to approve it,  store it or reject it. And these go into the audit [9:47] trail if you see on the right hand side and these  will also be used as a reinforcement learning for [9:53] the future transaction that could come up and  these decisions are in an immutable audit trail. [10:00] Now, how MongoDB and Maestro are working together  here. MongoDB provides the agent its memory [10:09] and the evidence trail. Maestro serves as the  agent's brain and provides the control plane. [10:18] MongoDB provides you with the operational data, [10:22] the semantic retrieval layer and the  relationship between these transactions. [10:32] MongoDB is giving you the vector search  capabilities for semantic recall, the dollar [10:37] search for the full text search retrievals  to find exact accounts and audit trails. [10:43] The rank fusion combines both of them to give  you a better result sets of best of both worlds. [10:49] And the graph look up helps you to find [10:52] uh the hops among accounts and how the money  is going and to track around the trails. [11:00] MongoDB lets you store every AI decision in an  audible trail for every action that AI agent takes [11:09] and which is a tamper-proof [11:11] evidence that could be referred whenever the  auditor needs it and could be reasoned around it. [11:19] And then on the Maestro end, Maestro  is the whole agentic control plane. So, [11:24] there's a few different pillars to this. First,  all the agent logic where we're using the LLM to [11:29] actually discern all the different evidence  we're getting and draw conclusions from it. [11:34] Also, the workflow orchestration, which was this  deterministic routing we saw in each step that [11:39] Marshall took when it was analyzing transactions.  And finally, the observability, which helps you [11:45] get a look into all your previous runs and  get an idea of what your agent has been doing. [11:51] I know we've all been talking a lot about agents  this week and observability I'm going to touch [11:54] on a little bit later. So, I'm going to dig  into workflow orchestration a little bit. [12:01] So, just at a high level, what is a workflow? It's  a deterministic series of steps that you can put [12:06] into your agentic system to give it determinist  determinism in a naturally non-deterministic [12:13] infrastructure. So, this is basically just  a high-level 101 of some of the things you [12:18] can do with workflows in Mostra. You can have  sequential steps where you just go A to B to C. [12:24] You can have parallel steps, multiple workflows  running at the same time. You can branch into [12:29] different categories and that's kind of like what  we saw with Marshall where sometimes it would [12:34] approve a transaction, sometimes it would hold  it, and those would have different outcomes. So, [12:39] that's a branch step where we go down different  paths depending on the information we receive. [12:44] And also, loops, which we saw in Marshall when  it would do the retrieve step multiple times to [12:49] gather more information. And you can build so much  more out from there, but that's just a high-level [12:55] starting point with workflows. And another thing I  want to highlight with workflows is that they save [13:00] snapshots, which is basically all the information  and metadata you have at every step of a workflow. [13:07] This opens the door to be able to do things like  suspend resume functionality, human in the loop, [13:13] workflow retries, and also time travel or  replaying your workflows from previous steps. [13:19] So, we saw a lot in previous examples  how Marshall would pause a workflow, [13:24] wait for human input, and then continue. And  that's possible thanks to Monstrous Workflows. [13:30] And the last thing I want to highlight here is  we also have durable workflows, which means you [13:34] can have your workflows distributed across servers  to make them more resilient to different crashes, [13:41] making sure that they can run not just for  minutes or hours, but days or weeks at a time. [13:47] You can also integrate into your  infrastructure. We're building out [13:50] the ability to build out these workflows, these  durable workflows on our no-code agent builder. [13:56] And when you integrate that with our durable  agents, you make a really robust agentic system. [14:02] Which is the perfect lead-in to our next  topic, which is getting a demo to production [14:07] and how you do this reliably with MongoDB and  Monstrous. So, what this demo has showed so far [14:13] is it solves a real problem and it can run  in this controlled environment. But how do [14:17] we make sure that it's something that we can  run at scale in production, that we can do [14:23] not just for minutes or hours, but for days,  and also have the observability around it to [14:28] make sure we're improving it consistently over  time and tracking what's going on under the hood? [14:35] And to chat a little bit about how MongoDB and  Monstrous come together to help you get there, [14:40] to start with Monstrous, as I mentioned  before, durable workflows is one ingredient [14:45] to that recipe, but I want to touch  a bit more on observability here. [14:49] Since Monstrous is both the framework layer  and the observability layer, that gives you [14:54] access to traces that are actually at agentic  runtime. So, rather than your observability just [14:59] seeing whatever the agent exposes to it, every  single tool call, every workflow, every line of [15:05] code that your agent is running is something  Monstrous observability can have insight on. [15:10] You also can set up your evals through Monstrous,  see metrics like your token usage and cost, [15:17] not just at an agent level, but  at a model level, at a at a level, [15:21] at a workflow level. So, you get a very  granular look at what's going on under the hood. [15:26] And we also have a ton of guardrails that you can  build out or use our out-of-the-box solutions. [15:34] And one thing new to Maestra that I want  to highlight here is trace intelligence, [15:37] which we just announced last week. And basically,  it categories categorizes your traces into four [15:43] areas: goal, what was the intent of your trace,  behavior, what actions did it perform, outcome, [15:50] what was the result, and sentiment, what were  the vibes associated with that agent run. [15:55] This helps you start to identify patterns where  maybe you notice certain behaviors lead to [16:00] certain outcomes, and then can start adjusting  your agentic code to handle these bottlenecks. [16:06] And this is also the first step in Maestra's  agentic learning loop, which is a focus of ours [16:11] right now, which is creating an agent layer  in between your evals and your source code [16:16] to consistently automatically iterate on your  agent and have this self-improvement loop. [16:30] MongoDB is helping you prevent the infra sprawl.  Instead of setting four different databases [16:36] for your system of records, for your graph  lookups, for your vector searches, and for [16:41] your search indexes, you can all consolidate them  in a single system. It gives you the complete data [16:48] foundation layer that your developers will love  and which will be easier to scale and maintain. [16:57] So, what's the takeaway from this? [17:02] The hard part isn't getting a demo created  for an agent, it's the demo that's get built [17:10] and turned into a go-on system with the audible  traces, the evidences, and accountability. MongoDB [17:18] and Mastra gives you a credible path for creating  your demos into production systems. You can scan [17:25] the QR code to try out the Mastra app that that is  running the Marshall. And we also have the second [17:34] QR code as the GitHub repo with the documentation  and the code that you can deploy it on your infra. [17:44] Thank you all for being here today. If you  have any questions, you can reach out to us. [17:49] We will be available and you can also  contact us at mongodbpartners@mongodb.com. [17:55] And you can also fill out the form  that Marshall provides you. So, [18:00] Yep, and I want to quickly mention we'll both be  around after this talk to chat with you guys if [18:04] you want to go through anything. And Mastra's  CEO, Sam, actually wrote a book that covers a [18:09] ton of this stuff with AI agent development. And  I have my coworker, Ashwin, over there who's ready [18:14] to give you free copy. So, if you're interested  in learning about more stuff like this, feel [18:18] free to go see Ashwin and get a free copy of the  book. Thank you, everyone. Thank you. [applause]