# REQUIRED # ------------------ # These environment variables are required for the app to work # OpenAI API Key OPENAI_API_KEY= # Anthropic API Key ANTHROPIC_API_KEY= # Logfire Write Token # Get yours at https://logfire.pydantic.dev → Settings → Write Tokens LOGFIRE_TOKEN= # Database URL # For local development with Docker Compose: DATABASE_URL= # For production on Render, this will be auto-injected from the database service # Render Workflows (the Q&A pipeline runs as a Workflows service) # The gateway's POST /ask delegates to a Workflows service. Choose one setup: # # A) Fully local (no cloud, no API key) — run `render workflows dev` and set: # RENDER_USE_LOCAL_DEV=true # SDK targets http://localhost:8120 # WORKFLOW_SLUG=local # any non-empty value (satisfies the gateway guard) # # B) Point local gateway at a deployed cloud workflow — set instead: # RENDER_API_KEY=... # https://dashboard.render.com/settings#api-keys # WORKFLOW_SLUG=... # slug of your deployed Workflows service RENDER_USE_LOCAL_DEV= RENDER_API_KEY= WORKFLOW_SLUG= # OPTIONAL # ------------------ # These environment variables are not required for the app to work # Logfire Read Token (optional - for fetching logs via API) # Create a read-only token in your Logfire project → Settings → Read Tokens LOGFIRE_READ_TOKEN= # Pipeline Configuration MAX_TOKENS=4000 TIMEOUT_SECONDS=30 # RAG Configuration RAG_TOP_K=20 # Number of documents to retrieve (higher = more context, but slower) SIMILARITY_THRESHOLD=0.3 # Cosine similarity threshold (0-1) for document retrieval (lower = more permissive) VERIFICATION_THRESHOLD=0.30 # Similarity threshold (0-1) for claim verification (lower = more lenient) EMBEDDING_MODEL=text-embedding-3-small EMBEDDING_DIMENSIONS=1536 # Model Selection ANSWER_MODEL=claude-sonnet-4-6 CLAIMS_MODEL=gpt-5.4-mini ACCURACY_MODEL=claude-sonnet-4-6 EVAL_MODEL_OPENAI=gpt-5.4-mini EVAL_MODEL_ANTHROPIC=claude-sonnet-4-6 QUERY_EXPANSION_MODEL=gpt-4.1-nano # Performance ENABLE_CACHING=true LOG_LEVEL=INFO # Deployment environment tag for Logfire traces. # Leave as production when deployed; set to development locally so dev traces # aren't grouped with production in Logfire. # ENVIRONMENT=development # CORS # CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"]