Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 66 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ POSTGRES_PORT=5432
# DATABASE_URL=sqlite:///app/data/index_cache.db
DATABASE_URL=postgresql+psycopg://contextcortex:cortexsecret@postgres:5432/contextcortex

# Optional explicit SQLite database path when DATABASE_URL is unset.
# CACHE_DB_PATH=/app/data/index_cache.db

# ------------------------------------------------------------------------------
# 2. Server, Vault & Local Storage Paths
# ------------------------------------------------------------------------------
Expand All @@ -31,6 +34,9 @@ PORT=3000
# LOG_LEVEL=INFO
VAULT_PATH=/docs

# Base data directory for persistent application storage.
# DATA_DIR=/app/data

# Managed local storage directory for direct file uploads, replacements, and incremental indexing.
# Defaults to data/storage or /app/data/storage if unset.
LOCAL_STORAGE_PATH=/app/data/storage
Expand All @@ -42,15 +48,21 @@ LOCAL_STORAGE_PATH=/app/data/storage
# Default when DATABASE_URL points to PostgreSQL is pgvector; otherwise qdrant.
VECTOR_STORE_PROVIDER=pgvector

# Vector store operating mode: embedded | remote
# VECTOR_STORE_MODE=remote

# Embedded storage path for file-based vector backends (e.g. local Qdrant)
VECTOR_STORE_STORAGE_PATH=/app/data/vectors
VECTOR_STORE_STORAGE_PATH=/app/data/vector_storage

# Vector collection name for documents and chunk embeddings
# Vector collection name for documents and chunk embeddings (alias: COLLECTION_NAME)
VECTOR_STORE_COLLECTION=knowledge_rag_v1

# Optional remote connection endpoint for Qdrant if using an external Qdrant server:
# QDRANT_URL=http://qdrant:6333

# Default dense semantic weight (0.0 to 1.0) for hybrid search fusion (default: 0.5).
# HYBRID_DENSE_WEIGHT=0.5

# ------------------------------------------------------------------------------
# 4. OpenAI-Compatible AI & Embedding Gateway
# ------------------------------------------------------------------------------
Expand All @@ -60,18 +72,56 @@ VECTOR_STORE_COLLECTION=knowledge_rag_v1
OPENAI_API_URL=http://litellm:4000/v1
OPENAI_API_KEY=dummy

# Batch size and CPU thread limits for ingestion pipelines:
# Embedding provider: local (FastEmbed ONNX) | api (OpenAI-compatible gateway).
# Default is local in source/container installs and api in the Windows portable bundle.
# EMBEDDING_PROVIDER=local
# EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
# SPARSE_MODEL=Qdrant/bm25

# Optional API fallback when local FastEmbed model initialization fails:
# EMBEDDING_ALLOW_FALLBACK=false
# EMBEDDING_FALLBACK_DENSE_MODEL=

# Optional default Vision OCR and Chat Summarization models:
# VISION_OCR_MODEL=
# CHAT_MODEL=

# CPU thread limit for local FastEmbed ONNX models (EMBEDDING_PROVIDER=local only).
# Has no effect when EMBEDDING_PROVIDER=api. Default: min(2, system_cpus).
EMBEDDING_NUM_THREADS=4

# Maximum chunks per embedding batch request (default: 32 for local, 128 for api, max 256 per API request).
# Chunks are batched across files during indexing.
EMBEDDING_BATCH_SIZE=32

# Parallel API embedding concurrency and rate-limit pacing (when EMBEDDING_PROVIDER=api):
# Number of parallel in-flight embedding API requests during indexing (default: 4).
# EMBEDDING_API_CONCURRENCY=4
# Estimated token cap per API batch request (default: 100000).
# EMBEDDING_MAX_TOKENS_PER_REQUEST=100000
# Optional tokens-per-minute pacing limit for strict quotas (default: 0 / unlimited).
# EMBEDDING_TPM_LIMIT=0

# Extra HTTP headers sent on every gateway request, as a JSON object.
# LLM_EXTRA_HEADERS={"X-User-Agent":"contextcortex","X-User-Name":"jdoe"}

# Folder with private CA certificates (*.crt) to trust at container start (see certs/README.md).
# EXTRA_CA_CERTS_DIR=/certs

# ------------------------------------------------------------------------------
# 5. MCP 2026-07-28 Authentication & RBAC Security Engine
# 5. MCP Tools & Code Mode Sandbox
# ------------------------------------------------------------------------------
# Enable the optional `manage` MCP write tool (default: false; exposes 10 read/search/code-mode tools).
# MCP_ENABLE_WRITE_TOOLS=false

# Code Mode (`execute_script`) sandbox limits:
# CODE_MODE_ENABLED=true
# CODE_MODE_TIMEOUT_SECONDS=30
# CODE_MODE_MAX_TOOL_CALLS=50
# CODE_MODE_MAX_MEMORY_MB=64

# ------------------------------------------------------------------------------
# 6. MCP 2026-07-28 Authentication & RBAC Security Engine
# ------------------------------------------------------------------------------
# Enable or disable Bearer token & API key authentication (true | false).
# When false (default), requests operate in unauthenticated local developer bypass mode.
Expand All @@ -94,20 +144,23 @@ AUTH_JWKS_URI=
ADMIN_INITIAL_KEY=

# ------------------------------------------------------------------------------
# 6. Background Poller, Sync, and Git Integration
# 7. Webhooks, Sync, and Git Integration
# ------------------------------------------------------------------------------
# Interval in seconds for background poller daemon to scan repositories for remote updates.
AUTO_SYNC_INTERVAL=300

# Global webhook secret for HMAC verification of push webhooks from GitHub / GitLab / Gitea.
GLOBAL_WEBHOOK_SECRET=

# Optional GitHub Personal Access Token for higher rate limits during remote repository cloning.
# Optional Personal Access Tokens for higher rate limits and private repository cloning.
# For self-hosted instances, you can also add per-host credentials in the Admin UI.
GITHUB_TOKEN=

# Optional GitLab Personal Access Token (read_repository scope) for cloning GitLab repositories.
# For self-hosted GitLab, you can also add a per-host credential in the admin UI.
GITLAB_TOKEN=
# GITEA_TOKEN=
# BITBUCKET_TOKEN=

# Directory used for temporary repository checkouts and shallow clones.
# Directory used for temporary repository checkouts and ephemeral shallow clones.
TMP_REPOS_DIR=/tmp/rag_repos

# Directory used for persistent shallow clones when keep_shallow is enabled.
# PERSISTENT_REPOS_DIR=/app/data/repos

# Maximum timeout in seconds for git clone operations (default: 300).
# GIT_CLONE_TIMEOUT_SECONDS=300
Loading
Loading