The missing abstraction layer between AI and your code - deep, structural understanding for better A
10K+
This guide explains how to run CodeWeaver using Docker and Docker Compose, providing an easy setup with integrated Qdrant vector database.
The fastest way to get started uses the quickstart profile with free, local models:
# 1. Get the configuration files
curl -O https://raw.githubusercontent.com/knitli/codeweaver/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/knitli/codeweaver/main/.env.example
cp .env.example .env
# 2. Start services (uses free local models by default)
docker compose up -d
# 3. Check health
curl http://localhost:9328/health/
That's it! CodeWeaver will index the current directory using free, local embedding models.
For better search quality, use the recommended profile with Voyage AI:
# Set your API key and profile
export VOYAGE_API_KEY=your-voyage-api-key
export CODEWEAVER_PROFILE=recommended
docker compose up -d
Get a free Voyage API key at voyageai.com.
CodeWeaver uses profiles to simplify configuration. Each profile pre-configures providers and models:
| Profile | Description | API Keys Required | Use Case |
|---|---|---|---|
quickstart | FastEmbed/Sentence Transformers (free, local) | None | Getting started, offline use |
recommended | Voyage AI (high-quality cloud models) | VOYAGE_API_KEY | Production, best quality |
backup | Lightest local models + in-memory vectors | None | Testing, minimal resources |
# Via environment variable
CODEWEAVER_PROFILE=quickstart docker compose up -d
# Or in .env file
CODEWEAVER_PROFILE=recommended
voyage-code-3voyage-rerank-2.5CodeWeaver uses Docker bind mounts to access your codebase:
:ro flag prevents CodeWeaver from modifying your codeSet PROJECT_PATH in your .env file:
# Absolute path (recommended)
PROJECT_PATH=/home/user/projects/my-app
# Relative path (relative to docker-compose.yml)
PROJECT_PATH=../my-app
# Current directory
PROJECT_PATH=.
The codebase is mounted at /workspace inside the container.
# .env
PROJECT_PATH=/home/user/projects/my-app
# Or via command line
PROJECT_PATH=/home/user/projects/my-app docker compose up -d
Keep docker-compose.yml in your project directory:
my-project/
├── docker-compose.yml
├── .env
├── src/
└── ...
# .env
PROJECT_PATH=.
This mirrors devcontainer behavior where the compose file lives with your code.
# Index only the backend
PROJECT_PATH=/home/user/monorepo/packages/backend
CodeWeaver continuously monitors your codebase while the server is running:
This happens automatically - no action required.
Force a full re-index if needed:
# Via CLI
docker compose exec codeweaver codeweaver index --force
# Check indexing status
curl http://localhost:9328/health/ | jq '.indexing'
Use forward slashes or escaped backslashes:
# .env (Windows)
PROJECT_PATH=C:/Users/me/projects/my-app
WSL2 users: For best performance, keep your code in the Linux filesystem:
PROJECT_PATH=/home/user/projects/my-app # Fast
# Not: PROJECT_PATH=/mnt/c/Users/... # Slow
Docker Desktop for Mac uses gRPC-FUSE for mounts. For large codebases:
Native bind mounts - best performance. Ensure the Docker user can read your files:
chmod -R o+r /path/to/your/project
CodeWeaver stores critical data that must persist between container restarts:
cw initThe docker-compose.yml configures persistence via XDG_CONFIG_HOME:
environment:
- XDG_CONFIG_HOME=/app/config
volumes:
- codeweaver_config:/app/config # Checkpoints, config, secrets
- codeweaver_data:/app/data # Application data
Important: Without this persistence, CodeWeaver re-indexes from scratch on every restart. For large codebases, this can take significant time.
# View checkpoint data
docker compose exec codeweaver ls -la /app/config/codeweaver/
# Check index status
curl http://localhost:9328/health/ | jq '.indexing'
To force a fresh re-index:
# Remove checkpoint data
docker compose exec codeweaver rm -rf /app/config/codeweaver/checkpoints/
# Restart to re-index
docker compose restart codeweaver
| Data Type | Container Path | Mounted Volume |
|---|---|---|
| Config & Checkpoints | /app/config/codeweaver/ | codeweaver_config |
| Application Data | /app/data/ | codeweaver_data |
| Vector Database | (Qdrant container) | qdrant_storage |
For full control beyond profiles, create your own codeweaver.toml.
CodeWeaver automatically finds configuration files in these locations (in order of precedence):
In your project (mounted at /workspace):
codeweaver.local.toml / .yaml / .jsoncodeweaver.toml / .yaml / .json.codeweaver.local.toml / .yaml / .json.codeweaver.toml / .yaml / .json.codeweaver/codeweaver.local.toml / .yaml / .json.codeweaver/codeweaver.toml / .yaml / .jsonUser config directory (/app/config/codeweaver/ in Docker):
codeweaver.toml / .yaml / .jsonThe entrypoint generates config to the user config dir. You can override by placing a config in your project root.
# Install CodeWeaver locally (or use pipx)
pipx install code-weaver
# Generate a config file
cw init config --profile quickstart --config-path ./codeweaver.toml
# Edit as needed
vim codeweaver.toml
# Mount in docker-compose.yml
# Start container (generates config from profile)
docker compose up -d
# Copy config out
docker cp codeweaver-server:/app/config/codeweaver/codeweaver.toml ./codeweaver.toml
# Edit locally
vim codeweaver.toml
Option 1: Place in project root (recommended)
Simply add codeweaver.toml to your project - CodeWeaver auto-discovers it:
my-project/
├── codeweaver.toml # Auto-discovered!
├── src/
└── ...
Option 2: Mount to user config location
For config outside your project, mount explicitly in docker-compose.yml:
volumes:
- ${PROJECT_PATH:-.}:/workspace:ro
- codeweaver_config:/app/config
- ./my-config.toml:/app/config/codeweaver/codeweaver.toml:ro # Add this
project_name = "my-project"
project_path = "/workspace"
token_limit = 30000
[provider.embedding]
provider = "voyage"
model_settings = { model = "voyage-code-3" }
[provider.vector_store]
provider = "qdrant"
provider_settings = {
url = "http://qdrant:6333", # Docker network hostname
collection_name = "my-collection"
}
[indexer]
exclude_patterns = ["node_modules", ".git", "dist", "__pycache__"]
Important: When using the local Qdrant container, use http://qdrant:6333 (Docker network hostname), not localhost.
CodeWeaver uses a daemon architecture with stdio as the default transport:
Standalone/docker-compose mode (HTTP transport):
┌─────────────────────────────────────────────────┐
│ CodeWeaver Container │
│ ├─ MCP Server (port 9328, HTTP) │
│ ├─ Management Server (port 9329) │
│ ├─ Live File Watcher │
│ ├─ Indexing Engine │
│ └─ Search API │
│ Connects to ↓ │
└─────────────────────────────────────────────────┘
│
↓
┌─────────────────────────────────────────────────┐
│ Qdrant Container │
│ ├─ Vector Database (port 6333) │
│ ├─ gRPC API (port 6334) │
│ └─ Persistent Storage │
└─────────────────────────────────────────────────┘
MCP client spawned mode (STDIO transport - default):
┌──────────────────┐ ┌──────────────────────────┐
│ MCP Client │────▶│ Docker Container │
│ (Claude, etc.) │stdio│ └─ STDIO proxy to HTTP │
└──────────────────┘ └───────────┬──────────────┘
│ HTTP
▼
┌──────────────────────────┐
│ CodeWeaver Daemon │
│ (running on host) │
│ ├─ MCP Server :9328 │
│ └─ Management :9329 │
└──────────────────────────┘
For repositories with >10,000 files:
Configure exclude patterns in your codeweaver.toml:
[indexer]
exclude_patterns = [
"node_modules",
".git",
"dist",
"build",
"__pycache__",
"*.pyc",
"vendor",
".venv"
]
Increase container memory:
deploy:
resources:
limits:
memory: 8G
Use VirtioFS on macOS Docker Desktop
Adjust result limits if needed:
# In .env
TOKEN_LIMIT=50000
Check Docker resources:
docker info | grep -i memory
# Ensure at least 4GB is available
View logs:
docker compose logs codeweaver
docker compose logs qdrant
Verify Qdrant is healthy:
curl http://localhost:6333/health
Check network connectivity:
docker compose exec codeweaver curl http://qdrant:6333/health
Check the profile and key:
# View current profile
docker compose exec codeweaver env | grep CODEWEAVER_PROFILE
# Verify API key is passed
docker compose exec codeweaver env | grep VOYAGE_API_KEY
Switch to quickstart profile (no API key needed):
CODEWEAVER_PROFILE=quickstart docker compose up -d
Check mount:
docker compose exec codeweaver ls -la /workspace
Verify exclude patterns aren't blocking your files.
Check indexer logs:
docker compose logs codeweaver | grep -i "index\|watch"
If file watching isn't picking up changes:
docker compose restart codeweaverThe container runs as user codeweaver (UID 1000). Ensure your files are readable:
# Check from inside container
docker compose exec codeweaver ls -la /workspace
Run separate instances for different projects:
# Create project-specific compose files
cp docker-compose.yml docker-compose.project1.yml
# Edit to use different:
# - Container names
# - Ports
# - Volume names
docker compose -f docker-compose.project1.yml up -d
To use Qdrant Cloud instead of the local container:
Set the vector deployment and URL:
VECTOR_DEPLOYMENT=cloud
VECTOR_URL=https://your-cluster.cloud.qdrant.io:6333
Remove or comment out the qdrant service in docker-compose.yml
Set your Qdrant API key:
QDRANT_API_KEY=your-qdrant-api-key
For production use:
Use specific version tags:
image: knitli/codeweaver:v0.1.0
Set resource limits:
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
Use secrets for API keys:
secrets:
- voyage_api_key
environment:
- VOYAGE_API_KEY_FILE=/run/secrets/voyage_api_key
Enable restart policies:
restart: unless-stopped
curl http://localhost:9328/health/ | jq
Response includes:
docker stats codeweaver-server codeweaver-qdrant
.env files with real API keyscodeweaver, UID 1000):ro)If you want to build the Docker image yourself:
# From the repository root
docker build -t codeweaver:local .
# Test the build
docker run --rm codeweaver:local codeweaver --version
# Use in docker-compose.yml
# Change: image: knitli/codeweaver:latest
# To: build: .
Content type
Image
Digest
sha256:143d05a59…
Size
254.7 MB
Last updated
6 months ago
docker pull knitli/codeweaver