Configuration

src.config.schema.Config defines the contract. Only project and queries are required at the top level. Unknown fields are rejected at every level. The complete example runs with defaults.

Supported fields

FieldDefaultContract
project.nameRequiredNon-empty display name without path separators
project.descriptionEmpty stringRetained metadata; not supplied to the AI prompts
project.output_dir./outputsOutput path relative to the working directory
data_source.providerserpapiOnly implemented provider
data_source.api_key_envSERPAPI_KEYEnvironment variable containing the provider key
queriesRequiredOne to five objects with query and label
queries[].queryRequiredNon-empty, unique term without the provider comma separator
queries[].labelRequiredNon-empty, unique display label
parameters.geoGBRegion supplied to SerpAPI; empty string requests worldwide
parameters.date_rangetoday 12-mNon-empty date expression supplied to SerpAPI
parameters.smoothing_period3Integer at least 1; observed rows, not calendar months
analysis.insights.enabledtrueEnable narration; missing key yields an automated summary
analysis.trend_thresholds.rising_threshold0.1Strictly positive, at most 10; percentage points per observation
analysis.trend_thresholds.falling_threshold-0.1At least -10 and strictly negative; same units
analysis.share_validation_tolerance0.10 to 5 percentage points for the arithmetic share-sum check
visualization.themeprofessionalOnly implemented theme
visualization.dpi300Integer at least 72
options.retry_attempts3Non-negative; retries after the initial SerpAPI request
options.retry_delay5Initial SerpAPI backoff in seconds; at least 1
options.log_levelINFODEBUG, INFO, WARNING, ERROR or CRITICAL; case-insensitive

The smoothing period controls a trailing mean of interest, the momentum lookback and rolling share volatility. It does not resample data. The line chart displays raw interest; the trailing mean is an additional CSV column when the window exceeds one.

Environment

VariablePurpose
SERPAPI_KEYRequired by the default provider configuration
OPENAI_API_KEYOptional OpenAI authentication
OPENAI_MODELOptional compatible Chat Completions model; default gpt-4-turbo

load_config loads .env beside the YAML file. Existing process values win. The direct Config constructor validates settings without loading credentials. Model availability is account-dependent. See AI narration.

Removed inactive settings

Older YAML files accepted these settings without implementing their behaviour. Remove them before using this candidate. Unsupported fields now raise a configuration error rather than giving the impression that they were applied.

Removed settingActual capability
parameters.granularityProvider resolution is retained
analysis.metricsThe pipeline computes its fixed metric set; no seasonality estimator
analysis.insights.auto_detect_anomaliesDescriptive anomaly flags are always calculated
analysis.insights.confidence_thresholdThe anomaly rule uses absolute z-score greater than 2.5; no confidence level
queries[].color or colourFixed chart palette
visualization.chartsFour fixed PNG charts; custom charts remain available through Python methods
reportingCSV, PNG, optional text and conditional PowerPoint only; no HTML, PDF or Excel report engine
options.cache_enabled, cache_ttl, parallel_requestsOne comparison request, retries, no local cache or request parallelism

No statistical uncertainty can be created by relaxing the share-sum tolerance. All-zero dates remain invalid regardless of tolerance.

See outputs for filenames and troubleshooting for validation failures.