Samples Gallery

Explore ready-to-run code samples that show how to build real-world applications with DocumentDB

9 samples

𝗧𝗦
TypeScript

AI/ML

Intermediate

Personal AI Memory: Cross-Platform MCP Server with DocumentDB Vector Search

A TypeScript MCP server that gives any AI assistant β€” Copilot CLI, Claude, Gemini β€” persistent personalized memory backed by DocumentDB. Uses a 4-layer retrieval strategy: cosmosSearch vector similarity, full-text search indexes, array tag queries, and regex fallback. Demonstrates DocumentDB's vector search (pgvector), MongoDB wire protocol compatibility, text indexes, atomic update operators, and flexible document schema in a practical AI application.

MCPAI MemoryVector SearchFull-Text SearchText IndexExpressRAGDocumentDB OSSOpen Source
View on GitHub
𝗧𝗦
TypeScript

AI/ML

Intermediate

Hotel Recommendation Agent: RAG with Native Vector Search and LLM Synthesizer in TypeScript

A TypeScript app that uses DocumentDB OSS native vector search to retrieve semantically similar hotels from a natural-language query, then passes the results to a LlamaIndex synthesizer agent (llama3.2 via Ollama) to generate a concise, comparative recommendation. Runs entirely on open-source tools with no cloud accounts required.

Vector SearchAI AgentLlamaIndexOllamaEmbeddingsRAGDocumentDB OSSOpen Source
View on GitHub
⬑
Node.js

AI/ML

Intermediate

BookFinder: AI-Powered Semantic Book Discovery

A Node.js/Express app that uses OpenAI embeddings and DocumentDB vector search to let users discover books through natural language queries like 'dystopian future with rebellion'.

Vector SearchOpenAIEmbeddingsExpressSemantic Search
View on GitHub
⬑
Node.js

Retail

Beginner

Retail Product Store: Full-Stack Product Catalog with DocumentDB

A Node.js/Express app backed by DocumentDB that serves a responsive retail storefront with product browsing, category filtering, sort, and keyword search. Products are stored in DocumentDB and served via a REST API, with a vanilla JS frontend.

ExpressREST APIDocumentDB OSSVanilla JSFull Stack
View on GitHub
🐍
Python

Financial Services

Intermediate

Fraud Detection Multi-Agent System: Retrieval, Analysis, and Decision Agents with DocumentDB Vector Search

A Python app that uses a three-agent pipeline β€” Retrieval, Analysis, and Decision β€” to classify transactions as APPROVE, REVIEW, or BLOCK. The Retrieval Agent finds similar historical transactions using DocumentDB OSS native vector search; the Analysis Agent uses llama3.2 via Ollama to identify risk patterns; the Decision Agent issues the final verdict with a confidence score. Runs entirely on open-source tools with no cloud accounts required.

Vector SearchMulti-AgentFraud DetectionOllamaEmbeddingsRAGDocumentDB OSSOpen Source
View on GitHub
🐍
Python

Media & Publishing

Beginner

Content Semantic Search Portal: Semantic Search Over Articles, Blogs, and PDFs

A Python/Flask web portal that stores articles, blogs, and PDF documents as MongoDB documents with vector embeddings in DocumentDB OSS. Users search by meaning using natural language and receive semantically ranked results by cosine similarity. Supports ingesting custom .txt and .pdf files alongside sample content. Built entirely on open-source tools with no cloud accounts required.

Vector SearchSemantic SearchFlaskEmbeddingsOllamaPDFDocumentDB OSSOpen Source
View on GitHub
🐍
Python

Healthcare

Intermediate

Clinical Note Similarity Explorer: Find Similar Cases with DocumentDB Vector Search

A Python/Flask web app that stores de-identified fictional clinical notes with vector embeddings and metadata in DocumentDB OSS. Clinicians and researchers can search for similar cases using natural language clinical descriptions, filtered by medical specialty, with results ranked by semantic similarity. All notes are fictional sample data. Built entirely on open-source tools.

Vector SearchSemantic SearchFlaskEmbeddingsOllamaClinical NLPDocumentDB OSSOpen Source
View on GitHub
🐍
Python

DevOps / Observability

Intermediate

Activity Log & Notification Service: Real-Time Event Ingestion with FastAPI, Beanie, and DocumentDB

A production-style async Python backend that ingests high-volume activity events via FastAPI, stores them in DocumentDB using the Beanie ODM (backed by PyMongo async), and exposes endpoints to query recent activities, compute server-side aggregation statistics ($facet pipeline), and stream real-time ERROR alerts to clients over WebSockets.

FastAPIBeaniePyMongoREST APIWebSocketAggregationDocumentDB OSSOpen Source
View on GitHub
𝗧𝗦
TypeScript

Retail

Intermediate

Contoso Retail: Hybrid Cloud/Edge Store with Live DB Switching, Replication, and Vector Search

A TypeScript/Express retail application that runs the same code against Azure DocumentDB (managed cloud) and OSS DocumentDB (local containers) β€” switchable in real time from the UI. Features product catalog with vector similarity recommendations (Ollama + nomic-embed-text), inventory management across 3 warehouses, order processing with sync-to-Azure, and live hybrid replication with animated latency visualization. Built for the talk: 'One Codebase, Any Cloud: Building a Retail Database with OSS and Azure DocumentDB'.

Vector SearchHybrid CloudReplicationExpressOllamaEmbeddingsDocumentDB OSSAzure DocumentDBDockerFull Stack
View on GitHub

Want to contribute a sample?

Open a Pull Request