Skip to main content

Configuration Variables

TeaRAGs is configured via environment variables passed to the MCP server. All variables are optional unless specified otherwise.

Server

VariableDescriptionDefault
SERVER_TRANSPORTTransport mode: stdio or httpstdio
SERVER_HTTP_PORTPort for HTTP transport3000
SERVER_HTTP_TIMEOUT_MSRequest timeout for HTTP transport (ms)300000
SERVER_PROMPTS_FILEPath to prompts configuration JSONprompts.json

Qdrant

VariableDescriptionDefault
QDRANT_URLQdrant connection mode. Unset = autodetect (probe localhost:6333 for external Qdrant, fallback to embedded). "embedded" = always use embedded Qdrant. "http://..." = use external Qdrant at that URL.Autodetect
QDRANT_API_KEYAPI key for Qdrant authentication-
QDRANT_EMBEDDED_STORAGE_PATHOverride embedded Qdrant storage location~/.tea-rags/qdrant/storage
QDRANT_TURBO_QUANTEnable Qdrant 1.18 TurboQuant 8x dense quantization (rescored at search time, ~baseline recall). Applied to new and existing collections at startup — no reindex.true
QDRANT_MAX_RESIDENT_MEMORY_PERCENTReject memory-consuming writes when resident RAM exceeds N% (1-100). Strict-mode OOM guard applied to new and existing collections at startup — no reindex. Unset = off.unset
QDRANT_SEARCH_MAX_BATCHSIZECap batch-search query size (strict mode). Unset = no cap.unset
QDRANT_LOW_MEMORYForce the embedded daemon to keep storage on disk to minimize RAM (slower, OOM-safe). Takes effect on the next daemon start.false

Embedding

VariableDescriptionDefault
EMBEDDING_PROVIDERProvider: onnx, ollama, openai, cohere, voyageollama
EMBEDDING_MODELModel namejina-embeddings-v2-base-code
EMBEDDING_BASE_URLCustom API URLProvider-specific
EMBEDDING_FALLBACK_URLFallback Ollama URL when primary is unreachable-
EMBEDDING_DIMENSIONSVector dimensions (auto-detected from model)Auto
OPENAI_API_KEYOpenAI API key-
COHERE_API_KEYCohere API key-
VOYAGE_API_KEYVoyage AI API key-
OLLAMA_LEGACY_APIUse legacy single-request Ollama APIfalse
OLLAMA_NUM_GPUOllama GPU count (0 = CPU only)999

Ingest

VariableDescriptionDefault
INGEST_CHUNK_SIZEMaximum chunk size in characters2500
INGEST_CHUNK_OVERLAPOverlap between chunks in characters300
INGEST_ENABLE_ASTEnable AST-aware chunking (tree-sitter)true
INGEST_ENABLE_HYBRIDEnable hybrid search (dense + sparse vectors)true
INGEST_DEFAULT_SEARCH_LIMITDefault search result limit5

VCS Adapter

VariableDescriptionDefault
GIT_ADAPTERGit history engine: git (system CLI) or es-git (in-process)git

GIT_ADAPTER selects how TeaRAGs reads git history (blame, log, blobs):

  • git — the system git binary, one process per operation. Right for small projects and short histories.
  • es-git — the es-git library (napi-rs over libgit2), reading history in-process with no per-operation process spawn. Right for large projects, monorepos, and machines where security tooling throttles process creation. Install with npm install -g es-git.

Selecting es-git without the binding installed makes every git-dependent operation fail with an install hint — there is no silent fallback; set GIT_ADAPTER=git to switch back. The value is pinned per-project: it is always captured into the project registry at indexing time (even the default), and tea-rags index-codebase / tea-rags tune replay it automatically with env > registry > default precedence.

Trajectory: Git

VariableDescriptionDefault
TRAJECTORY_GIT_ENABLEDEnable git enrichment (file + chunk signals)true
TRAJECTORY_GIT_LOG_MAX_AGE_MONTHSGit log depth for file-level signals (months)12
TRAJECTORY_GIT_LOG_TIMEOUT_MSTimeout for git log --numstat (ms)60000
TRAJECTORY_GIT_CHUNK_CONCURRENCYParallel files for chunk-level churn analysis10
TRAJECTORY_GIT_CHUNK_MAX_AGE_MONTHSGit log depth for chunk-level churn (months)6
TRAJECTORY_GIT_CHUNK_TIMEOUT_MSTimeout for chunk churn CLI pathspec (ms)120000
TRAJECTORY_GIT_CHUNK_MAX_FILE_LINESSkip chunk churn for files > N lines10000
TRAJECTORY_GIT_SQUASH_AWARE_SESSIONSGroup commits into sessions (squash noise reduction)false
TRAJECTORY_GIT_SESSION_GAP_MINUTESGap between commits to split sessions30

