Configuration
Config File Location
grepai stores its configuration in .grepai/config.yaml in your project root.
Run grepai init to create a default configuration.
Full Configuration Reference
# Config file versionversion: 1
# Embedder configurationembedder: # Provider: "ollama" (local), "lmstudio" (local), or "openai" (cloud) provider: ollama # Model name (depends on provider) model: nomic-embed-text # Endpoint URL (depends on provider, supports Azure OpenAI) endpoint: http://localhost:11434 # API key (for OpenAI provider, use environment variable) api_key: ${OPENAI_API_KEY} # Vector dimensions (depends on model, auto-detected if not set) dimensions: 768
# Vector store configurationstore: # Backend: "gob" (file-based) or "postgres" (PostgreSQL with pgvector) backend: gob
# PostgreSQL settings (if using postgres backend) postgres: dsn: postgres://user:pass@localhost:5432/grepai
# Chunking configurationchunking: # Maximum tokens per chunk size: 512 # Overlap between chunks (for context continuity) overlap: 50
# File watching configurationwatch: # Debounce delay in milliseconds debounce_ms: 500
# Call graph tracing configurationtrace: # Extraction mode: "fast" (regex) or "precise" (tree-sitter) mode: fast # File extensions to index for symbols enabled_languages: - .go - .js - .ts - .jsx - .tsx - .py - .php - .c - .h - .cpp - .hpp - .cc - .cxx - .rs - .zig # Patterns to exclude from symbol indexing exclude_patterns: - "*_test.go" - "*.spec.ts"
# Patterns to ignore (in addition to .gitignore)ignore: - ".git" - ".grepai" - "node_modules" - "vendor" - "target" - ".zig-cache" - "zig-out"
# Path to an external gitignore file (e.g., global gitignore)# Supports ~ expansion for home directoryexternal_gitignore: "~/.config/git/ignore"Embedder Options
Ollama (Local - Recommended)
embedder: provider: ollama model: nomic-embed-text endpoint: http://localhost:11434 dimensions: 768Available models:
nomic-embed-text- Good balance of speed and qualitymxbai-embed-large- Higher quality, slowerall-minilm- Fast, lower qualityqwen3-embedding:0.6b- State-of-the-art, multilingual (including programming languages)embeddinggemma- Google’s model optimized for efficiency
LM Studio (Local)
embedder: provider: lmstudio model: text-embedding-nomic-embed-text-v1.5 endpoint: http://127.0.0.1:1234Available models (depends on what you load in LM Studio):
nomic-embed-text-v1.5- Good general purpose (768 dims)bge-small-en-v1.5- Fast, smaller (384 dims)bge-large-en-v1.5- Higher quality (1024 dims)
OpenAI (Cloud)
embedder: provider: openai model: text-embedding-3-small api_key: ${OPENAI_API_KEY} dimensions: 1536Available models:
text-embedding-3-small- 1536 dimensions, fast, cost-effectivetext-embedding-3-large- 3072 dimensions, higher quality
Azure OpenAI / Microsoft Foundry
Use a custom endpoint for Azure OpenAI or other OpenAI-compatible providers:
embedder: provider: openai model: text-embedding-ada-002 endpoint: https://YOUR-RESOURCE.openai.azure.com/v1 api_key: ${AZURE_OPENAI_API_KEY} dimensions: 1536Storage Options
GOB (File-based - Default)
store: backend: gobBest for:
- Single-developer projects
- Quick setup
- No external dependencies
The index is stored automatically in .grepai/index.gob.
PostgreSQL with pgvector
store: backend: postgres postgres: dsn: postgres://user:pass@localhost:5432/grepaiBest for:
- Team environments
- Large codebases
- Advanced querying needs
Setup:
CREATE EXTENSION vector;Chunking Tuning
chunking: size: 512 # Tokens per chunk overlap: 50 # Overlap for context- Larger chunks: Better context, fewer results, slower
- Smaller chunks: More precise matches, more results, faster
- More overlap: Better continuity, larger index
Search Options
grepai provides two optional search enhancements:
Search Boost (enabled by default)
Adjusts scores based on file paths. Test files are penalized, source directories are boosted.
search: boost: enabled: true penalties: - pattern: "_test." factor: 0.5 bonuses: - pattern: "/src/" factor: 1.1See Search Boost for full documentation.
Hybrid Search (disabled by default)
Combines vector similarity with text matching using RRF.
search: hybrid: enabled: true k: 60See Hybrid Search for full documentation.
External Gitignore
You can specify an external gitignore file (such as your global Git ignore file) to be respected during indexing:
external_gitignore: "~/.config/git/ignore"This is useful for ignoring files globally configured in Git (e.g., IDE files, OS-specific files).
Common locations for global gitignore:
~/.config/git/ignore(XDG standard)~/.gitignore_global(older convention)
The tilde (~) is automatically expanded to your home directory.
If the file doesn’t exist, grepai will log a warning and continue without it.
Environment Variables
You can use environment variables in config:
openai: api_key: ${OPENAI_API_KEY}Or override config via environment:
export GREPAI_EMBEDDER_PROVIDER=openaiexport GREPAI_STORE_BACKEND=postgres