Configuration¶
For Most Users
You probably don't need to read this page! Egregora is designed to work with zero configuration for 95% of users. The defaults are carefully chosen to create beautiful results automatically.
MODERN (Phase 2-4): Egregora configuration lives in .egregora.toml, separate from rendering (MkDocs).
Configuration sources (priority order): 1. CLI arguments - Highest priority (one-time overrides) 2. Environment variables - EGREGORA_SECTION__KEY (e.g., EGREGORA_MODELS__WRITER) 3. .egregora.toml - Main configuration file 4. Defaults - Defined in Pydantic EgregoraConfig model
CLI Configuration¶
The egregora write command accepts many options:
Core Options¶
| Option | Description | Default |
|---|---|---|
--output-dir | Output directory for blog | site |
--timezone | Timezone for message timestamps | None |
--step-size | Size of each processing window | 1 |
--step-unit | Unit: messages, hours, days, bytes | days |
--from-date | Start date (YYYY-MM-DD) | None |
--to-date | End date (YYYY-MM-DD) | None |
Model Configuration¶
| Option | Description | Default |
|---|---|---|
--model | Override LLM model for all tasks | None |
Feature Flags¶
| Option | Description | Default |
|---|---|---|
--enable-enrichment/--no-enable-enrichment | Enable AI enrichment (images, links) | True |
Environment Variables¶
MODERN: Only credentials live in environment variables (keep out of git).
.egregora.toml¶
MODERN (Phase 2-4): Main configuration file (maps to Pydantic EgregoraConfig model).
Generated automatically by egregora init or egregora write on first run:
Location: .egregora.toml in site root (next to mkdocs.yml)
Sites and sources (multi-site configs)¶
You can now register multiple data inputs and publishing targets in a single .egregora.toml. Define reusable sources once, then map them to one or more sites:
Selection behavior
- CLI
--site/--sourceorEGREGORA_SITE/EGREGORA_SOURCEenvironment variables take precedence. - If you omit flags and only one site or source is defined, it is selected automatically.
- If multiple entries exist and no selection is provided, Egregora picks the
defaultsite if present, otherwise the first entry and logs a warning. This maintains backward compatibility while encouraging explicit selection. - Legacy single-site configs without
[sites.*]still work. The loader treats them as a single implicit site and applies the provided--source-type/EXPORT_PATHinputs as before.
Backward compatibility
- Existing top-level settings remain valid. When
sites.*is absent, your file is interpreted as a single-site configuration. - You can introduce
[sources.*]gradually; if none are present, CLI positional arguments continue to drive ingestion. - MkDocs config paths and content directories remain relative to the site root, so you can keep your current layout while adding new sites alongside it.
Migrating from a single-site config¶
Follow this checklist to adopt the new structure without disrupting current runs:
- Copy your existing
.egregora.tomland wrap the content under[sites.default](or another site name of your choice). Keep the nested sections ([paths],[pipeline],[models], etc.) intact—only their prefix changes. - Add a named source under
[sources.<name>]that captures the CLI arguments you normally pass (type,path,timezone, date filters). Reference that name fromsites.<name>.sources. - Keep MkDocs config paths unique (
sites.<name>.output.adapters[0].config_path) if you publish more than one site in the same repo. Otherwise you can continue to use.egregora/mkdocs.yml. - Test a dry run with your usual CLI command plus
--site <name>to confirm the site selection is intentional. Remove the flag once you are comfortable relying on the default-selection rules above. - Clean up legacy keys once you verify the new layout (optional). The loader will ignore top-level settings when
sites.*exists, but removing them avoids confusion.
Advanced Configuration¶
Custom Prompt Templates¶
MODERN (Phase 2-4): Override prompts by placing custom Jinja2 templates in .egregora/prompts/.
Directory structure:
Priority: Custom prompts (.egregora/prompts/) override package defaults (src/egregora/prompts/).
Example: Override writer prompt
Agents automatically detect and use custom prompts. Check logs for:
Database Configuration¶
Egregora stores persistent data in DuckDB:
- Location:
.egregora/pipeline.duckdb(by default) - Tables:
rag_chunks,annotations,elo_ratings
To use a different database, modify the [database] section in .egregora.toml.
Cache Configuration¶
Egregora caches LLM responses to reduce API costs:
- Location:
.egregora/.cache/(by default) - Type: Disk-based LRU cache using
diskcache
To clear the cache:
Model Selection¶
Writer Models¶
For blog post generation:
google-gla:gemini-flash-latest: Fast, creative, excellent for blog posts (recommended)
Enricher Models¶
For URL/media descriptions:
google-gla:gemini-flash-latest: Fast, cost-effective (recommended)
Embedding Models¶
For RAG retrieval:
models/text-embedding-004: Latest, 768 dimensions (recommended)models/text-embedding-003: Older, 768 dimensions
Performance Tuning¶
Rate Limiting¶
Egregora automatically handles rate limits. To customize quotas, edit the [quota] section in .egregora.toml:
Examples¶
High-Quality Blog¶
Fast, Cost-Effective¶
Next Steps¶
- Architecture Overview - Understand the pipeline
- API Reference - Dive into the code