# MCP Server Configuration

# =============================================================================
# Embedding Provider Configuration
# =============================================================================
EMBEDDING_PROVIDER=mlx_server

# =============================================================================
# MLX Server Configuration (High-Performance Apple Silicon)
# =============================================================================
MLX_SERVER_URL=http://localhost:8000
MLX_BATCH_SIZE=128
# Character-based batching for consistent performance
# Lower = faster per-batch, more batches. Higher = fewer batches, longer per-batch
# Recommended: 10000-15000 based on benchmarks (~10-30 emb/s)
MLX_MAX_BATCH_CHARS=12000
MLX_TIMEOUT=180
MLX_MODEL_SIZE=small
MLX_FALLBACK_TO_OLLAMA=false

# Ollama Configuration (Fallback)
OLLAMA_HOST=http://localhost:11434
OLLAMA_DEFAULT_EMBEDDING_MODEL=Qwen3-Embedding:0.6b-ctx32k

# =============================================================================
# Fallback Chunking Configuration (for unsupported languages)
# =============================================================================
# Max characters per chunk before splitting (nomic-embed-text: 2048 tokens ≈ 8192 chars)
# Default: 6000 chars (~1500 tokens) for safety margin
FALLBACK_MAX_CHUNK_CHARS=6000
# Target lines per chunk when splitting large files
FALLBACK_TARGET_LINES=75
# Overlap lines between chunks for context continuity
FALLBACK_OVERLAP_LINES=15

# Qdrant Configuration
QDRANT_HOST=localhost
QDRANT_PORT=6333

# File Processing Configuration
MAX_FILE_SIZE_MB=5
DETECT_BINARY_FILES=true
LOG_SKIPPED_FILES=true
MAX_DIRECTORY_DEPTH=20
FOLLOW_SYMLINKS=false

# Performance Configuration (to be used in later tasks)
INDEXING_CONCURRENCY=4
INDEXING_BATCH_SIZE=50
EMBEDDING_BATCH_SIZE=50
QDRANT_BATCH_SIZE=500

# Memory Management Configuration
MEMORY_WARNING_THRESHOLD_MB=1000
MEMORY_CLEANUP_INTERVAL=5
FORCE_CLEANUP_THRESHOLD_MB=1500

# Database Operation Monitoring Configuration
DB_OPERATION_TIMEOUT=30
DB_RETRY_ATTEMPTS=3
DB_RETRY_DELAY=1.0
DB_HEALTH_CHECK_INTERVAL=50

# MCP Response Management Configuration
MAX_FILES_IN_RESPONSE=50

# Logging Configuration
LOG_LEVEL=INFO
