src/config.py and can be overridden using a .env file or environment variables.
Configuration File Setup
Environment Variable Naming
Configuration uses nested environment variables with double underscore (__) delimiter:
Core Configuration Sections
Application Settings
Configure the FastAPI application and Uvicorn server:API title displayed in documentation
Port number for the API server
Enable hot reload during development
Number of Uvicorn worker processes
Logging Configuration
Control logging behavior and verbosity:Log level:
debug, info, warning, error, or criticalEnable HTTP access logs
Enable colored log output (useful for development)
Database Configuration
Configure PostgreSQL database connection:Database server hostname or IP address
PostgreSQL port number
Database name
Database username
Database password
Full database connection URL. If not provided, it’s auto-constructed from individual parameters.
SQLAlchemy connection pool size
Maximum overflow connections beyond pool_size
Enable SQL query logging (useful for debugging)
LLM Configuration
Configure OpenAI-compatible LLM providers:API key for OpenAI-compatible service (e.g., OpenRouter, vLLM)
Base URL for the LLM API endpoint
Model identifier to use for requests
Request timeout in seconds
Langfuse Tracing
Configure Langfuse for LLM observability and tracing:Enable/disable Langfuse tracing
Langfuse project secret key
Langfuse project public key
Langfuse host URL
Environment identifier for traces (e.g., dev-john, staging, production)
Search Configuration
Configure web search capabilities:Search method:
ddgs (DuckDuckGo) or braveBrave Search API key (required if using Brave)
Scrape and Process Settings
Configure web scraping and content processing:Maximum outer iterations of the scraper loop
Maximum tokens per chunk for LLM processing
Maximum concurrent chunk processing tasks
Configuration Best Practices
Use .env for local development
Keep local settings in
.env (git-ignored)Use environment variables in production
Set environment variables directly in Docker/Kubernetes
Never commit secrets
Keep API keys and passwords out of version control
Document custom settings
Add comments to your
.env file for team clarityValidation and Loading
The configuration is validated on application startup using Pydantic. If required fields are missing or invalid, the application will fail to start with a clear error message:Viewing Current Configuration
To inspect the current configuration at runtime, access the/health endpoint or check application logs during startup.
Next Steps
Database Setup
Configure and initialize PostgreSQL
Docker Setup
Deploy with Docker Compose