The complete MongoDB Developer Day vector search workshop reimagined as a VAI CLI workflow. Use it as a backup during the Vector Search: Beginner to Pro lab or afterward to reinforce concepts: set up local MongoDB, install the CLI, generate embeddings with voyage-4-nano, create a vector index, and run semantic search — end to end from the command line.
• Docker installed (for local MongoDB Atlas) or access to a MongoDB Atlas cluster.
• Node.js >= 18 installed.
• VAI CLI installed globally: `npm install -g voyageai-cli`.
• For query commands (Step 5+), a VOYAGE_API_KEY is needed — free tier available at voyageai.com. Embedding and ingestion run entirely locally with nano.
Choose your MongoDB setup. Both options work identically with the VAI CLI — the Docker local image includes full Atlas Vector Search support.
Start MongoDB Atlas Local
The mongodb-atlas-local Docker image provides a single-node MongoDB instance with full Atlas Search and Vector Search support — no cloud account needed.
Install & Configure VAI CLI
Install the CLI globally and point it at your local MongoDB instance.
Download Nano Model
voyage-4-nano is an open-weight embedding model (~700 MB). It runs locally and generates 1024-dim vectors compatible with all Voyage 4 models.
This demo mirrors the full MongoDB Developer Day vector search workshop. Use it as a backup reference during the lab (if you get stuck or want to see the CLI equivalent) or afterward to reinforce concepts with a single-terminal workflow.
Open Vector Search: Beginner to Pro| Lab section | VAI command | Note |
|---|---|---|
| 20 Dev EnvironmentJupyter setup | docker run -d --name mongodb-atlas-local -p 27017:27017 mongodb/mongodb-atlas-local:latest | Same local MongoDB. VAI uses the terminal instead of notebooks. |
| 30 Import DataImport books into mongodb_genai_devday_vs.books | vai ingest --file books.jsonl --db mongodb_genai_devday_vs --collection books ... | Lab uses Python + preloaded data. VAI ingests from JSONL and embeds in one step. |
| 40 Perform Vector SearchStep 3: Generate embeddings | vai embed "..." --local --dimensions 1024 | Lab uses voyage-multimodal-3 (images). VAI uses voyage-4-nano (text, local). Same 1024-dim space. |
| 40 Perform Vector SearchStep 4: Add embeddings to data | vai ingest ... --local | Combined with import. Batch-embeds each document and writes to Atlas. |
| 40 Perform Vector SearchStep 5: Create vector index | vai index create --db mongodb_genai_devday_vs --collection books --field embedding --dimensions 1024 | Same $vectorSearch index definition. VAI creates it via CLI. |
| 40 Perform Vector SearchStep 6: Run vector search queries | vai query "A man wearing a golden crown" --db mongodb_genai_devday_vs --collection books --model voyage-4-lite | Same $vectorSearch aggregation. VAI embeds the query, runs the pipeline, and prints results. |
| 50 OptimizingPre-filtering | vai index create ... (supports filter fields) | See Under the Hood for the filter field in the index definition. vai query supports pre-filters. |
| 60 Other TechniquesHybrid search | See mongoQuery in Under the Hood | The $rankFusion pipeline combines vector and full-text search. VAI exposes this in advanced workflows. |
The lab teaches the concepts (embeddings, $vectorSearch, pre-filters, hybrid). This VAI demo gives you the same workflow in a reproducible CLI form. Run both to reinforce the mental model: Python for exploration, VAI for automation and demos.
See the exact VAI command, the matching Voyage AI layer, and the MongoDB query shape behind the demo.
vai query "A man wearing a golden crown" --db mongodb_genai_devday_vs --collection books --model voyage-4-lite
This demo mirrors the full MongoDB Developer Day vector search workshop end-to-end. Part 1 sets up the environment: a local MongoDB Atlas instance via Docker, the VAI CLI, and voyage-4-nano for local embeddings. Part 2 runs the workshop: ingest, index, search, and rerank. No cloud account needed for the database — everything runs locally except the lightweight query API call.
Share or copy this demo
Keep it lightweight. The prepared text stays behind the buttons.
Share
Copy
LinkedIn opens the share dialog and copies the prepared text so you can paste it in quickly.
The full walkthrough is included here so anyone can replay the demo exactly as published.
More shareable workflows from the same VAI demo library.
Run the full workflow in one command: create sample docs, chunk them, embed them, store them in Atlas, and auto-create the vector index.
VAI command
vai pipeline /tmp/vai-demo-docs/ --db vai_demo --collection knowledge --create-index
Show Under the Hood
Prerequisites
A valid VOYAGE_API_KEY is set in the environment.
Walk through the classic retrieval stack: embed the query, run Atlas vector search, rerank the candidates, then compare the result to a vector-only pass.
VAI command
vai query 'how does vector search work?' --db vai_demo --collection knowledge --model voyage-4-lite
Show Under the Hood
Prerequisites
A valid VOYAGE_API_KEY is set in the environment.
Start from first principles: generate a Voyage embedding, inspect its shape, and compare full-size versus Matryoshka-reduced vectors.
VAI command
vai embed 'MongoDB Atlas makes vector search production-ready'
Show Under the Hood
Prerequisites
A valid VOYAGE_API_KEY is set in the environment.