From 4f96c240d89c489ec715693614cd270d8c4bf017 Mon Sep 17 00:00:00 2001 From: Guanzhou Song Date: Fri, 20 Mar 2026 14:25:35 -0400 Subject: [PATCH 1/2] Add page for ai compatibility --- app/ai/page.tsx | 505 ++++++++++++++++++++++++++++++++++++++ app/components/Navbar.tsx | 6 + app/data/samples.ts | 50 ++++ app/page.tsx | 40 ++- 4 files changed, 592 insertions(+), 9 deletions(-) create mode 100644 app/ai/page.tsx diff --git a/app/ai/page.tsx b/app/ai/page.tsx new file mode 100644 index 0000000..1291d13 --- /dev/null +++ b/app/ai/page.tsx @@ -0,0 +1,505 @@ +import Image from "next/image"; +import Link from "next/link"; +import CommandSnippet from "../components/CommandSnippet"; +import { getMetadata } from "../services/metadataService"; +import { withBasePath } from "../services/sitePath"; + +export const metadata = getMetadata({ + title: "DocumentDB for AI - Vector Search, RAG, and Embeddings", + description: + "Build AI applications with DocumentDB: a Mongo API-compatible document model, native vector search, PostgreSQL reliability, and self-hosted deployment.", + extraKeywords: [ + "AI database", + "vector search", + "RAG", + "embeddings", + "open source vector database", + "Mongo API compatible", + "pgvector", + ], +}); + +const quickRunCommand = `docker run -dt --name documentdb \\ + -p 10260:10260 \\ + ghcr.io/documentdb/documentdb/documentdb-local:latest \\ + --username admin --password password`; + +const connectCommand = `mongosh "mongodb://admin:password@localhost:10260/?tls=true&tlsAllowInvalidCertificates=true"`; + +const createIndexCommand = `db.runCommand({ + createIndexes: "documents", + indexes: [{ + key: { embedding: "cosmosSearch" }, + name: "vector_idx", + cosmosSearchOptions: { + kind: "vector-hnsw", + similarity: "COS", + dimensions: 1536 + } + }] +});`; + +const vectorSearchCommand = `db.documents.aggregate([ + { + $vectorSearch: { + queryVector: [0.12, -0.04, 0.31, /* ... 1536 dims */], + path: "embedding", + limit: 10, + numCandidates: 100, + filter: { category: "technical" } + } + } +]);`; + +const heroBadges = [ + "Start locally in minutes", + "Mongo API-compatible", + "Native vector search", + "MIT licensed", +]; + +const beforeAfter = [ + { + title: "Before", + accent: + "border-red-500/20 bg-red-500/5 text-red-200 shadow-[0_24px_80px_-50px_rgba(239,68,68,0.45)]", + heading: "Typical AI stack", + points: [ + "App database for documents and metadata", + "Separate vector database for embeddings", + "Extra data sync and failure modes between systems", + "More moving parts, more cost, more things to break", + ], + }, + { + title: "After", + accent: + "border-emerald-500/20 bg-emerald-500/5 text-emerald-200 shadow-[0_24px_80px_-50px_rgba(16,185,129,0.45)]", + heading: "DocumentDB stack", + points: [ + "BSON documents and embeddings stored together", + "Native vector search with filtering in one database", + "Geospatial, graph, and 40+ aggregation stages in one system", + "Simpler architecture with PostgreSQL-backed operations", + ], + }, +]; + +const quickStartSteps = [ + { + step: "01", + title: "Run locally with Docker", + description: + "One command to start DocumentDB on port 10260 with local credentials.", + label: "Docker", + code: quickRunCommand, + }, + { + step: "02", + title: "Connect with mongosh", + description: + "Connect with mongosh, pymongo, the Node.js driver, or another standard Mongo client.", + label: "Shell", + code: connectCommand, + }, + { + step: "03", + title: "Create a vector index", + description: + "Create a native HNSW vector index with cosine similarity for embedding retrieval.", + label: "Index", + code: createIndexCommand, + }, + { + step: "04", + title: "Query by meaning", + description: + "Retrieve semantically similar results with vector search and optional metadata filters.", + label: "Vector search", + code: vectorSearchCommand, + }, +]; + +const useCases = [ + { + badge: "RAG", + title: "RAG and grounded chat", + description: + "Store chunks, metadata, and embeddings together so retrieval stays close to the source document.", + points: [ + "Pre-filter by category, source, or recency before retrieval", + "Return source text alongside similarity scores", + ], + }, + { + badge: "Search", + title: "Semantic search", + description: + "Search products, knowledge bases, or support histories by meaning instead of exact keyword match.", + points: [ + "Choose cosine, L2, or inner product for your domain", + "Mix vector results with metadata filters in one query", + ], + }, + { + badge: "Agents", + title: "Agent memory", + description: + "Store conversation state as BSON documents and retrieve past context with vector similarity.", + points: [ + "Persist tool outputs, plans, and dialogue turns naturally", + "Recall relevant history without scanning entire threads", + ], + }, + { + badge: "Graph + AI", + title: "Knowledge navigation", + description: + "Find the best vector matches, then traverse related entities with `$graphLookup` in one query pipeline.", + points: [ + "Recursive traversal with depth control", + "Useful when retrieval also needs relationship traversal", + ], + }, +]; + +const credibilityPoints = [ + { + value: "3.2k+", + label: "GitHub stars", + }, + { + value: "200+", + label: "Forks", + }, + { + value: "11", + label: "TSC members", + detail: "across 5 organizations", + }, +]; + +const contributorLogos = [ + { + name: "Microsoft", + src: "/images/AzureLogo.png", + }, + { + name: "Amazon", + src: "/images/AWS%20Logo.png", + }, + { + name: "Rippling", + src: "/images/Rippling%20Logo%20no%20background.png", + }, + { + name: "YugabyteDB", + src: "/images/YugabyteLogo.png", + }, + { + name: "AB InBev", + src: "/images/AB%20InBev%20transparent%20logo.png", + }, +]; + +function SectionIntro({ + eyebrow, + title, + description, +}: { + eyebrow: string; + title: string; + description: string; +}) { + return ( +
+

+ {eyebrow} +

+

+ {title} +

+

{description}

+
+ ); +} + +export default function AIPage() { + return ( +
+
+
+
+
+

+ Easy start for AI teams +

+

+ Stop juggling databases for AI +

+

+ Documents, vectors, and search in one Mongo API-compatible system. +

+

+ Run locally with Docker, use familiar Mongo drivers and tools, and + keep documents plus embeddings together — no extra sync layer needed. +

+
+ + Start with Docker + + + Explore AI/ML Samples + +
+
+ {heroBadges.map((badge) => ( + + {badge} + + ))} +
+
+ +
+
+ + Quick start + + + Vector search in minutes + +
+

+ Four commands to your first vector search +

+

+ Start DocumentDB with Docker, connect with mongosh, create a vector + index, and run a semantic query. +

+
+ +
+
+
+

+ API +

+

Mongo API-compatible

+

+ Use familiar Mongo drivers and tools. +

+
+
+

+ Indexing +

+

HNSW + IVFFlat

+

+ Choose the right vector algorithm for recall, scale, and cost. +

+
+
+

+ Retrieval +

+

Vector search

+

+ Filter by metadata and return similarity scores. +

+
+
+
+
+
+ +
+
+ +
+ {beforeAfter.map((item) => ( +
+ + {item.title} + +

{item.heading}

+
    + {item.points.map((point) => ( +
  • + + {point} +
  • + ))} +
+
+ ))} +
+
+
+ +
+
+ +
+ {quickStartSteps.map((item) => ( +
+
+ + {item.step} + +

+ {item.label} +

+
+

{item.title}

+

{item.description}

+
+ +
+
+ ))} +
+
+ + Follow the full Docker quick start + + + See the Python setup + +
+
+
+ +
+
+ +
+ {useCases.map((item) => ( +
+ + {item.badge} + +

{item.title}

+

{item.description}

+
    + {item.points.map((point) => ( +
  • + + {point} +
  • + ))} +
+
+ ))} +
+
+
+ +
+
+ +
+ {credibilityPoints.map((item) => ( +
+

{item.value}

+

+ {item.label} +

+ {"detail" in item && item.detail && ( +

{item.detail}

+ )} +
+ ))} +
+
+ {contributorLogos.map((logo) => ( +
+ {logo.name} +
+ ))} +
+
+
+ +
+
+

+ Ready to try it? +

+

+ Go from zero to vector search in four commands. Open source, self-hosted, MIT-licensed. +

+
+ + Start with Docker + + + View on GitHub + +
+
+
+
+ ); +} diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 78c5188..2b9d917 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -69,6 +69,12 @@ export default function Navbar() { > Docs + + AI + {item.description}

-
- {item.highlights.map((highlight) => ( - +
+ {item.highlights.map((highlight) => ( + + {highlight} + + ))} +
+ {item.href ? ( + - {highlight} -
- ))} + {item.linkLabel} + + ) : null}
))} From d67d8ec2b27a4a6915b455f97420c8bf2195ba1f Mon Sep 17 00:00:00 2001 From: Guanzhou Song Date: Fri, 20 Mar 2026 15:13:12 -0400 Subject: [PATCH 2/2] fix words --- app/ai/page.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/ai/page.tsx b/app/ai/page.tsx index 1291d13..190d948 100644 --- a/app/ai/page.tsx +++ b/app/ai/page.tsx @@ -280,11 +280,12 @@ export default function AIPage() {

- Four commands to your first vector search + Start locally with one Docker command

- Start DocumentDB with Docker, connect with mongosh, create a vector - index, and run a semantic query. + Spin up DocumentDB with Docker, then follow the four-step quick + start below to connect with mongosh, create a vector index, and + run your first vector search.