This guide walks you through setting up the Repository Indexer with a local Qdrant vector database.
- Docker and Docker Compose
- Python 3.8 or higher
- pip (Python package installer)
The project includes a docker-compose.yml
that configures Qdrant with persistent storage and the necessary API ports.
# Start Qdrant in the background
docker-compose up -d
# Verify it's running
docker-compose ps
You should see Qdrant running on:
- REST API: http://localhost:6333
- GRPC API: localhost:6334
The database files will be stored in ./qdrant_storage/
directory.
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install required packages
pip install "qdrant-client" "numpy" "openai>=1.0.0" "gitingest"
Create a .env
file in your project directory:
# .env
OPENAI_API_KEY="your-openai-api-key"
QDRANT_URL="http://localhost:6333"
Or set environment variables directly:
# Linux/macOS
export OPENAI_API_KEY="your-openai-api-key"
export QDRANT_URL="http://localhost:6333"
# Windows (PowerShell)
$env:OPENAI_API_KEY="your-openai-api-key"
$env:QDRANT_URL="http://localhost:6333"
Run the test script to verify everything is working:
python repo_indexer.py
You should see output showing:
- Successful connection to Qdrant
- Repository content being processed
- Embeddings being generated
- Search results being returned
Access the Qdrant OpenAPI dashboard at http://localhost:6333/dashboard to:
- View collections
- Monitor metrics
- Execute queries directly
Qdrant data is persisted in ./qdrant_storage/
. To start fresh:
- Stop Qdrant:
docker-compose down
- Remove storage:
rm -rf ./qdrant_storage
- Restart Qdrant:
docker-compose up -d
The default configuration should work for most use cases, but you can customize Qdrant by adding configuration to docker-compose.yml
:
services:
qdrant:
environment:
- QDRANT_ALLOW_RECOVERY_MODE=true
- QDRANT_CPU_BUDGET=4 # Number of CPU cores to use
- QDRANT_MEMORY_BUDGET=4000000000 # Memory budget in bytes (4GB)
See Qdrant Configuration for more options.
-
Qdrant Connection Failed
- Verify Docker is running
- Check
docker-compose ps
output - Ensure ports 6333-6334 are not in use
- Try restarting with
docker-compose restart
-
OpenAI API Issues
- Verify API key is set correctly
- Check API key has required permissions
- Monitor rate limits in OpenAI dashboard
-
Memory Issues
- Adjust Qdrant memory budget in docker-compose.yml
- Process large repositories in batches
- Monitor Docker resource usage
View Qdrant logs:
docker-compose logs -f qdrant
If you encounter issues:
- Check Qdrant logs
- Verify environment variables
- Ensure all dependencies are installed
- Open an issue on GitHub with:
- Error messages
- Environment details
- Steps to reproduce