Quickstart
Get from zero to semantic search in 5 minutes.
Prerequisites
- Node.js 22+ installed
- Antfly — search backend (installed automatically by
dev setup) - Cursor IDE (or Claude Code)
- A code repository to index
Step 1: Install and setup
npm install -g @prosdevlab/dev-agent
dev setupdev setup installs Antfly, pulls the embedding model, and starts the server. One-time step.
Step 2: Index your repository
cd ~/your-project
dev indexYou’ll see output like:
Scanning repository...
Found 247 files to index
Generating embeddings...
████████████████████████████████████████ 100%
Indexed 1,832 code components in 12.3sStep 3: Connect to Cursor
dev mcp install --cursorThen restart Cursor.
Step 4: Try semantic search
Open Cursor’s AI chat and ask:
“Use dev_search to find where we handle user authentication”
You’ll get results like:
1. [89%] class: AuthMiddleware (src/auth/middleware.ts:15)
2. [84%] function: verifyToken (src/auth/jwt.ts:5)
3. [72%] function: validateSession (src/auth/session.ts:23)Step 5: Explore more tools
Try these prompts:
Find similar code:
“Use dev_patterns to compare src/utils/cache.ts with similar implementations”
What’s Happening Under the Hood
When you run dev index:
- Scanner parses your code using the TypeScript Compiler API (ts-morph) and tree-sitter (Go)
- Extractor identifies functions, classes, interfaces, types, arrow functions, hooks, and exported constants
- Storage sends documents to Antfly, which generates embeddings locally via Termite (ONNX)
When AI tools call dev_search:
- Hybrid search runs BM25 (keyword matching) + vector similarity in parallel
- RRF fusion combines both signals into a single ranked result set
- Formatter returns results optimized for LLM context windows
Next Steps
- MCP Tools → — Learn about all available tools
- Architecture → — Understand how dev-agent works
Pro tip: Re-index after major code changes to keep search results accurate:
dev index --force
Last updated on