Skip to content

Configuration

Jean-Baptiste THERY edited this page Jul 15, 2026 · 17 revisions

Configuration

Ragmir reads .ragmir/config.json from the current directory or an ancestor. Start with rgr setup and edit JSON only for a concrete need.

{
  "sources": ["docs/**/*.md", "src", "!docs/archive/**"],
  "privacyProfile": "private",
  "retrievalProfile": "balanced",
  "embeddingProvider": "local-hash"
}

Common fields

Field Default Why change it
sources [] Add paths, globs, and ! exclusions
privacyProfile private Use strict for the strongest local floor
retrievalProfile balanced Choose fast, quality, or an explicit custom budget
embeddingProvider local-hash Select transformers only after an explicit preload
topK 8 Change the default passage count
mcpMaxOutputBytes 32768 Bound variable-size MCP tool and resource JSON; the server also enforces an absolute 1 MiB ceiling
chunkSize / chunkOverlap 1200 / 200 Tune chunking, then rebuild
maxFileBytes 50000000 Raise only when the corpus justifies it
includeExtensions [] Add safe custom text extensions

Changing an embedding provider, model, or chunking field requires rgr ingest --rebuild.

Semantic retrieval

rgr setup --semantic
rgr ingest --rebuild

This preloads the configured Transformers model once and leaves remote model loading disabled for normal retrieval. rgr models pull --enable enables the same provider after initial setup.

Privacy profiles

  • private defaults remote model loading to disabled and keeps redaction enabled; remote Transformers loading still requires an explicit opt-in.
  • strict also bounds MCP output and disables every external extractor.
  • trusted and custom are explicit operator choices for different controls.

The privacy profile is a safety floor, separate from retrieval quality.

Local extractors

rgr ocr doctor
rgr ocr setup --language eng+fra

OCR is optional and page-aware. Custom extractor commands must be JSON argument arrays. They execute without a shell and must print text to stdout.

Environment overrides

Use RAGMIR_* environment variables for local experiments, then run rgr status --json to inspect the effective configuration.

For a long-running process with multiple isolated project workflows, create one client per project root with createRagmirClient({ cwd }), keep process-wide environment overrides stable after startup, and close every client during shutdown. If several OS processes can ingest the same storage directory, the host must coordinate a single writer.

Parser safety limits

Run rgr limits to inspect fixed parser ceilings. Office archives allow at most 512 text entries, 25 MB per entry, and 50 MB of expanded text in total. PDF extraction is capped at 1,000 pages and 25 million text characters. Combined stdout and stderr from a local external extractor are capped at 25 MB; files above maxFileBytes are skipped and reported.

Canonical source: docs/configuration.md.

Clone this wiki locally