feat: add AI-generated document notes support (Paperless-ngx v3 notes API) - #222
Open
DuMaM wants to merge 3 commits into
Open
feat: add AI-generated document notes support (Paperless-ngx v3 notes API)#222DuMaM wants to merge 3 commits into
DuMaM wants to merge 3 commits into
Conversation
…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
Owner
|
This will be considered as soon as v3 is available as the main version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: addACTIVATE_NOTESenv var (activateNotes, defaultyes); add tolimitFunctionsandmustHavePrompttemplateservices/ollamaService.js: addnotesfield todocumentAnalysisSchema+_generateSystemPrompt()JSON templateservices/paperlessService.js: add note-writing helper for the v3 notes APIserver.js: wire notes creation after successful analysisNotes
Test plan