clusterzx/paperless-ai

← Alle Releases
v4.4.0 vor 4 Stunden clusterzx clusterzx Auf GitHub ansehen

v4.4.0 | Introducing Prompt rules

Highlights

Prompt rules – different prompts and settings per kind of document

One archive, different kinds of documents: household papers need a correspondent, a document type and the tax year – teaching material needs a subject, a grade and no correspondent at all. With prompt rules (Prompt library → Prompt rules), matching documents are analysed with another prompt from the library and their own settings. The first matching rule wins; all other documents keep using the system prompt, so nothing changes until you add a rule.

  • Conditions: tags (any / all), document type, correspondent, storage path, owner, custom field value. A rule without conditions catches everything else.
  • Settings per rule: which fields the AI fills (e.g. no correspondent), which custom fields, only existing tags / correspondents / document types, fixed lists of allowed tags or document types, and another model of your AI provider.
  • See what happens: the manual review and the playground show which rule applies to a document; the history and the prompt library show which prompt was used.
  • Docker: set the rules with PROMPT_RULES (JSON, prompts referred to by name).

Tip: let Paperless set a routing tag on consumption (a workflow or CONSUMER_SUBDIRS_AS_TAGS) and use it as the condition of a rule. Details in the README.

Upgrade notes

  • A database migration runs automatically on start (the history now records which prompt was used).
  • Without prompt rules, processing works exactly as before.

What's Changed

  • Prompt rules: different prompts and settings per kind of document by @clusterzx in https://github.com/clusterzx/paperless-ai/pull/1022

Full Changelog: https://github.com/clusterzx/paperless-ai/compare/v4.3.1...v4.4.0