Scaffolding Projects
vai scaffold creates a complete, runnable starter project with all files needed for a Voyage AI + MongoDB Atlas Vector Search integration.
Quick Start
# Node.js project
vai scaffold my-search-app
# Next.js project with search UI
vai scaffold my-search-ui --target nextjs
# Python Flask API
vai scaffold my-api --target python
What Gets Created
vanilla (Node.js)
lib/voyage.js— Voyage AI clientlib/mongodb.js— MongoDB connectionlib/retrieval.js— Vector search + reranklib/ingest.js— Document ingestionlib/search-api.js— Express search endpointpackage.json,README.md,.env.example
nextjs (Next.js)
lib/voyage.js,lib/mongodb.js— Client librariesapp/api/search/route.js— Search API routeapp/api/ingest/route.js— Ingest API routeapp/search/page.jsx— Search page with UIlib/theme.js,app/layout.jsx— MUI theme and layout
python (Python)
voyage_client.py— Voyage AI clientmongo_client.py— MongoDB connectionapp.py— Flask app with search routeschunker.py— Document chunkingrequirements.txt,README.md
Customizing
vai scaffold my-app --target nextjs \
--model voyage-4 \
--db myapp \
--collection knowledge \
--dimensions 512
Further Reading
vai scaffold— Full command reference- Generate Snippets — Individual file generation