Skip to content

Unified config file (file < env/.env < CLI precedence) consolidating RAG_* + attachment + MCP settings #39

@fmasi

Description

@fmasi

Motivation

Config today is split: env vars / .env (src/config/settings.py RAGConfig + the LLM client) and the per-corpus profile JSON (CorpusProfile). There's no general config-file base layer. As settings accumulate (attachment extractor + cloud opt-in from #38, and especially the MCP server settings in Phase 1b #32 — port, exposed tools), a single canonical config file becomes worthwhile.

Proposal

Add a config-file base layer with standard precedence (low → high):

  1. config file — e.g. ~/.mailrag/config.toml (tomllib is stdlib, read-only; or YAML, already a dep)
  2. env / .env — existing RAG_* vars override the file
  3. CLI flag — highest priority per-invocation override

Consolidate the existing RAG_* settings (LLM provider/model/temperature/base-url/key, embedding provider/model/batch/workers, chunk size/overlap) plus the new RAG_ATTACH_EXTRACTOR (#38) and the future MCP settings.

Scope / sequencing

Refs: #38 (extractor + cloud opt-in), #32 (MCP settings), src/config/settings.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions