Get ChunkHound running

Install the CLI, choose a setup route, and index your code. Start with the recommended APIs or keep model processing local.

Install

# Skip if you already have uv
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install chunkhound

Verify the install resolved on your shell:

chunkhound --version

Choose a route below, review its requirements, then copy the generated setup from your project root.

For local or proxied OpenAI-compatible LLM backends like Ollama or vLLM, keep the generated llm.model value in place. ChunkHound requires an explicit model name for custom base_url endpoints, including per-role overrides that resolve to OpenAI-compatible providers.

Run ChunkHound locally

Each layer is independent — pick any embedding, research model, and agent.

Choose the embeddings that index and find your code.

cloud

Voyage-4-Lite — a fast, low-cost embedder paired with VoyageAI's included reranker, which drives retrieval quality.

Reranking

Included by VoyageAI.

Customize reranker

Use an absolute HTTP(S) URL for this preset.

TEI uses the model configured on its server. Cohere and Voyage require a model. Voyage is for native Voyage-compatible endpoints such as MongoDB Atlas (uses top_k and returns a data array).

local

Generated setup

Review the generated commands, choose a shell, then copy them.

# Keep generated configuration files out of version control.
echo .chunkhound.json >> .gitignore
echo .pi/mcp.json >> .gitignore
# Configure ChunkHound with VoyageAI embeddings and Vercel AI Gateway for research. Embedding and LLM providers are independent — either works without the other. Field details: https://chunkhound.ai/docs/configuration/
# You'll need: VoyageAI API key · Vercel AI Gateway API key
cat > .chunkhound.json <<'CHUNKHOUND_EOF'
{
  "embedding": {
    "provider": "voyageai",
    "model": "voyage-4-lite",
    "rerank_model": "rerank-3-lite",
    "api_key": "<YOUR_VOYAGE_API_KEY>"
  },
  "llm": {
    "provider": "vercel",
    "model": "deepseek/deepseek-v4.1-flash",
    "api_key": "<YOUR_VERCEL_API_KEY>"
  }
}
CHUNKHOUND_EOF

# Configure Pi to connect to ChunkHound via MCP. Restart Pi from your project root and grant project trust so it can read .pi/mcp.json.
if [ -f .pi/mcp.json ]; then
cat <<'CHUNKHOUND_EOF'
.pi/mcp.json already exists — merge this block into it manually:
{
  "mcpServers": {
    "ChunkHound": {
      "command": "chunkhound",
      "args": [
        "mcp"
      ],
      "timeout": 1200,
      "exposure": "direct"
    }
  }
}
CHUNKHOUND_EOF
else
mkdir -p .pi
cat > .pi/mcp.json <<'CHUNKHOUND_EOF'
{
  "mcpServers": {
    "ChunkHound": {
      "command": "chunkhound",
      "args": [
        "mcp"
      ],
      "timeout": 1200,
      "exposure": "direct"
    }
  }
}
CHUNKHOUND_EOF
fi

For a fully local deployment, we recommend Pi. Pi 1.0 and later include MCP support, so no adapter is needed. Use the recommended or local route above to generate .pi/mcp.json.

If you installed pi-mcp-adapter, remove it before restarting Pi. The adapter disables native MCP in sessions, even when pi mcp list succeeds.

pi remove npm:pi-mcp-adapter

Add --local if you installed the adapter in project settings. Restart Pi from your project root and grant project trust only if you trust the project. Pi needs this approval to load .pi/mcp.json. Check the connection from your shell:

pi mcp list

In the Pi session, run /mcp and confirm that ChunkHound is connected. This verifies session MCP, not only the shell connection.

Index and verify

Run these four commands in order. Each one verifies a different layer of the stack: database, regex search, embeddings, then LLM. The embedding and LLM providers are configured independently, so you can set either on its own.

1. Index the project

chunkhound index .

2. Confirm regex search

chunkhound search --regex "import"

3. Confirm semantic search

chunkhound search "authentication flow"

4. Confirm research

chunkhound research "How does authentication work?"

Use it from your agent

Your agent already has ChunkHound — the editor command from setup route registered it as an MCP tool. The biggest unlock is calling code_research before writing code, not after.

code_research synthesises a cited markdown report covering architecture, key locations, and cross-file flows. One call usually replaces 5–10 manual searches.

Example prompts

The pattern is one line. Paste it into your editor chat with a topic of your own:

Use chunkhound research to ...

Agent grounding

  • explain how authentication works end to end, with file:line citations
  • map every caller of the email subsystem and the helpers they share
  • trace the login flow from form submit to Set-Cookie before editing it

Support and RCA

  • diagnose duplicate webhook deliveries by tracing the handler outward through retries, queues, and idempotency keys
  • find the most likely code path for this stack trace and list a safe workaround
  • compare every file-upload handler's size limits, MIME validation, and storage targets

Product behavior

  • explain what happens when a user changes billing plans, including edge cases
  • summarize the onboarding flow for a product brief with citations to the code
  • generate docs for the permission model from the current implementation

Need just a file or symbol? Ask the agent to use chunkhound search instead — it's faster and skips the LLM.

MCP integration

ChunkHound exposes code_research, search, and a handful of other tools as an MCP server; your editor connected to it via the command in setup route.

Where to next

Stuck? Ask in Discord or open an issue.