FeatureFuel
1

[Feature Request] AI suggestions: make the 4000-character content limit configurable

Source: paperless-ngx/paperless-ngx#14833 · opened by @morrolinux
AI usage Yes, AI tools helped write this request Description AI suggestions (title, tags, correspondent, ...) only ever see the first 4000 characters of a document. The cut is hard-coded in build_prompt_without_rag: truncate_content() already trims the content to fit llm_context_size. Because of the [:4000] slice before it, raising PAPERLESS_AI_LLM_CONTEXT_SIZE (or the UI setting) has no effect on how much of the document the model reads. Nothing in the docs or the UI says so. Example: a 38-page PDF with about 112k characters of OCR text. The model gets about 3.5% of it, which is roughly the first page. When the first page is a cover, a form header or a table of contents, the suggested title is poor, and changing the model or the context size does not help. Proposal Make the limit configurable, for example PAPERLESS_AI_LLM_CONTENT_LIMIT (environment variable and/or application setting), with 4000 as the default so current behaviour and prompt sizes stay the same. This matte…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests