BRK365 · Breakout
Build self-optimizing AI agents with Azure Cosmos DB and Fabric
Speakers: Stef Arroyo, Jai Maldonado, Mike Calvin
Microsoft’s player cannot open a video at a given time: once it plays, skip to the time shown.
What the session covers
The session builds Cosmos Voyager, a Python/LangGraph multi-agent travel planner that uses Azure Cosmos DB for app data, embeddings, LangGraph checkpoints and long-term agent memory, plus an optimization policy document that the supervisor reads on every turn to route prompts to model tiers. Agent telemetry is mirrored into OneLake with Fabric Mirroring, analyzed by an LLM in a Spark notebook, and written back to Cosmos DB through reverse ETL, so a dashboard can apply tiered model routing without redeployment. Kinectify then presents its roughly 20-agent AML/KYC platform: its failure modes, an LLM call recorder, observer agents and quality gates, and three telemetry lessons (no sampling, unit-of-work correlation, resilient telemetry). Kinectify closes the loop with Fabric data agents and an hourly Copilot scheduled task that proposes improvements for human approval. Two Fabric mirroring extensions (MongoDB API and mirroring TTL) are announced in private preview.
Best for: Architects and developers who run multi-agent apps in production and want concrete patterns for telemetry, cost and latency analysis, and policy-driven optimization on Cosmos DB and Fabric.
New material starts at 33:26. Until 33:26 the session walks through the reference architecture and Kinectify's observability setup, all rated incremental; at 33:26 Kinectify shows how it closes the loop with Fabric shortcuts, data agents and hourly Copilot scheduled tasks.
Where to skip: Start at 02:04 for the architecture and skip the Cosmos DB recap at 07:55. The core runs from 11:57 to 21:43: the policy document, then Fabric mirroring, the LLM analyst notebook and the dashboard. Next watch Kinectify's architecture and lessons from 24:11 to 31:13 and the closed loop with Fabric data agents and Copilot scheduled tasks at 33:26. The announcements are at 37:00; the Q&A at 39:33 is optional.
Chapters (18)
- 00:00 Recap Depth 100 · Novelty 0/3
Session intro and the post-launch challenge of improving AI agents
Stephanie Arroyo (Azure Cosmos DB PM) introduces the session with Jai Maldonado and announces Mike Calvin from Kinectify as a later guest. The session covers two parts: building a multi-agent app on Azure Cosmos DB, and using Microsoft Fabric to analyze agents and feed optimizations back into the live app. Jai frames the core problem: after launch it is hard to know whether answers are good, where token costs and latency grow, and how to make simple tweaks such as model switches or memory pruning without a full redeployment.
- 02:04 Deep dive Depth 300 · Novelty 1/3
Cosmos Voyager architecture: supervisor, specialist agents and Cosmos DB as the single store
Jai describes Cosmos Voyager, a Python/LangGraph travel planner where a supervisor agent coordinates a find-places agent and an itinerary agent across about 3,000 locations in 50 cities, while Microsoft Foundry embeds queries for vector and full-text search. Specialized agents get smaller contexts and can be updated independently. Azure Cosmos DB stores app data with embeddings alongside it (no separate vector database), checkpoints execution state via the Cosmos DB connector for LangGraph, and holds long-term user memory via the Cosmos DB agent memory toolkit. An optimization policy container is introduced for later use.
- 05:07 Demo Depth 200 · Novelty 1/3
Demo: Cosmos Voyager memories and a Bahamas trip personalized from stored preferences
Stephanie shows the Explore page and the Profile & Memories tab, where a summarized user knowledge snapshot is saved roughly every 20 turns by the Cosmos DB memory toolkit. Stored memories are extracted from chat and classified (fact, episodic) with a salience score used for retrieval. She then asks the agent to plan a Bahamas trip with dinner recommendations; the orchestrator and sub-agents return a two-day itinerary with vegetarian restaurants, because the stored memory says the user is vegetarian even though the prompt did not.
- 07:55 Recap Depth 100 · Novelty 0/3
Azure Cosmos DB recap: NoSQL, DiskANN vector search, scale-out and ChatGPT scale
Stephanie recaps Azure Cosmos DB as a distributed NoSQL JSON database with flexible schemas, vectors stored next to transactional data, and DiskANN vector and hybrid search from Microsoft Research. It scales out horizontally via a partition key with automatic partitioning. She cites OpenAI's ChatGPT running chat history and user memory on Cosmos DB at over a billion users, 100 petabytes (the slide shows 500PB) and over 70 million requests per second.
- 09:59 Demo Depth 300 · Novelty 1/3
Demo: Cosmos DB containers for messages, agent memory and LangGraph node executions
Using the Azure Cosmos DB extension in VS Code, Stephanie browses the TravelAssistant database. The messages container stores one record per chat message rather than one long document for faster retrieval; the agent memory container holds extracted content, type, salience score and embeddings. The node executions container, written via the Cosmos DB LangGraph integration, checkpoints each agent hand-off with agent type, model and token consumption for recovery and debugging.
- 11:57 Deep dive Depth 300 · Novelty 1/3
Optimization policy document: per-turn tiered model routing without redeployment
Jai shows the optimization policy container: a JSON document the LangGraph supervisor reads on every turn to pick a model by prompt complexity (slide: trivial to gpt-5-nano, routine to gpt-5-mini, complex to gpt-5.1), plus a classifier field and an audit record of who changed the policy and when, making changes reversible. The flow is four steps: receive the message, load the active policy from Cosmos DB, classify the prompt and pick the model tier, and answer with the updated behavior on the very next turn.
- 13:53 Deep dive Depth 300 · Novelty 1/3
Why Fabric: zero-ETL mirroring to OneLake and reverse ETL back to Cosmos DB
Jai explains Microsoft Fabric as the analytics piece that separates heavy analytical scans from single-digit-millisecond operational traffic. Fabric Mirroring copies Cosmos DB containers into OneLake in near real time as Delta Parquet with zero ETL, free replication compute, some free storage by SKU, and no impact on transactional RUs. Spark notebooks build gold-layer insights and write them back via the Spark connector; changes can be applied through user data functions from Power BI or a custom analytics portal.
- 15:52 Demo Depth 300 · Novelty 1/3
Demo: setting up Cosmos DB mirroring and an LLM analyst Spark notebook with reverse ETL
Jai creates a Mirrored Azure Cosmos DB item from New item in a Fabric workspace, then opens an existing mirror showing replicated containers, row counts and last-completed times; about 200 user turns produced far more rows due to agent-to-agent traffic. In a Spark notebook, transformed data is passed to an LLM analyst prompted to propose exactly one change as strict JSON, with deterministic guardrails shown in the notebook. The insights are written back to the optimization insights container in Cosmos DB through the Spark connector.
- 19:18 Demo Depth 200 · Novelty 1/3
Demo: agent optimization dashboard applies tiered model routing and shows savings
A custom Agent Optimization Dashboard reads insights written back to Cosmos DB. It shows all turns used a single model, and the Optimizations tab lists LLM-proposed capability-tiered model selection and memory retention (pruning stale memories), each with Apply/Revert. Applying tiered selection creates a new policy; subsequent turns route to mini and nano models instead of only gpt-5.1, with an estimated saving of about $3 over roughly 1,000 extra turns, which the speaker extrapolates to large scale.
- 21:43 Customer story Depth 100 · Novelty 1/3
Kinectify intro: AML compliance platform and launching a live EDD review
Kinectify is introduced as an anti-money laundering compliance platform for gaming and hospitality built on Azure and Microsoft Fabric. CTO Mike Calvin explains they ingest player and transaction data from casinos, sportsbooks and daily fantasy operators to detect suspicious activity and support federal reporting. He starts a live enhanced due diligence (EDD) review in the customer intelligence module, entering player details; each review enriches data with third-party providers, summarizes risk and takes about 5 to 7 minutes.
- 24:11 Customer story Depth 300 · Novelty 1/3
Kinectify's ~20-agent architecture and production failure modes
The customer intelligence module uses about 20 agents: domain-specialized agents, observer agents monitoring execution, and an orchestrator entry point, built with Semantic Kernel and Microsoft Agent Framework in both C# and Python, running research, evaluate and complete stages. In a private-preview beta they hit stuck reviews caused by structured output not adhering to inter-agent interfaces, false positives from data matching the wrong person, and traditional APM practices that did not fit a non-deterministic system.
- 27:05 Customer story Depth 300 · Novelty 1/3
LLM call recorder and quality gates: Cosmos DB, Blob Storage and Application Insights
Kinectify built an LLM call recorder that writes raw LLM request/response content to Cosmos DB, raw third-party HTTP traffic to Blob Storage, and telemetry such as tokens, model and round-trip time to Application Insights, all surfaced in an admin portal. This visibility let them improve research agents, iterate on prompts and fix structured I/O problems. They added more observer agents to check third-party data relevance, a channel for agents to ask the analyst questions, and a final relevancy check before results are returned.
- 29:16 Customer story Depth 300 · Novelty 1/3
Three production lessons: no sampling, unit-of-work correlation, resilient telemetry
Mike shares three lessons. Completeness: non-deterministic agents vary in how many exchanges they make, so telemetry must be complete with no sampling. Cardinality: monitor the unit of work (one correlation ID per EDD across all agents) rather than individual services. Resilience: telemetry must never impact production, e.g. continue working if Application Insights logging limits are hit.
- 31:13 Demo Depth 200 · Novelty 1/3
Demo: completed EDD report and admin trace view showing a failed web scraper agent
Mike returns to the completed EDD for the test subject Clarence, showing a high-risk executive summary with adverse media and legal information. He then opens the admin portal, where each review shows models used, requests, responses, logs and per-agent timing. In this case the timeline shows the Web Scraper agent failed, telling the team what the report is missing.
- 33:26 Customer story Depth 300 · Novelty 2/3
Kinectify closes the loop: Fabric shortcuts, data agents and hourly Copilot scheduled tasks
Kinectify mirrors Cosmos DB into Fabric and uses shortcuts for its Log Analytics workspace and Blob Storage data, combining all telemetry in Fabric. They built Fabric data agents over this data that recommend, for example, which model a given agent should use. The data agent was moved into the Copilot app, where data science and engineering teams run a scheduled task every hour that reviews recent KYCs and suggests improvements; changes still require human approval, with low-risk self-optimization a future goal.
- 37:00 New Depth 200 · Novelty 2/3
Cosmos DB announcements: MongoDB API mirroring and mirroring TTL in private preview
Stephanie says Cosmos DB continues to invest in vector search, embeddings, semantic re-ranking, agent memory and retrieval for agentic apps. For enterprise workloads, the Fabric connection is extended with mirroring for Cosmos DB for MongoDB API and mirroring TTL, which adds data retention policies to replicated data in OneLake; both are stated to be in private preview with QR sign-up. She also mentions easier local build and test with existing tools like VS Code, and recaps the capabilities shown: LangGraph connector, agent memory toolkit, Fabric mirroring, reverse ETL and DiskANN vector search.
- 38:31 Closing Depth 100 · Novelty 1/3
Open-source samples, new Cosmos DB AI developer certification and booth
Stephanie states that everything shown is available as open-source samples and documentation via QR codes (the slide lists the Cosmos DB Agent Kit and Cosmos + Fabric samples links). She mentions a new Azure Cosmos DB AI developer certification and Cosmos DB plushies at the booth, then opens Q&A.
- 39:33 Q&A Depth 200 · Novelty 0/3
Q&A: snapshotting agent memory for debugging output drift
An attendee asks whether the Copilot SDK has connectors to snapshot complete agent memory into Cosmos DB to debug drift in agent output. The speakers point to the Cosmos DB agent memory toolkit, which captures agent knowledge as a summary snapshot every few turns and stores it in Azure Cosmos DB. The session closes with an invitation to the booth.
Announcements (3)
-
Fabric mirroring for Azure Cosmos DB for MongoDB API
Extends the Cosmos DB connection to Fabric so Cosmos DB for MongoDB API data can be mirrored.
Speaker’s quote (at 37:28)
„including Cosmos DB for Mongo API, mirroring TTL, which adds data retention policies to your replicated data in OneLake. And these are now all in private preview.“
-
Mirroring TTL
Adds data retention policies to Cosmos DB data replicated into OneLake.
Speaker’s quote (at 37:28)
„including Cosmos DB for Mongo API, mirroring TTL, which adds data retention policies to your replicated data in OneLake. And these are now all in private preview.“
-
Azure Cosmos DB AI developer certification
A new certification for developers building AI applications on Azure Cosmos DB.
Speaker’s quote (at 38:31)
„We also have a new Azure Cosmos DB AI developer certification.“
Demos (6)
-
Show how a multi-agent travel app uses long-term user memory stored in Cosmos DB to personalize recommendations without the user restating preferences.
Steps (6)
- Open the Cosmos Voyager Explore page with city, date and traveler selection.
- Open the Profile & Memories tab and review default preferences on the left.
- Review the summarized user knowledge snapshot on the right (saved about every 20 turns).
- Scroll to Stored memories to see extracted items with type classification and salience score.
- Return to Explore, open the chat assistant and ask for a Bahamas trip with dinner recommendations.
- Check that the returned two-day itinerary recommends vegetarian restaurants based on stored memory.
Prerequisites: Azure Cosmos DB account with the Cosmos Voyager sample (Python, LangGraph) and the Cosmos DB agent memory toolkit; the speakers say the samples are open source.
-
Show developers how app data, agent memory and agent execution state for a multi-agent app are modeled in Cosmos DB containers.
Steps (4)
- Open the Azure Cosmos DB extension in VS Code and expand the account and the TravelAssistant database.
- Query the messages container to see one record per chat message.
- Query the agent memory container to see content, type, salience score and embeddings.
- Open the node executions container to see per-agent checkpoints with agent type, model and tokens consumed.
Prerequisites: VS Code with the Azure Cosmos DB extension and access to a Cosmos DB account populated by the sample app.
-
Replicate agent telemetry from Cosmos DB into OneLake, let an LLM in a Spark notebook detect issues and propose changes, and write the insights back to Cosmos DB.
Steps (7)
- In a Fabric workspace, click New item and select Mirrored Azure Cosmos DB.
- Enter the Cosmos DB account endpoint and select the containers to replicate.
- Open the mirrored item and check the replication monitor (tables, rows, last completed).
- Inspect the OptimizationTurns table with node execution data (complexity tier, AI model).
- Open the Spark notebook that transforms the mirrored data.
- Run the LLM analyst cell that proposes one change per detected issue as strict JSON.
- Run the cell that writes insights back to the optimization insights container via the Cosmos DB Spark connector.
Prerequisites: Fabric workspace with capacity, a Cosmos DB account with agent telemetry containers, and the Cosmos DB Spark connector; samples are said to be open source.
-
Review LLM-generated optimization recommendations and apply a tiered model routing policy to the live agent app without redeploying code.
Steps (4)
- Open the Agent Optimization Dashboard overview and check turns by model.
- Go to the Optimizations tab and review the capability-tiered model selection and memory retention cards.
- Click Apply on capability-tiered model selection to write a new policy into the optimization policy container.
- Generate more turns and observe them routed to mini and nano models with estimated savings shown.
Prerequisites: The sample app, mirrored data and notebook from the previous steps; the dashboard is a custom web app from the sample.
-
Show compliance engineers how a completed multi-agent EDD review can be traced per agent to spot failures.
Steps (4)
- Open the completed KYC review and its Executive Summary tab.
- Review the risk summary, red flags and adverse media.
- Open the admin portal for the same review.
- Inspect the timeline and select the failed Web Scraper step to view run details and activity logs.
-
Use a Fabric data agent over mirrored and shortcut telemetry to recommend agent and model optimizations for a data science team.
Steps (5)
- Open the Fabric workspace containing mirrored Cosmos DB data and shortcuts to Log Analytics and Blob Storage.
- Preview telemetry tables such as AppRequests_Prod.
- Open the KYC Review data agent and review its instructions and data sources.
- Ask the data agent a question about which models or agents to optimize.
- Publish the data agent to the Copilot app and create an hourly scheduled task.
Prerequisites: Fabric workspace with mirrored Cosmos DB data and shortcuts to Log Analytics and Blob Storage; access to the Copilot app for scheduled tasks.