mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-13 19:47:13 +00:00
* Fix: use a root document's effective content for the LLM index and prompts The search index and the document views use the newest version's content as a root document's content, but everything the LLM side reads used the root's own content: the text embedded in the LLM index, the content in the classification prompt, the context blocks from similar documents, and the text that is searched for similar documents. After a document was replaced by a new version the LLM kept answering from the old text. Read get_effective_content() in those four places. The index update annotates the content in the query like the search index does, and the similar-document lookup annotates it for the documents it fetches, so no query is made per document. Entries already in the LLM index keep the old text until the document next changes or the index is rebuilt. * Chore: test the LLM query text and bulk annotation use effective content * Removes the query count testing. It's flakey from local to CI and workers, doesn't really add much imo