Trajectory: Codegraph

Beta feature

Codegraph enrichment (call graph + import graph signals) is beta and disabled by default; set CODEGRAPH_ENABLED=true to opt in. See Codegraph Enrichments.

VariableDescriptionDefault
CODEGRAPH_ENABLEDEnable codegraph family (graph signals + get_callers/get_callees/find_cycles tools)false
CODEGRAPH_DB_PATHOverride graph-DB root dir (per-project .duckdb files live under it)data dir
CODEGRAPH_DB_MEMORY_LIMITPer-project DuckDB RAM ceiling before spilling to temp dir2GB
CODEGRAPH_DB_THREADSDuckDB worker threads per project2
CODEGRAPH_EXCLUDE_TESTSExclude test files from the graph (still indexed by Qdrant)true
CODEGRAPH_CUSTOM_EXCLUDEComma-separated .gitignore-shaped patterns to exclude from the graph(empty)
CODEGRAPH_AMBIGUOUS_RESOLVE_MODEShort-name call resolution: strict (drop ambiguous) or first (pick first)strict

Debug

VariableDescriptionDefault
DEBUGEnable debug timing logs (true or 1)false

Performance Tuning

tip

These variables control batch sizes, concurrency, timeouts, and pool sizes. Defaults work well for most setups. Tune only if you hit performance bottlenecks.

Qdrant Tune

VariableDescriptionDefault
QDRANT_TUNE_UPSERT_BATCH_SIZEPoints per Qdrant upsert batch100
QDRANT_TUNE_UPSERT_FLUSH_INTERVAL_MSAuto-flush buffer interval (0 to disable)500
QDRANT_TUNE_UPSERT_ORDERINGOrdering: weak, medium, strongweak
QDRANT_TUNE_DELETE_BATCH_SIZEPaths per delete batch500
QDRANT_TUNE_DELETE_CONCURRENCYParallel delete requests8
QDRANT_TUNE_DELETE_FLUSH_TIMEOUT_MSFlush timeout for delete accumulator (ms)1000

Embedding Tune

VariableDescriptionDefault
INGEST_PIPELINE_CONCURRENCYPipeline worker concurrency1
EMBEDDING_TUNE_BATCH_SIZEChunks per embedding batch1024
EMBEDDING_TUNE_MIN_BATCH_SIZEMin chunks before timeout flushbatchSize × 0.5
EMBEDDING_TUNE_BATCH_TIMEOUT_MSFlush partial batch after timeout (ms)2000
EMBEDDING_TUNE_MAX_REQUESTS_PER_MINUTERate limit for embedding APIProvider-specific
EMBEDDING_TUNE_RETRY_ATTEMPTSRetry count for failed embedding calls3
EMBEDDING_TUNE_RETRY_DELAY_MSInitial retry delay (ms)1000

Ingest Tune

VariableDescriptionDefault
INGEST_TUNE_CHUNKER_POOL_SIZEWorker threads for parallel AST parsing4
INGEST_TUNE_FILE_CONCURRENCYParallel file read + chunk dispatch50
INGEST_TUNE_IO_CONCURRENCYMax parallel file I/O during cache sync50

Data Directories

The server stores data in $TEA_RAGS_DATA_DIR (default ~/.tea-rags/).

VariableDescriptionDefault
TEA_RAGS_DATA_DIRRoot directory for all per-machine tea-rags state~/.tea-rags/

Layout under the data directory:

PathPurpose
snapshots/Sharded file hash snapshots for incremental indexing
logs/Debug logs when DEBUG=1 is enabled
qdrant/Embedded Qdrant binary and storage (when QDRANT_URL is unset or embedded)
registry.jsonProject registry: aliases + collection metadata. See Project Registry
update-check.jsonCached npm registry response used by tea-rags prime. Positive TTL 24h, negative TTL 5min. Safe to delete — regenerated on next prime. See Keeping tea-rags up to date.