Skip to content

feat: add AI-generated document notes support (Paperless-ngx v3 notes API) - #222

Open
DuMaM wants to merge 3 commits into
admonstrator:mainfrom
DuMaM:main
Open

feat: add AI-generated document notes support (Paperless-ngx v3 notes API)#222
DuMaM wants to merge 3 commits into
admonstrator:mainfrom
DuMaM:main

Conversation

@DuMaM

@DuMaM DuMaM commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Adds native support for AI-generated document notes (structured summaries) via the Paperless-ngx v3 notes API (POST /api/documents/{id}/notes/).

This lets paperless-ai automatically generate a concise summary during the AI analysis pass, giving users a quick overview without opening the full document.

Changes

  • config/config.js: add ACTIVATE_NOTES env var (activateNotes, default yes); add to limitFunctions and mustHavePrompt template
  • services/ollamaService.js: add notes field to documentAnalysisSchema + _generateSystemPrompt() JSON template
  • services/paperlessService.js: add note-writing helper for the v3 notes API
  • server.js: wire notes creation after successful analysis

Notes

  • Follow-up PR will add full-page local OCR (currently the OCR rescue only reads the document thumbnail) — tracked in the same fork branch.

Test plan

  • Deployed on a live Paperless-ngx 3.0.0-beta instance (AMD ROCm / Ollama)
  • Notes created via v3 API on analyzed documents

DuMaM added 2 commits July 11, 2026 05:30
…tes API

Adds native support for AI-generated document notes (summaries) that are
created via the Paperless-ngx v3 notes API (POST /api/documents/{id}/notes/).

Changes:
- config.js: Add ACTIVATE_NOTES env var and activateNotes setting (default: yes)
- config.js: Add 'notes' field to mustHavePrompt JSON template
- ollamaService.js: Add 'notes' to documentAnalysisSchema
- ollamaService.js: Add 'notes' to _generateSystemPrompt JSON template
- ollamaService.js: Extract 'notes' in _processOllamaResponse (structured path)
- ollamaService.js: Extract 'notes' in _parseResponse (text fallback paths)
- paperlessService.js: Add addDocumentNote(docId, noteText) method
- server.js: Add notes handling in buildUpdateData (_notesForPost)
- server.js: Call addDocumentNote after document PATCH in saveDocumentChanges

Notes are stored in updateData._notesForPost during buildUpdateData,
extracted before the PATCH call, then sent via POST to the notes API.
This avoids the limitation that PATCH /api/documents/{id}/ does not
support the 'notes' field.

The note is a brief structured summary (2-4 sentences) covering:
what the document is about, key details, amounts, parties involved,
deadlines, and any required actions.
feat: add AI-generated document notes support via Paperless-ngx v3 notes API
@admonstrator

Copy link
Copy Markdown
Owner

This will be considered as soon as v3 is available as the main version.

@admonstrator admonstrator added the enhancement New feature or request label Jul 16, 2026
@admonstrator admonstrator self-assigned this Jul 16, 2026
@admonstrator admonstrator added this to the v2026.09.01 milestone Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants