# Dibab

## Files the administrative documents of a household, on its own machines

Invoices, letters and contracts pile up in download folders, on a second computer and in a mailbox, and each needs a name and a place where it will be found again. Dibab reads them with language models on your machine, files the ones it is sure about into a vault per domain and keeps a journal that `--rollback` can undo.

## What a run looks like

A run starts as a simulation: nothing is moved, and each line says what Dibab found and where the document would go. This is an excerpt of the output of `dibab --dry-run` on the four documents of the trial area: the letter without a header goes to the check folder.

```text
  - courrier-sans-en-tete.pdf: triage administrative, domain incertain, agreement 1/1
      subject: courrier de suivi de dossier
      reason: no recipient quoted and no known issuer
      -> vault personnel, a_verifier: ~/Classement/Personnel/TO_CHECK/[TO_CHECK]courrier-de-suivi-de-dossier_courrier-sans-en-tete.pdf (not moved)
```

A document the models are unsure about is routed to the `TO_CHECK/` folder of the vault, never to a guessed place. The folder and its prefix are set by `sous_repertoire_a_verifier` and `nommage.prefixe_a_verifier`; the folder that receives duplicates is `duplicate/`, set by `destination.repertoire_doublon`. With firm verdicts supplied for the same letter, the simulated routing prints the name and the folder the document gets: a date, a sender and a category, under the person and the year.

```text
- notification-organisme.pdf: domain personnel
    -> vault personnel, classement: ~/Classement/Personnel/Administratif/Alice/2026/2026-03-15_Organisme-public_Aides.pdf
```

## What Dibab does

- It scans local folders, remote machines over `ssh` (each copy is checked by its fingerprint and the originals stay where they are) and mailboxes over read-only IMAP.
- It extracts the text of each document, from the text layer of a PDF or, for a scan, by a reading with a vision model, then sets aside what is not administrative.
- It files the rest by category and by domain with the votes of several models, renames each document and moves it into the vault of its domain.
- It writes a timestamped journal of every action, kept in the vault when you set the `suivi.*` keys and otherwise in the state directory in clear text, and `--rollback` undoes the last session from it.

The [documentation](https://dibab.davalan.fr/documentation/index.md) lists the chapters of the manual that cover each step.

## Who it is for

Dibab is made for the administrative life of one household, by the household: the person who runs it decides, with the people concerned, which machine, folder or mailbox enters the scope, and leaves out whatever is in doubt. It suits anyone who already runs Linux machines at home, keeps documents on an encrypted volume and is willing to run a model server of their own. The [security page](https://dibab.davalan.fr/security/index.md) says what stays under the administrator's responsibility.

## What it does not do

- It does not move a document it is not sure about: doubt leads to the `TO_CHECK/` folder.
- It does not delete a document: it moves and copies, and only prunes its own old journals.
- It does not modify a mailbox or a remote machine.
- It does not run in the background: you start it by hand, and the default mode is the simulation.
- It does not mount, encrypt or synchronise a vault: that stays with you.
- It does not file ordinary photos, screenshots or technical documentation: only a document with administrative content is filed, and a photographed letter is read by OCR like a scan.

