CodeCompass
A VS Code extension for AI-powered semantic code search and question answering. Supports OpenRouter, Gemini, and local Ollama.
VSCodeCompass
AI-Powered Code Search and Question Answering for Your Codebase
CodeCompass is a VS Code extension that helps developers navigate and understand codebases through AI-powered search and question answering. Particularly useful for new team members trying to understand unfamiliar code.
Features
- Semantic Code Search - Find relevant files based on natural language queries
- AI-Powered Q&A - Ask questions about your codebase and get contextual answers
- Interactive Chat - Maintain conversations with context from previous questions
- Multiple AI Providers - Support for OpenRouter, Google Gemini, and local Ollama models
Installation
Prerequisites
| Requirement | Details |
|---|---|
| VS Code | Version 1.60.0 or higher |
| Node.js | For building the extension |
| Qdrant | Vector database (required for search) |
| AI Provider | API keys or local Ollama |
From VSIX (Recommended)
- Download latest
.vsixfrom Releases - In VS Code: Extensions (Ctrl+Shift+X)
- Click "..." > Install from VSIX...
- Select downloaded file
Build from Source
# Clone repository
git clone https://github.com/balakumardev/VSCodeCompass.git
cd VSCodeCompass
# Install dependencies
npm install
# Build extension
npm run package
Setup
1. Set Up Qdrant Vector Database
Option A: Docker (Recommended)
docker run -d --name qdrant
-p 6333:6333
-v qdrant-data:/qdrant/storage
qdrant/qdrant
Option B: Native Installation
Follow the Qdrant installation guide.
Verify at: http://localhost:6333/dashboard
2. Configure AI Provider
OpenRouter (Cloud)
- Create account at OpenRouter
- Generate API key
- In VS Code Settings:
- Set
codecompass.aiProvidertoOPENROUTER - Set
codecompass.openRouterApiKeyto your key
- Set
Google Gemini (Cloud)
- Get API key from Google AI Studio
- In VS Code Settings:
- Set
codecompass.aiProvidertoGEMINI - Set
codecompass.geminiApiKeyto your key
- Set
Ollama (Local)
- Install Ollama
- Pull a model:
ollama pull llama3 - In VS Code Settings:
- Set
codecompass.aiProvidertoOLLAMA
- Set
Usage
Index Your Codebase
- Open Command Palette (Ctrl+Shift+P)
- Run CodeCompass: Index Workspace
- Wait for indexing to complete
Search Code
- Open Command Palette
- Run CodeCompass: Search
- Enter natural language query
- Browse results and open files
Ask Questions
- Open CodeCompass panel from sidebar
- Type your question in the chat
- Get AI-powered answers with code context
Configuration
| Setting | Description | Default |
|---|---|---|
codecompass.aiProvider |
AI provider to use | OPENROUTER |
codecompass.openRouterApiKey |
OpenRouter API key | - |
codecompass.geminiApiKey |
Google Gemini API key | - |
codecompass.ollamaEndpoint |
Ollama server URL | http://localhost:11434 |
codecompass.qdrantEndpoint |
Qdrant server URL | http://localhost:6333 |
Tech Stack
- Language: TypeScript
- Platform: VS Code Extension
- Vector DB: Qdrant
- AI Providers: OpenRouter, Gemini, Ollama
- Embeddings: Local or API-based
Architecture
+------------------+ +------------------+
| VS Code UI | | AI Provider |
| (Chat, Search) | | (OpenRouter/ |
+--------+---------+ | Gemini/Ollama) |
| +--------+---------+
v |
+------------------+ |
| CodeCompass |<-------------+
| Extension |
+--------+---------+
|
v
+------------------+
| Qdrant Vector |
| Database |
+------------------+
Contributing
Contributions welcome! Please open issues or submit pull requests.
License
This project is open source. See the repository for license details.