AI coding assistants work better when they have access to real examples from your codebase. Kodit indexes your repositories, splits source files into searchable snippets, and serves them to any MCP-compatible assistant. When your assistant needs to write new code, it queries Kodit first and gets back relevant, up-to-date examples drawn from your own projects.
Kodit also handles documents. PDFs, Word files, PowerPoint decks, and spreadsheets are rasterized and indexed so you can search across both code and documentation in one place.
What you get:
- Multiple search strategies including BM25 keyword search, semantic vector search, regex grep, and visual document search, each exposed as a separate MCP tool so your assistant picks the right approach for each query
- MCP server that works with Claude Code, Cursor, Cline, Kilo Code, and any other MCP-compatible assistant
- REST API for programmatic access to search, repositories, enrichments, and indexing status
- AI enrichments (optional) including architecture docs, API docs, database schema detection, cookbook examples, and commit summaries, all generated by an LLM
- Document intelligence with visual search across PDF pages, Office documents, and images using multimodal embeddings
- No external dependencies required for basic operation, with a built-in embedding model and SQLite storage
Quickstart
Docker (recommended)
docker run -p 8080:8080 registry.helix.ml/helix/kodit:latest
This starts Kodit with SQLite storage and a built-in embedding model. No API keys needed.
Pre-built binaries
Download a binary from the releases page, then:
chmod +x kodit
./kodit serve
Verify it works
Open the interactive API docs at http://localhost:8080/docs.
Or index a small repository and run a search:
# Index a repository
curl http://localhost:8080/api/v1/repositories \
-X POST -H "Content-Type: application/json" \
-d '{
"data": {
"type": "repository",
"attributes": {
"remote_uri": "https://gist.github.com/philwinder/7aa38185e20433c04c533f2b28f4e217.git"
}
}
}'
# Check indexing progress
curl http://localhost:8080/api/v1/repositories/1/status
# Search (once indexing is complete)
curl http://localhost:8080/api/v1/search \
-X POST -H "Content-Type: application/json" \
-d '{
"data": {
"type": "search",
"attributes": {
"keywords": ["orders"],
"text": "code to get all orders"
}
}
}'
Connecting to AI Assistants
Kodit exposes an MCP endpoint at /mcp. Connect your assistant to start using Kodit as a code search tool.
Claude Code
claude mcp add --transport http kodit http://localhost:8080/mcp
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"kodit": {
"url": "http://localhost:8080/mcp"
}
}
}
Cline
Add to the MCP Servers configuration (Remote Servers tab):
{
"mcpServers": {
"kodit": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "streamableHttp",
"url": "http://localhost:8080/mcp"
}
}
}
Kilo Code
Add to the MCP configuration (Edit Project/Global MCP):
{
"mcpServers": {
"kodit": {
"type": "streamable-http",
"url": "http://localhost:8080/mcp",
"alwaysAllow": [],
"disabled": false
}
}
}
Replace http://localhost:8080 with your server URL if running remotely.
Encouraging assistants to use Kodit
Some assistants may not call Kodit tools automatically. Add this to your project rules or system prompt to enforce usage:
For every request that involves writing or modifying code, the assistant's first
action must be to call the kodit search MCP tools. Only produce or edit code after
the tool call returns results.
In Cursor, save this as .cursor/rules/kodit.mdc with alwaysApply: true frontmatter.
MCP Tools
Kodit exposes these tools to connected AI assistants:
The enrichment tools (architecture_docs, api_docs, database_schema, cookbook, wiki, commit_description) require an LLM provider to be configured. See Enrichment Providers under Configuration Reference.
Go Library
Kodit can be embedded directly as a Go library. This is how Helix integrates Kodit into its platform.
import "github.com/helixml/kodit"
client, err := kodit.New(
kodit.WithSQLite(".kodit/data.db"),
)
if err != nil {
log.Fatal(err)
}
defer client.Close()
// Index a repository
_, _, err = client.Repositories.Add(ctx, &service.RepositoryAddParams{
URL: "https://github.com/kubernetes/kubernetes",
})
// Search
results, err := client.Search.Query(ctx, "create a deployment",
service.WithLimit(10),
)
for _, result := range results.Enrichments() {
fmt.Println(result.Subtype(), result.Content())
}
Library options
Search options
Go HTTP client
A generated HTTP client is available for calling a remote Kodit server from Go:
go get github.com/helixml/kodit/clients/go
import koditclient "github.com/helixml/kodit/clients/go"
client, err := koditclient.NewClient("https://kodit.example.com")
// List repositories
resp, err := client.GetRepositories(ctx, nil)
// Search
text := "create a deployment"
resp, err := client.PostSearch(ctx, koditclient.PostSearchJSONRequestBody{
Data: &koditclient.DtoSearchData{
Attributes: &koditclient.DtoSearchAttributes{
Text: &text,
},
},
})
Types are auto-generated from the OpenAPI spec. See the interactive API docs at /docs for the full endpoint list.
Production Deployment
For production use, deploy with PostgreSQL (VectorChord) for scalable vector search and a dedicated LLM provider for enrichments.
Docker Compose
Save this as docker-compose.yaml:
services:
kodit:
image: registry.helix.ml/helix/kodit:latest
ports:
- "8080:8080"
command: ["serve"]
restart: unless-stopped
depends_on:
- vectorchord
environment:
DATA_DIR: /data
DB_URL: postgresql://postgres:mysecretpassword@vectorchord:5432/kodit
# Enrichment LLM (optional, enables AI-generated docs)
ENRICHMENT_ENDPOINT_BASE_URL: http://ollama:11434
ENRICHMENT_ENDPOINT_MODEL: ollama/qwen3:1.7b
# External embedding provider (optional, replaces built-in model)
# EMBEDDING_ENDPOINT_API_KEY: sk-proj-xxxx
# EMBEDDING_ENDPOINT_MODEL: openai/text-embedding-3-small
LOG_LEVEL: INFO
API_KEYS: ${KODIT_API_KEYS:-}
volumes:
- kodit-data:/data
vectorchord:
image: tensorchord/vchord-suite:pg17-20250601
environment:
POSTGRES_DB: kodit
POSTGRES_PASSWORD: mysecretpassword
volumes:
- vectorchord-data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
kodit-data:
vectorchord-data:
Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: vectorchord
spec:
replicas: 1
selector:
matchLabels:
app: vectorchord
template:
metadata:
labels:
app: vectorchord
spec:
containers:
- name: vectorchord
image: tensorchord/vchord-suite:pg17-20250601
env:
- name: POSTGRES_DB
value: kodit
- name: POSTGRES_PASSWORD
value: mysecretpassword
ports:
- containerPort: 5432
---
apiVersion: v1
kind: Service
metadata:
name: vectorchord
spec:
selector:
app: vectorchord
ports:
- port: 5432
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: kodit
spec:
replicas: 1
selector:
matchLabels:
app: kodit
template:
metadata:
labels:
app: kodit
spec:
containers:
- name: kodit
image: registry.helix.ml/helix/kodit:latest # pin to a specific version
args: ["serve"]
env: [] # see Configuration Reference for environment variables
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 10
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: kodit
spec:
type: LoadBalancer
selector:
app: kodit
ports:
- port: 8080
Authentication
Set the API_KEYS environment variable to a comma-separated list of keys. Write endpoints (creating repositories, triggering syncs) require a valid key in the Authorization: Bearer <key> header. Search endpoints are open by default.
Configuration Reference
Configuration is done through environment variables. You can also use a .env file:
kodit serve --env-file .env
Server
Embedding Provider
These configure an external embedding model. If unset, Kodit uses its built-in model.
Vision Embedding Provider
These configure a remote service for image and text vision embeddings. If unset, Kodit uses its built-in SigLIP2 model.
Enrichment Providers
These configure an LLM for generating architecture docs, API docs, database schemas, cookbooks, commit summaries, and wiki pages. Without this, Kodit indexes and searches code but does not generate any AI documentation.
Enrichment is typically the slowest part of indexing because each enrichment requires a round-trip to the LLM provider. Increase NUM_PARALLEL_TASKS to speed things up, but respect your provider's rate limits. Start low and increase over time.
Provider examples:
# OpenAI
ENRICHMENT_ENDPOINT_BASE_URL=https://api.openai.com/v1
ENRICHMENT_ENDPOINT_MODEL=gpt-4o-mini
ENRICHMENT_ENDPOINT_API_KEY=sk-proj-xxxx
# Ollama (local)
ENRICHMENT_ENDPOINT_BASE_URL=http://localhost:11434
ENRICHMENT_ENDPOINT_MODEL=ollama/qwen3:1.7b
# Helix (private cloud)
ENRICHMENT_ENDPOINT_BASE_URL=https://app.helix.ml/v1
ENRICHMENT_ENDPOINT_MODEL=Qwen/Qwen3-8B
ENRICHMENT_ENDPOINT_API_KEY=your-helix-key
Periodic Sync
Chunking
REST API
The full API is documented interactively at /docs on a running Kodit instance. The OpenAPI 3.0 specification is available at /docs/openapi.json.
Key endpoints:
All write endpoints require an Authorization: Bearer <key> header when API_KEYS is set.
How Indexing Works
When you add a repository, Kodit runs a pipeline:
- Clone the Git repository to local storage
- Scan commits, branches, and tags to extract metadata
- Extract snippets by splitting source files into overlapping text chunks
- Build search indexes with BM25 (keyword) and vector embeddings (semantic)
- Generate enrichments (if an LLM provider is configured): architecture docs, API docs, database schemas, cookbook examples, commit summaries, and wiki pages
Kodit tracks which files have changed between syncs and only reprocesses modified content. Repositories sync automatically on a configurable interval (default: every 30 minutes).
Supported sources
Kodit indexes any Git repository accessible via HTTPS, SSH, or the Git protocol. This includes GitHub, GitLab, Bitbucket, Azure DevOps, and self-hosted servers.
Private repositories
Private repositories are supported through personal access tokens or SSH keys:
# HTTPS with token
https://username:[email protected]/username/repo.git
# SSH (ensure your SSH key is configured)
[email protected]:username/repo.git
Privacy
Kodit respects .gitignore and .noindex files. Files matching these patterns are excluded from indexing.
Storage Backends
SQLite (default)
No configuration needed. Kodit creates a SQLite database in the data directory with FTS5 for keyword search and in-process vector storage. Good for single-user and small-team deployments.
PostgreSQL with VectorChord
For larger deployments, use PostgreSQL with the VectorChord extension. This provides scalable vector search and concurrent access. Set the DB_URL environment variable to your connection string.
The recommended Docker image is tensorchord/vchord-suite:pg17-20250601, which bundles PostgreSQL 17 with VectorChord, vchord_bm25, and pg_tokenizer.
Building from Source
git clone https://github.com/helixml/kodit.git
cd kodit
make tools # Install development tools
make download-model # Download the built-in embedding model
make build # Build the binary
./bin/kodit version
./bin/kodit serve
Run the tests:
make test # All tests
make test PKG=./internal/foo/... # Specific package
make check # Format, vet, lint, and test
Troubleshooting
MCP connection error after restart: If you see No valid session ID provided after restarting the Kodit server, reload the MCP client in your assistant. MCP sessions do not survive server restarts.
No search results: Check that indexing has completed by calling GET /api/v1/repositories/{id}/status. If status shows errors, check the server logs with LOG_LEVEL=DEBUG.
Enrichments not generating: Enrichments require an LLM provider. Check that ENRICHMENT_ENDPOINT_BASE_URL and ENRICHMENT_ENDPOINT_MODEL are set. Without these, Kodit indexes and searches code but does not generate AI documentation.
Telemetry
Kodit collects limited anonymous telemetry (usage metadata only, no user data) to guide development. Disable it with:
DISABLE_TELEMETRY=true
Commercial Support
Helix provides a managed platform built on Kodit with additional features including a management UI, repository browsing, team collaboration, and hosted infrastructure. For commercial support or enterprise integration, contact [email protected].
Contributing
See CONTRIBUTING.md for guidelines.