Agentic development—□×

Agentic development with Azure Cosmos DB

Why Cosmos DB fits AI applications, and how its developer experience is becoming agentic-first.

DevGlobe
An open-source talent graph where humans and AI agents discover developers through public contribution evidence.
Sajeetharan Sinnathurai Sajeetharan Sinnathurai
Principal Product Manager · Azure Cosmos DB
Developer Experience and AI
DevGlobe

An open-source talent graph

Humans and AI agents discover developers through public contribution evidence—not popularity alone.

Agent Kit · Shell + MCP · VS Code · Emulator01 / 2015:17
Quick Poll—□×
What is hardest about AI + data?Quick poll

What is hardest about AI + data?

The hard part is turning an AI demo into a reliable, safe system.

No votes yet.

All three matter · architecture, code, and safety02 / 2015:18
AI Application Patterns—□×
One database, five AI application patternsStory 01
Azure Cosmos DB logoAzure Cosmos DB
DB
Operational + vector

No ETL between fresh application data and semantic retrieval.

R
RAG

Ground LLM responses on governed, continuously changing data.

CH
Conversation history

Persist context, feedback, audit trails, and user state.

C
Semantic cache

Reuse meaningfully similar responses to reduce latency and tokens.

A
AI agents

Store durable state, checkpoints, transactions, and telemetry.

The common need: low-latency operational data, flexible JSON, global distribution, and multiple retrieval modes close to the application.
One database · five AI application patterns03 / 2015:20
Why Agent-first Matters Now—□×
The audience for our guidance has changedAgent-first

The audience for our guidance has changed.

Agents read more of the docsThey retrieve documentation, samples, schemas, and repository context before generating an answer.
Agents make more implementation decisionsAPI choice, data model, query shape, retries, and indexing can be selected before human review.
Every mistake is amplifiedWeak guidance becomes repeated code. Strong, retrievable guidance makes the preferred path repeatable.
The shift: documentation is no longer only content people read. It is context agents use to make decisions and write code.
Human judgment remains accountable; agent decisions happen earlier04 / 2015:21
The Product Shift—□×
Agentic-firstStory 02

“Agentic-first” means the correct path is discoverable, executable, and verifiable by an agent.

KnowSkills provide domain judgment.
ActMCP provides bounded capabilities.
VerifyLive results and diagnostics close the loop.
One workspace: design, connect, query, inspect, and verify without leaving VS Code.
Expertise + tools + feedback05 / 2015:22
Agent Kit—□×
Know · Azure Cosmos DB Agent KitAgent Kit

Cosmos DB expertise, available when agents code

Why Agent Kit: Cosmos DB can get expensive when key concepts are applied poorly, and those concepts take time to learn. Agent Kit brings the right guidance into your code.
#1Skill within Azure
45,000Accepted code edits in the last three months
Expert rulesData modeling, partitioning, queries, indexing, SDK usage, vector search, and local development.
Progressive contextThe agent loads guidance relevant to the current task instead of carrying one large prompt.
Inside the workflowGuidance shapes generated code and reviews across compatible coding-agent hosts.
Agent Kit · aka.ms/cosmosdb-agent-kit06 / 2015:24
Agent Kit Learnings—□×
Build · Measure · ImproveSkill learnings

What we learned building a production skill

Evaluate decisionsUse realistic tasks and score the architecture, query, and code choices—not whether the answer repeats the guidance.
Scope narrowlyDefine clear triggers, exclusions, and task-specific context. Load only the guidance needed for the decision in front of the agent.
Learn from useTurn failures, ambiguous prompts, and accepted edits into regression cases; remove stale or conflicting rules as the product evolves.
The loop: observe real behavior, add a discriminating eval, tighten the skill, and rerun the suite before publishing.
Evaluate decisions · scope narrowly · learn from use07 / 2115:25
Agent Kit Design Review—□×
Turn a naive proposal into a workload-driven designLIVE DEMO
Paste into Copilot Agent mode
Review this Azure Cosmos DB design.

Workload:
- Point-read a developer by login
- Rank developers by country and language
- Update stars and followers daily

Proposal: one container, partition key /country.

Use Cosmos DB Agent Kit guidance. Identify risks,
ask for missing scale details, then recommend the
model, partition key, indexes, queries, and SDK pattern.
State assumptions and do not edit files yet.
01
Clarify

Access patterns, cardinality, traffic distribution, growth, and consistency.

02
Challenge

Explain why /country can create skew and why ranking queries may fan out.

03
Recommend

Produce alternatives with tradeoffs, targeted projections, index needs, and SDK practices.

Demo · Agent Kit design review07 / 2015:26
Cosmos DB Shell—□×
Feature · Cosmos DB ShellConnected

A command-line workspace for Cosmos DB

An interactive shell for navigating Cosmos DB resources, inspecting data, and running NoSQL queries from a concise command surface.

Navigate databases and containers
Inspect items and approximate schema
Run and iterate on queries quickly
Use the same tool vocabulary in demos and agent workflows

cosmos shell
$ connect
$ cd /devglobe/developers
$ info
$ query -m 5 'SELECT TOP 5
  c.login, c.name, c.location, c.topLanguage
  FROM c'
Navigate resourcesInspect schemaRun queries
Cosmos DB Shell · aka.ms/cosmosdbvscode08 / 2015:27
Model Context Protocol—□×
Feature · Model Context ProtocolMCP

