Skip to content

enrich

fialr enrich <target> [options]

Extract text from files and run local LLM inference via Ollama to generate structured metadata: filename tokens, semantic tags, a one-sentence summary, and a confidence score. Tier 1 files are always skipped.


ArgumentDescription
targetDirectory to enrich (required)
OptionDescription
--executeApply enrichment metadata (not just report)
--jobs-dir PATHDirectory for job artifacts (default: .fialr/jobs)
--sensitivity-rules PATHPath to sensitivity.yaml (default: config/sensitivity.yaml)

Enrichment requires:

  1. Ollama running locally at http://localhost:11434 (configurable in fialr.toml)
  2. A pulled model (default: llama3.2, configurable under [enrichment].model)

Sensitivity tiers gate access to the enrichment pipeline:

TierAccess
1 (RESTRICTED)Never enters the pipeline. This is enforced, not advisory.
2 (SENSITIVE)Local LLM on extracted text only. No raw file content sent to inference.
3 (INTERNAL)Full local enrichment.

fialr extracts text from files using format-specific tools:

FormatExtraction method
Scanned PDFocrmypdf + Tesseract OCR
Native PDFpypdfium2
Photospiexif (EXIF metadata)
Audiomutagen (ID3 tags)
Office documentspython-docx, openpyxl

Extracted text is sent to Ollama running on localhost. The inference layer is abstracted behind inference.py — cloud endpoints cannot be configured. The LLM returns structured JSON:

  • Date — document subject date
  • Entity — primary subject or organization
  • Descriptor — semantic description
  • Tags — semantic tags
  • Summary — one-sentence summary
  • Confidence — 0.0 to 1.0 score

The confidence threshold (default: 0.7, configurable in fialr.toml under [enrichment].confidence_threshold) determines what happens with inference results:

  • Above threshold — metadata is auto-applied to XATTRs and SQLite
  • Below threshold — file is sent to the review queue with the LLM suggestion attached as a hint for manual review

Dry-run:

enrich ~/Documents
────────────────────────────────────────────────────────
enriched 623
review 89
skipped 135 (tier 1: 12, no text: 123)
errors 0

Terminal window
# Dry-run enrichment
fialr enrich ~/Documents
# Apply enrichment metadata
fialr enrich ~/Documents --execute