{item.heading}
+-
+ {item.points.map((point) => (
+
- + + {point} + + ))} +
diff --git a/app/ai/page.tsx b/app/ai/page.tsx new file mode 100644 index 0000000..190d948 --- /dev/null +++ b/app/ai/page.tsx @@ -0,0 +1,506 @@ +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} +
+{description}
++ Easy start for AI teams +
++ 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. +
++ 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. +
++ 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. +
++ {item.label} +
+{item.description}
+{item.description}
+{item.value}
++ {item.label} +
+ {"detail" in item && item.detail && ( +{item.detail}
+ )} ++ Go from zero to vector search in four commands. Open source, self-hosted, MIT-licensed. +
+{item.description}
-