MCP turns database operations into agent tools

DiscoverableThe agent receives structured tool names, descriptions, inputs, and outputs instead of guessing commands.
GroundedTools can inspect live schema and data so answers reflect the connected environment.
GovernedIdentity, resource scope, result limits, approvals, and audit trails bound what the agent can do.
Use it when: an agent must move beyond advice and safely perform visible, reviewable Cosmos DB operations.
Discoverable · grounded · governed09 / 2015:29
Shell with MCP—□×
Act · Cosmos DB Shell with MCP5 steps

The command line becomes an agent tool surface

1
Intent

Natural-language intent

2
Plan

Agent plans

3
Invoke

MCP invokes shell tools

4
Execute

Cosmos DB executes

5
Explain

Agent explains + cites result

Safety boundary: least-privilege identity, scoped database/container access, visible tool calls, and approval before mutation.
Intent · plan · invoke · execute · explain10 / 2015:31
Human First, Agent Second—□×
Start broad. Inspect. Then refine.LIVE DEMO
cosmos shell · devglobe / developers
$ connect
$ cd /devglobe/developers
$ query -m 5 'SELECT TOP 5 c.login, c.name,
  c.location, c.topLanguage FROM c'

5 live developer profiles returned

$ query 'SELECT VALUE COUNT(1) FROM c'
Live container count returned

Copilot › Show five developer profiles and summarize which fields are available.
Keep the generated query visible; do not hide the tool call11 / 2015:33
VS Code Extension—□×
From intent to inspected result without leaving the editor4 features
01
ExploreConnect to an account or emulator; browse databases, containers, items, and stored procedures.
02
NL2QueryDescribe the result in natural language, inspect the generated NoSQL query, then execute.
03
Query assistanceExplain, edit, and troubleshoot queries with schema-aware context and editor support.
04
Agent actionsBring skills and MCP calls into Copilot’s visible, reviewable workflow.
Inspect before execute · aka.ms/cosmosdbvscode12 / 2015:35
Natural Language to Query—□×
Feature · Natural language to queryNL2Query

NL2Query converts intent into a reviewable query

1
Describe

Describe the result

2
Ground

Ground on schema

3
Generate

Generate NoSQL query

4
Review

Review, run, refine

Good forExploration, query learning, and faster first drafts.
Always inspectPartition filter, projection, TOP/pagination, parameters, and ordering.
Then improveAsk for an explanation, lower-RU alternative, or required index policy.
Generate quickly; execute deliberately13 / 2015:37
Query Editor Assistance—□×
Help at the point where queries are writtenEditor
01
Authoring supportSyntax awareness, formatting, completion where available, and a focused query document.
02
ExplainTranslate an unfamiliar query into intent, filters, ordering, and expected result shape.
03
Edit with intentRefine projections, filters, limits, and parameters using natural-language instructions.
04
Review riskSurface likely fan-out, indexing needs, unbounded results, and expensive access patterns.
Query assistance · exact capabilities vary by extension version14 / 2015:38
NL2Query Demo—□×
Demo beat · NL2Query + query assistanceLIVE DEMO

Natural language in. Reviewable query out.

“Show the top 10 Python developers in Brazil with more than 1,000 followers.”
SELECT TOP 10
  c.login, c.name, c.followers, c.totalStars
FROM c
WHERE IS_DEFINED(c.location)
  AND CONTAINS(c.location, "Brazil", true)
  AND c.topLanguage = "Python"
  AND c.followers > 1000
ORDER BY c.totalStars DESC
Ask Copilot: “Explain the RU risks. Project only what the chart needs. Tell me whether this needs a composite index.”
NL2Query accelerates authoring; review protects architecture15 / 2015:42
Migration Assistant—□×
Migrate access patterns, not tablesMigration Assistant

Relational source

developers
countries
languages
repositories
developer_repositories

Candidate document

{
  "id": "octocat",
  "location": "San Francisco, CA, USA",
  "topLanguage": "TypeScript",
  "followers": 18400,
  "topRepos": [ ... ]
}
Assistant output should include: model rationale, partition-key options, unsupported assumptions, migration steps, and workload validation.
Human owns the model; the assistant shortens the analysis16 / 2015:44
Cosmos DB Emulator—□×
Verify · Cosmos DB EmulatorLocal

Give the agent a fast, disposable feedback loop

01Start local

Launch the emulator and connect the extension.

02Provision

Create database, container, partition key, and index policy.

03Seed + test

Load synthetic OSS profiles and exercise real queries.

04Inspect + revise

Review failures, query metrics, RU patterns, and generated code.

Local first; cloud configuration stays environment-specific17 / 2015:46
The Complete System—□×
An agentic Cosmos DB development loopComplete
1
Intent

Intent + access patterns

2
Plan

Agent Kit plans

3
Act

VS Code / Shell acts

4
Verify

Emulator verifies

5
Revise

Evidence drives revision

The agent becomes useful when it can learn from the result, not merely generate the first draft.
Design · act · observe · improve18 / 2015:48
Takeaway—□×
Takeaway3 principles

Build for AI apps.
Build for AI-assisted developers.
Build with bounded agency.

Cosmos DBOperational + vector + state
Agentic-firstKnow + act + verify
Human in the loopApprove high-impact actions and verify outcomes
One last question for swag: What should an agent never do without human approval?
Build with bounded agency19 / 2015:49
Go Further—□×