# ============================================================================= # Lex Research API — Environment Variable Reference # ============================================================================= # Copy this file to .env and fill in the required values. # Variables marked SECRET must never be committed to version control. # # Legend: # REQUIRED — must be set for the application to start # CONDITIONAL — required only when a feature toggle is enabled # OPTIONAL — has a sensible default; override only if needed # ============================================================================= # ----------------------------------------------------------------------------- # Azure OpenAI # ----------------------------------------------------------------------------- # Powers all embedding generation and chat completions. # SECRET | REQUIRED — Azure OpenAI API key AZURE_OPENAI_API_KEY= # REQUIRED — Full endpoint URL, e.g. https://my-resource.openai.azure.com/ AZURE_OPENAI_ENDPOINT= # OPTIONAL — Embedding deployment name (default: text-embedding-3-large) AZURE_OPENAI_EMBEDDING_DEPLOYMENT=text-embedding-3-large # OPTIONAL — Chat completions deployment name (used by explanation/summary generators) # AZURE_OPENAI_CHAT_DEPLOYMENT=gpt-4o # OPTIONAL — Azure OpenAI API version (default: 2024-12-01-preview) OPENAI_API_VERSION=2024-12-01-preview # ----------------------------------------------------------------------------- # Qdrant Vector Database # ----------------------------------------------------------------------------- # Supports local (Docker) or Qdrant Cloud. Toggle with USE_CLOUD_QDRANT. # OPTIONAL — Set to "true" to use Qdrant Cloud instead of local (default: false) USE_CLOUD_QDRANT=false # CONDITIONAL — Required when USE_CLOUD_QDRANT=true # QDRANT_CLOUD_URL=https://your-cluster.cloud.qdrant.io:6333 # QDRANT_CLOUD_API_KEY= # SECRET # OPTIONAL — Local Qdrant connection (defaults shown) QDRANT_HOST=http://localhost:6333 QDRANT_GRPC_PORT=6334 # QDRANT_API_KEY= # SECRET — only if local instance is secured # ----------------------------------------------------------------------------- # Azure Blob Storage # ----------------------------------------------------------------------------- # Used by bulk export jobs and historical PDF processing. # SECRET | CONDITIONAL — Required for bulk export and PDF upload jobs # AZURE_STORAGE_CONNECTION_STRING= # OPTIONAL — Blob container for bulk export output (default: downloads) # BULK_DOWNLOAD_CONTAINER=downloads # OPTIONAL — Public URL base for bulk download links DOWNLOADS_BASE_URL=https://lexdownloads.blob.core.windows.net/downloads # ----------------------------------------------------------------------------- # Redis # ----------------------------------------------------------------------------- # Provides caching and rate-limit state. If unset, caching is disabled and # rate limiting falls back to in-memory counters. # SECRET | OPTIONAL — Redis connection URL, e.g. rediss://host:6380 # REDIS_URL= # SECRET | OPTIONAL — Redis password (if not embedded in REDIS_URL) # REDIS_PASSWORD= # ----------------------------------------------------------------------------- # PostHog Analytics # ----------------------------------------------------------------------------- # Cookieless, GDPR-compliant analytics. Leave POSTHOG_KEY empty to disable. # SECRET | OPTIONAL — PostHog project API key (default: empty = disabled) POSTHOG_KEY= # OPTIONAL — PostHog host (default: EU region) POSTHOG_HOST=https://eu.i.posthog.com # ----------------------------------------------------------------------------- # Langfuse Observability # ----------------------------------------------------------------------------- # Optional tracing for LLM calls in processing pipelines. # SECRET | OPTIONAL — Langfuse public key # LANGFUSE_PUBLIC_KEY= # SECRET | OPTIONAL — Langfuse secret key # LANGFUSE_SECRET_KEY= # OPTIONAL — Langfuse host (default: https://cloud.langfuse.com) # LANGFUSE_HOST=https://cloud.langfuse.com # ----------------------------------------------------------------------------- # Azure Application Insights # ----------------------------------------------------------------------------- # Production telemetry and logging. Optional for local development. # SECRET | OPTIONAL — Application Insights connection string # APPLICATIONINSIGHTS_CONNECTION_STRING= # ----------------------------------------------------------------------------- # Rate Limiting # ----------------------------------------------------------------------------- # OPTIONAL — Max requests per minute per client (default: 60) RATE_LIMIT_PER_MINUTE=60 # OPTIONAL — Max requests per hour per client (default: 1000) RATE_LIMIT_PER_HOUR=1000 # ----------------------------------------------------------------------------- # Caching # ----------------------------------------------------------------------------- # OPTIONAL — Default cache TTL in seconds (default: 28800 = 8 hours) DEFAULT_CACHE_TTL=28800 # ----------------------------------------------------------------------------- # Runtime # ----------------------------------------------------------------------------- # OPTIONAL — Environment name: localhost | dev | preprod | prod (default: localhost) ENVIRONMENT=localhost # OPTIONAL — Max concurrent workers for embedding generation (default: 5) EMBEDDING_MAX_WORKERS=5