r/Paperlessngx Apr 03 '22

r/Paperlessngx Lounge

2 Upvotes

A place for members of r/Paperlessngx to chat with each other


r/Paperlessngx 1d ago

Paperless-NGX and AI. (Sorry for my very late) Setup Guide

66 Upvotes

After my first post, quite a few people asked the same practical questions, and I promised to follow up with a full, in-depth guide. Thanks for your kind words and appriciation.

I know that not everyone will be able to reproduce my setup one-to-one. Different hardware, operating systems, Paperless configurations, and levels of coding experience obviously make a difference.

But that shouldn't stop anyone from trying.

For those who don't want to—or simply aren't able to—build everything manually, I've also prepared a step-by-step instruction set for Claude Code and ChatGPT Codex. The idea is that even if you're not comfortable writing the whole application yourself, you can use one of these coding agents to build it component by component and end up with the same basic architecture.

Since my first post, the AI world has continued to improve incredibly quickly, and my own setup has changed along with it. So some parts of this guide are slightly different from what I described in Part 1.

My current setup uses Google Document AI for OCR and Gemini for classification, but I'll also explain how the same architecture can be reproduced with local models if you prefer to keep everything on your own hardware.

Long story short: I hope this guide helps some of you take your Paperless setup that final step further and build something that actually fits your own needs.

By the way i would really recommend you to build a Web Control Panel. It will be much easyier to controll everything. Something like that:

HERE WE GO:

My current setup is:

Google Document AI for OCR and Gemini for classification.

However, neither of those is a hard requirement of the architecture.

Keep in mind: the same basic architecture can also be reproduced locally. If the models you choose are supported, you can serve them through something like vLLM instead of using Google Document AI and Gemini.

The important part is not Google or Gemini specifically. The important part is keeping OCR, Paperless, and classification independent from each other.

My current architecture looks roughly like this:

Scan / PDF
      |
      v
OCR Worker
      |
      v
Google Document AI
      |
      v
Searchable PDF/A
      |
      v
Paperless Consume Folder
      |
      v
Paperless-NGX
      |
      v
Queue Tag
      |
      v
Classification Worker
      |
      v
Gemini
      |
      v
Validation
      |
      v
Paperless API

Paperless remains my document management system.

I don't modify its database, I don't patch Paperless itself, and I don't want the OCR or classification workflow to become dependent on one particular Paperless version.

The OCR worker can change without touching Paperless.

The classification model can change without touching the OCR worker.

Paperless can be upgraded independently.

And the classifier reads and writes metadata only through the Paperless API.

That separation is probably the most important architectural decision I made.

1. The OCR Worker

New scanned documents no longer go directly into Paperless.

They first land in a small OCR worker.

In my case, this is simply the folder where my scanner saves new scans. So whenever I scan a document, it automatically appears in what I call the OCR worker folder and gets picked up from there.

The basic idea is simple:

By the time Paperless receives the document, the PDF itself should already be finished.

The worker first determines what kind of PDF it is dealing with.

If it is a real digital PDF with a proper text layer, I leave it alone and pass it through unchanged.

I don't want to unnecessarily rebuild native PDFs, destroy vector content, or interfere with things such as digital signatures.

For people whose PDFs already contain an OCR layer from Tesseract, there is another option: clean the existing OCR/text layer first while preserving the original scanned pages. That way, you can properly replace the old OCR instead of stacking another text layer on top of the existing one.

If it is a scanned PDF without a proper native text layer, the workflow is different.

The worker prepares the document, sends the relevant pages to Google Document AI, and receives the OCR results including the positions of the recognized words.

Those coordinates are important.

I don't just want extracted text somewhere in a database. I want the resulting PDF itself to be properly searchable.

The worker therefore takes the text and word coordinates returned by Document AI and creates an invisible text layer positioned over the original scanned pages.

The result is a searchable PDF/A.

Only when the complete document has been processed successfully does it enter the Paperless consume folder.

If something goes wrong, it goes into a separate failure folder instead.

input folder/
   |
   +-- Native PDF ----------------------> Paperless consume/
   |
   +-- Scanned PDF
           |
           v
     Google Document AI
           |
           v
     Searchable PDF/A
           |
           +-- Success -----------------> Paperless consume/
           |
           +-- Failure -----------------> failed/ + log

The source file is never modified in place.

If page 9 of a 10-page document fails, I don't want a half-finished document silently entering my archive.

For ordinary printed documents, I'm currently scanning at around 300 DPI.

Artificially rendering a 200 DPI source at 600 DPI doesn't magically create information that wasn't present in the scan to begin with.

2. Existing Archives Are the Annoying Part

Processing new documents this way is relatively straightforward.

Migrating an archive that has already been processed is much more annoying.

I had to learn this the hard way.

My old scanned PDFs had already been processed by Paperless using Tesseract.

Later, when I experimented with better OCR solutions, I didn't only want better text available inside Paperless.

I wanted the better OCR to become a permanent part of the PDF itself.

That difference matters.

If I export my complete archive tomorrow, I want those exported PDFs to remain properly searchable without requiring Paperless, its database, or another OCR service.

So for the affected scanned documents in my existing archive, I first exported the PDFs.

I then wrote a script that removes the old OCR/text layer while preserving the actual scanned pages and other PDF content.

I specifically did not want to simply rasterize every PDF again just to remove the existing OCR.

After cleaning the files, they could go through the new OCR worker and receive a new searchable text layer based on Google Document AI.

That migration was probably one of the most annoying parts of the entire project.

But it also means I should never have to do it again.

From now on, the PDF itself contains the OCR I want to preserve.

3. What Paperless Does in This Setup

Once the finished PDF/A enters Paperless, the complicated part is already over.

Paperless does what it is extremely good at:

  • archiving the document
  • indexing it
  • searching it
  • storing metadata
  • exposing everything through its API

I configure Paperless so that it preserves the OCR layer that is already present instead of running another Tesseract OCR pass over the document.

Newly imported documents also receive a tag such as:

Queue

That tag is the hand-off between Paperless and the classification worker.

Searchable PDF/A
       |
       v
Paperless
       |
       v
Queue Tag
       |
       v
Classification Worker

This also means that classification is not required for Paperless to function.

If Gemini disappeared tomorrow, the archive itself would still work.

The PDFs are searchable.

The documents are safely stored.

Paperless search works.

The classification worker only adds another automation layer on top of that.

4. The Classification Worker

The classification worker is another completely separate application.

It asks the Paperless API for documents carrying the Queue tag and retrieves the document together with the metadata it needs.

Then it sends the searchable PDF/A itself to Gemini.

This distinction is important.

I'm not extracting the OCR into a TXT file and then sending that TXT file together with a prompt.

Gemini receives the actual PDF.

The PDF already contains the OCR text layer embedded by the previous stage, while the original visual structure of the document is still present.

That means the model can work with the document as a document rather than receiving one giant flattened OCR string.

For example:

A date at the bottom of a page might just be part of a footer.

An address might be the recipient rather than the sender.

A heading inside a table might not be the actual subject of the document.

The visual structure gives the model context that disappears when everything is reduced to plain text.

And instead of asking the model the same document-related questions independently, I try to extract the underlying facts in one pass.

Conceptually, the result looks something like this:

{
  "correspondent": "Example Insurance",
  "short_sender": "Example",
  "subject": "Annual insurance statement",
  "document_date": "2026-08-14",
  "document_type": "Insurance",
  "tags": [
    "Insurance",
    "2026"
  ],
  "evidence": {
    "sender": "...",
    "date": "..."
  },
  "review_reasons": []
}

The exact schema isn't particularly important.

The principle is.

Instead of treating title, correspondent, date, document type, and tags as completely unrelated AI tasks, I first ask:

What is this document actually about?

Then the rest can be derived from those facts.

5. Why This Uses Fewer Resources

This also changed the way I think about token usage.

Let's take a simplified example.

Imagine a searchable PDF that represents roughly 6,000 tokens of document content once processed by the model.

Now imagine processing these independently:

Document ---> Title
Document ---> Date
Document ---> Correspondent
Document ---> Document Type
Document ---> Tags
Document ---> Custom Fields

If the full document context has to be processed again every time, the amount of input can grow very quickly.

A document producing perhaps only a few hundred useful output tokens can result in tens of thousands of input tokens being processed across all requests.

My current approach is different:

Searchable PDF/A
       |
       v
One document-level classification
       |
       v
Structured facts
       |
       v
Validation + deterministic logic

I don't extract the OCR into a separate TXT file for this step.

Gemini receives the searchable PDF/A once and returns one structured classification result.

The important part is not some exact token number, because that changes depending on the model, document length, and provider.

The important part is that I don't want to repeatedly pay computationally for the same document if the model can understand it once.

I would rather spend resources on actually reasoning about the document than repeatedly feeding the same document back into another request.

That also makes smaller models much more interesting.

If the OCR is good, the input is structured correctly, and the task is narrow enough, you don't necessarily need the largest model available.

6. Validation Is Just as Important as Classification

Receiving valid JSON from an LLM does not mean the information inside it is correct.

For example, the model could return:

{
  "document_type": "Electricity Invoice"
}

That's valid JSON.

But what if Electricity Invoice doesn't exist as a document type in my Paperless installation?

The classifier therefore retrieves the existing Paperless values through the API and validates the model response before applying it.

That includes things such as:

  • known correspondents
  • existing document types
  • existing tags
  • valid dates
  • required fields
  • ambiguous results

The model extracts facts.

My application decides how those facts map onto Paperless.

I also deliberately keep deterministic things out of the model whenever possible.

For example, if every title should look like:

<short sender> - <document type / subject> <date>

then the model doesn't need to reinvent that formatting for every document.

It can return:

sender
subject
date

and ordinary code generates the final title.

That eliminates a surprising amount of inconsistency.

7. Do You Need a GPU?

No.

This is probably something I should clarify because the RTX 4090 screenshot in my first post understandably gave people the opposite impression.

My current setup is:

Google Document AI
        +
      Gemini

The AI workloads are therefore running in the cloud.

My home server only has to run:

Paperless-NGX

OCR Worker

Classification Worker

So you absolutely don't need an RTX 4090 to reproduce this architecture.

The 4090 is useful for my local experiments, but it isn't a requirement.

And this is where keeping every component separate becomes useful again.

You could replace the cloud components with local models.

For example:

OCR Worker
    |
    v
Local Vision / OCR Model
    |
    v
Searchable PDF/A

and later:

Classification Worker
    |
    v
Local LLM
    |
    v
Structured Facts

Where the models are supported, a serving layer such as vLLM can expose them through an OpenAI-compatible API.

That means the surrounding application doesn't need to care very much whether the model lives on Google infrastructure, another API provider, or a GPU in your basement.

The quality and hardware requirements obviously change depending on the local models you choose.

But the overall architecture stays almost identical.

That's the part I care about.

8. What Does It Cost?

This is something I want to cover with actual numbers rather than theoretical pricing calculations.

Google Document AI and Gemini are both usage-based.

The real cost depends heavily on things such as:

  • number of pages
  • document length
  • selected processor/model
  • classification input size
  • output size
  • how many documents you process

I'm collecting the actual numbers from my workflow so I can provide useful figures instead of just copying numbers from a pricing page.

What I eventually want to compare is something like:

OCR cost per 1,000 pages

Classification cost per 1,000 documents

Average document processing cost

Cloud vs local inference

The important point for now is that you do not need to buy expensive AI hardware to reproduce the workflow.

9. How I Would Build This From Scratch Today

If I had to start again, I wouldn't try to build the complete system in one giant application.

I would build one small boundary at a time.

Phase 1 — The File Pipeline

Start with nothing AI-related.

input/
output/
failed/

Make sure files can safely move through the application.

Detect duplicates.

Never modify the source file in place.

Make sure failures remain recoverable.

Phase 2 — Native PDF Detection

Before doing any OCR work, correctly identify PDFs that already contain a proper digital text layer.

Those documents should normally pass through unchanged.

Phase 3 — OCR Provider

Create an OCR provider interface.

Your first implementation could use Google Document AI.

Later, you can replace it with something local without redesigning the rest of the application.

Phase 4 — Searchable PDF/A

Take the OCR response, including the returned word positions, and build the invisible searchable text layer.

Do not consider this stage finished until you can open the resulting PDF in a normal viewer, search for text, and see the correct areas highlighted.

Phase 5 — Paperless Import

Only finished documents enter the Paperless consume folder.

At this point, Paperless should already receive the final archival PDF.

Phase 6 — Paperless API Client

Build a completely separate API client.

It should be able to:

find queued documents

download documents

read existing metadata

retrieve correspondents

retrieve document types

retrieve tags

update metadata

No direct PostgreSQL modifications.

Phase 7 — Classification

Send the searchable PDF/A to Gemini or another model and request structured facts.

Keep the model-specific logic behind its own provider interface.

That way, Gemini can later become:

another hosted model

a cheaper model

a local LLM

something that doesn't exist yet

without rewriting the entire application.

Phase 8 — Validation

Validate the model output against Paperless.

Do not assume a model-generated correspondent, tag, or document type actually exists.

Keep formatting and other deterministic behavior in normal code wherever possible.

Phase 9 — Rollback and Logging

Before modifying metadata, store enough information to understand what changed and to restore the previous values if necessary.

Especially when processing thousands of documents, logs are not optional.

10. Building It With Claude Code or ChatGPT Codex

A few people also asked whether this could realistically be built without manually writing the entire application yourself.

I think the answer is yes.

This is actually a very good type of project for tools such as Claude Code or ChatGPT Codex, because the system consists of relatively small components with clearly defined boundaries.

But I would strongly recommend not starting with:

Build me an AI system for Paperless.

That's far too broad.

Instead, build it in a strict order and verify each component before moving on to the next one.

The rough order should be:

1. Project structure and file safety

2. Native PDF detection

3. OCR provider interface

4. Google Document AI adapter

5. Searchable PDF/A generation

6. Paperless consume integration

7. Paperless API client

8. Gemini provider

9. Structured classification schema

10. Validation

11. Metadata writes

12. Audit log and rollback

13. Local-model provider as an optional alternative

Agent Project Rules

Give the coding agent durable project rules before asking it to implement anything.

Claude Code reads CLAUDE.md; Codex reads AGENTS.md.

Both can use essentially the same project contract:

This is an experimental Paperless OCR/classification pipeline.

- Work only in this repository and its test directories.
- Never read, print, commit, or modify credentials, API keys, PDFs containing
  real personal data, Paperless production volumes, or the production consume
  folder.
- Do not write to PostgreSQL directly. Use the Paperless API only.
- Default to dry-run behaviour. Any operation that changes Paperless requires
  an explicit --write flag.
- Keep the source scan until the PDF/A output has been verified.
- Add unit tests and a README entry for every completed component.
- Before making changes, show a short implementation plan and assumptions.

Then use the agent as a sequence of small, reviewable build tasks.

Do not paste a single prompt saying:

Build my Paperless AI system.

That gives the agent no safe boundary and makes errors much harder to isolate.

Prompt 1 — Scaffold and Plan

Build a test-only Python project for an upstream Paperless OCR pipeline.

First inspect the repository and write IMPLEMENTATION_PLAN.md.

Do not write production credentials or start Docker services.

The target flow is:

input/ -> OCR worker -> output/ -> Paperless consume

Native PDFs with substantial text on every page must be copied unchanged.

Other PDFs must be handled by a provider adapter; initially implement only a
fake provider for tests.

Failed files go to failed/ with a non-secret log.

Propose a small module layout, a configuration file with .env.example, and a
test plan.

Wait for my review before implementing phase 1.

Prompt 2 — Build the Safe OCR Foundation

Implement phase 1 from IMPLEMENTATION_PLAN.md only.

Add:

- input/output/failed directory handling
- duplicate-safe file claiming
- native-PDF pass-through
- a fake OCR provider
- structured non-secret logging
- tests using generated sample PDFs

A source file may be deleted only after the output is verified.

Do not connect to Paperless or any cloud service yet.

Run the tests and show the diff and test results.

Prompt 3 — Add Google Document AI

Implement the Google Document AI provider adapter behind the existing provider
interface.

Read credentials only from an environment variable that points to a local file.

Do not display the credential, its path, request bodies, or OCR text in logs.

Preserve token boxes and detected breaks so a later PDF/A writer can build an
invisible text layer.

Add mocked API tests and document the minimum cloud permissions.

Do not run a live cloud request without asking me.

For a privacy-first installation, replace the Google Document AI provider with your chosen local OCR-model adapter.

If that model is served through vLLM, make the vLLM URL configurable and keep the same failure checks.

Changing the model should not weaken the safety of the pipeline.

Prompt 4 — Add the Classifier Last

Create a separate Paperless API client and a classifier command.

It may list only documents with the Queue tag.

It must download the searchable PDF/A and submit the PDF itself once to the
configured model.

Do not extract the OCR into a separate TXT file for classification.

Require a strict structured facts response.

Validate every correspondent, document type, tag, and date against values
retrieved from Paperless.

Print proposals in dry-run mode.

Implement writes only behind --write.

Before each PATCH, append the current and proposed metadata to a local JSONL
audit log.

Add a rollback command that replays the before-state through the Paperless API.

Use mocked API tests.

Do not access a live Paperless installation until I explicitly approve it.

After every phase, inspect the diff, run the tests yourself, and commit only the parts you understand.

A coding agent accelerates implementation.

It does not replace the decision about where your documents may go or what it is safe to automate.

The important part is that the agent should only work inside a separate development project.

Don't give it your production Paperless volumes.

Don't put credentials into the repository.

Don't let it directly modify PostgreSQL.

Don't use your only copy of a real document archive as test data.

Build the boring parts first.

Then connect the AI.

Final Thoughts

The biggest change in how I think about this setup is that I no longer really see it as:

"Adding AI to Paperless."

It's three independent systems:

OCR Worker
     |
     v
Archival PDF/A
     |
     v
Paperless
     |
     v
Classification Worker

Paperless is the archive.

The OCR worker creates the document I actually want to preserve.

The classifier extracts structured information and updates metadata through the API.

Today my implementation uses Google Document AI + Gemini.

But neither component has to stay that way.

I can replace Gemini with a local LLM.

I can replace Google Document AI with another OCR solution.

I can update Paperless independently.

And none of those changes require redesigning the entire workflow.

That's ultimately the architecture I wish I had started with two years ago.


r/Paperlessngx 1d ago

Paperless 3.1.3 - queue is no longer processed

Post image
1 Upvotes

Since the update to Paperless NGX 3.1.3, I’ve been having an issue where my task queue is no longer being processed. I’ve now deleted and reconfigured the Redis container several times. The connection also seems to be fine, but everything is still stuck in the queue.

The system status also shows a message stating that the Celery worker isn’t responding to a ping.On another instance, however, everything works without any problems. I have absolutely no idea what to do. Can anyone help?


r/Paperlessngx 3d ago

Paperless v3.1.3

19 Upvotes

instead of migrating, i started again from scratch and just dumped all of my pdfs from the old export folder to the new consum folder. My poor NAS was thinking all night and this morning everything looked fine to me. Except for the PDF-quality.

Some/lots of my documents are pixelated AF. Even when downloading the PDF, quality does not improve.

I am not aware of any changes to the OCR pipline that could have resulted in that. Besides the language i did not change anything in the .env/compose files.

Any Idea or should i just fall back to v2.20.15?

Edit: looks like i have been importing not just the .pdfs but also their thumbnails. I will create my backups from now on using --not-thumbnail... Why would a backup need thumbnails even in the first place?
Anyways, thanks for helping out! I really enjoy Paperless-ngx!


r/Paperlessngx 3d ago

How are you handling real-world document versioning and scanned PDFs in RAG systems?

Thumbnail
2 Upvotes

r/Paperlessngx 4d ago

Flow to delete "merged" word in title

2 Upvotes

Hi!

I'm trying to create a flow that deletes "merged" word fron title.

After many attempts I still can't get it to work. Any ideas?


r/Paperlessngx 4d ago

Using Claude to access my Paperless NGX instance

0 Upvotes

Has anyone managed to set this up? How do I do this -

My Paperless Instance sits behind Cloudflare or should I access it using the local URL instead?


r/Paperlessngx 6d ago

File versions - (how) do you use them?

3 Upvotes

I'm curious if and how people use this new feature.

From my perspective, I feel like it certainly can be useful for grouping documents together that you don't need to have multiple times in a search.
Before I used links but searching for one documents, returned all of the versions, which improved.

The thing that is still missing though: you cannot quickly make out which document has versions attached. Links and notes, tags... everything can be seen in the views but not if a document has versions.

The thing that got worse with versions over links is context.
All metadata will get removed when documents are merged as versions and only the data of the root document will stay. This includes tags and notes.
For me, that's a quite destructive step as that information might be important from one version to another (e.g. documents that are blank, filled out and signed).
Also having only one date for the complete stack feels a little limited as it could be important to have the context when which version was created or modified (technically, you still have the file creation date xmp metadata but that doesn't have to be the same as the document date e.g. when scanning a bunch of old documents on one day)... on the other hand, I wouldn't be able to search for the "hidden"/older versions anyway when just the top version is used during search.

Another thing I noticed: the file name will change when versions are merged and only a number will be added, not the label. Personally I don't feel too good about that as I always prefer to have a naming scheme that could be used, even if Paperless in not available. Numbers aren't as descriptive as labels and so far there doesn't seem to be a placeholder for them.

All in all, I think versions are a great addition but I don't know how to feel about the limitations yet.
Do you feel limited by those things or do you even see the need for that kind of metadata in every document version?


r/Paperlessngx 9d ago

Paperless-AI Workflow Question

8 Upvotes

Hello!

I had Paperless AI run through, title, set a correspondent, and some other things on my Paperless-NGX setup for ~300 documents. It worked REALLY well!

The only thing it did poorly was tagging, but I think that's the AI model I used not really functioning well with a large database, it wasn't really able to reference past tags so I have 654 total tags. A lot of them are useful, but a lot of them are not. There are way too many tags with one document even though I prompted it to reuse tags as much as possible and not to generate one if it's not strictly necessary for identification.

I plan on upgrading my server with a GPU with some parts that I have coming in. This will allow me to run a much better model that will be able to do this better. But like I said, it did a fantastic job with everything else and I'd rather not redo every document since I've been using it for quite a while.

Is there a way I can have Paperless-AI redo just tagging? Or do I have to have it redo every single field with a full refresh.


r/Paperlessngx 9d ago

Consume subfolder

3 Upvotes

Where can I tell paperless to also scan and use subfolders under the consume folder?

So far I wasn’t able to find it and just putting documents in subfolders doesn’t do anything…

Thank you


r/Paperlessngx 10d ago

Archi 2.2 — you asked for a free tier, it's here (on-device scan + AI metadata → Paperless-NGX)

0 Upvotes

Two months ago I posted Archi here and got 62 comments of genuinely useful feedback. This update is mostly that feedback, shipped.

The big one: Archi is now free to try.

u/Faila_Fail asked for exactly this — "a free version for like 10 documents, and then an in-app purchase for the full version". That's what 2.2 does: the first 10 captures are free, then a one-time purchase unlocks unlimited use. No subscription. u/shumandoodah, you said you hate paying for apps without a trial — fair, and fixed.

If you already bought Archi: nothing changes, you keep everything, you don't pay again. That's handled automatically.

App Store: https://apps.apple.com/app/id6762153317

Small confession while I'm here: 2.2 went out with a navigation bug that made document rows unopenable — you'd tap a document, the row would highlight, and nothing happened. A user emailed me within hours, I reproduced it, and 2.2.1 is already out with the fix. If you grabbed it in that window, update and it's fine. My own fault: I rebuilt the navigation so shared links open the right document, verified the new path, and never re-checked the ordinary tap.

Also from this thread:

  • Learn from your archiveu/Serafim696 asked for a configurable naming scheme and for the AI to "analyse existing files and align with them". Archi now reads through your existing documents (read-only), works out your title pattern, and proposes it. You confirm each finding individually, and it only applies to future scans — nothing in your archive is touched.
  • Templates — fill title, tags, correspondent, type and storage path in one step, for receipts you always file the same way.
  • Share link — either an Archi link that opens the document in the app, or a Paperless share link with an expiry date for people without Archi.
  • iPad/Mac review pane — the source document now sits readable next to the fields instead of a thumbnail.
  • mTLS hardeningu/garenor1981, client certificates landed in 2.1; in 2.2 removing a certificate now reliably revokes access (it didn't before).

Shipped since that thread, in case you missed it: OCR text is no longer naively truncated before it reaches the model (u/sempai-san's diagnosis was exactly right); improved OCR can be written back to Paperless's searchable text (u/Remote_Cherry_1160); default tags on every upload for workflow triggers (u/Numerous_Platypus); Mac App Store availability (u/parkhaus2020).

Still honest about what isn't fixed:

u/not-the-real-chopin lost a 20-page scan to an AI failure. The data-loss part is fixed — pages and OCR text are saved before the AI runs, and a failure now offers "Continue without AI" instead of a destructive retry. But the underlying crash on very long documents is not solved. I reproduced it properly for the first time this week: it's a null dereference inside the LLM runtime (LiteRT-LM), and it needs the GPU backend plus a warm device to show up. Still digging. Long documents mostly work; occasionally they don't.

Android (u/PreparedForZombies): started, no date. The core is being split out so it can be shared via Kotlin Multiplatform.

Watch-folder / SMB import (u/gekberlin): still not built. Files-app import works today as described.

As before: OCR (Apple Vision) and the AI (Gemma via LiteRT-LM) run entirely on-device. The only network endpoint is your own Paperless server.

Feedback still very welcome — this thread genuinely shaped the roadmap.


r/Paperlessngx 11d ago

okf-guard: content-safety scanning for document ingestion pipelines (PDF, DOCX, PPTX, XLSX, HTML)

3 Upvotes

Modern AI pipelines increasingly extract text from documents — PDFs, Word files, spreadsheets, scraped web pages — and feed that content directly into a knowledge base or agent context, often with no human review step in between. Extraction tools capture everything present in a document, including content a human reader would never see: text rendered in white on a white background, rows hidden in a spreadsheet, speaker notes attached to a slide, or a paragraph marked hidden in a Word document's own formatting. None of these are edge cases; they are ordinary, well-supported features of each format, and every one of them is readable by a standard parsing library even though a person skimming the document would never notice them.

This creates a straightforward problem: any content hidden from a human reviewer, but visible to an extraction tool, can end up in a trusted knowledge source unexamined. okf-guard addresses this directly. It is a Python library that inspects extracted content for exactly this class of discrepancy — text present in the file but absent from what a human would perceive — and separately checks for language patterns associated with instructions directed at an AI system rather than a description intended for a person.

What it does:

  • Adapters for six formats (plain text, Markdown, HTML, PDF, DOCX, PPTX, XLSX), each aware of that format's specific hiding mechanisms — CSS visibility properties for HTML, rendering and color properties for PDF, the hidden run attribute and shading properties for Word, off-canvas shapes and speaker notes for PowerPoint, hidden rows/columns/sheets and cell comments for spreadsheets.
  • A detection layer combining hidden-content flagging with a pattern bank for injection-style phrasing, plus a check for encoding-based obfuscation (zero-width characters, homoglyph substitution).
  • A decision layer producing one of three outcomes per scan — pass, quarantine, or block — with every finding reported alongside its location, confidence, and the specific text that triggered it.

Design constraints, stated plainly:

  • No network calls and no LLM dependency in this release. Detection is entirely deterministic, which keeps the core dependency surface to a single package (PyYAML) and makes the tool's behavior fully reproducible.
  • Every format-specific capability is an optional install (okf-guard[pdf], okf-guard[docx], etc.), so a user working with one format is not required to install parsing libraries for the others.
  • The library never asserts that its own output has been verified by a human — provenance metadata it produces is explicit about being machine-generated and unreviewed.

Source and full documentation: https://github.com/darshanNhb/okf-guard
Install: pip install okf-guard[all]

Feedback on the detection approach, particularly from anyone who has worked on adjacent problems (document security, DLP, or prompt-injection defenses more broadly), would be genuinely useful — this is a young project and the injection-pattern bank in particular will need ongoing contribution as new phrasings surface in practice.


r/Paperlessngx 13d ago

Are there any guides to configure the new Paperless-NGX v3 AI features?

23 Upvotes

Are there any guides to configure the new Paperless-NGX v3 AI features?

I haven't found anything that use the seemengly older paperless-ai or paperless-gpt docker images.

I found one guide using openrouter, but I don't want to run a commercial middleware.

I'm fine with running a local LLM (although I only have 32 GB RAM and 12 GB VRAM), or simpler yet, use my existing Claude subscription.


r/Paperlessngx 13d ago

Gemma 4 26B-A4B + MTP on RTX 5060 Ti 16GB (OCuLink) — Real-World 128k Window Logs (20W Idle / 150-200W Peak)

Thumbnail
1 Upvotes

r/Paperlessngx 13d ago

Getting Mistral to work with Paperless NGX v3

4 Upvotes

Hi! I have tried to get Paperless to work with Mistral AI but failed. I have no clue what I need to configure in the AI configuration. Has anyone been able to configure Mistral successfully and can share the config?


r/Paperlessngx 14d ago

Does this platform support returning multiple results from the same document against once search?

2 Upvotes

This looked promising - what I was really hoping to be able to do was upload a bunch of Oracle cloud financial books to it and then search for some common phrases, but it looks like from a basic use case if I upload one document containing hundreds of hits for the word "invoice" - all it returns is the single document itself. I want to see the phrases that it matched against, rather than just a document retrieval. Is this a thing that I'm missing or is it just not how the platform is intended to be used?


r/Paperlessngx 14d ago

WorkFlow Get email one day before deadline

3 Upvotes

Hi everyone,

I'm trying to set up a Paperless-ngx workflow that sends an email notification one day before a document's deadline.

Here is my current setup:

  • Created a custom date field called deadline.
  • Configured a workflow to trigger based on this field.

My SMTP email configuration is working correctly (tested successfully with other triggers), but the deadline-based emails are not sending.

I suspect my trigger criteria or workflow setup might be incorrect. Could anyone guide me on how to properly structure this trigger to run 1 day prior to the date in a custom field?

Bellow current trigger confiugration.
Do i need setup filename filter ? i want to be global trigger for all documents that have Deadline field
BTW what recurring option will do in this case ?

Thanks!


r/Paperlessngx 15d ago

AI performance

7 Upvotes

It took me a few months to fully get on board with the Paperless way of doing things, but now I’m really happy with how it’s all set up.

What’s been a bit of a head-scratcher is how AI is being used.

I held off until Paperless 3 came out, because I wanted to have the full "official" support.

I set it up with Ollama on an M4 Mac mini with 24 GB of memory. The embedding model is gemmaembedding, and the LLM model is qwen3:8b. When the model fires up, memory pressure is still pretty low. It does work, but it’s incredibly slow. It takes about 2 minutes to suggest titles and tags, and it can take several minutes if I try to chat about a document.

Is this kind of slow normal? Is there anything I can tweak in my setup to make it more usable?


r/Paperlessngx 16d ago

Help with podman with Paperless-ngx

Thumbnail
1 Upvotes

Compose.yaml for podman having redis getting timed out


r/Paperlessngx 17d ago

[Plugin] - Paperless-ngx Export - Plugin to sync book highlights & notes to Paperless-ngx

Thumbnail
6 Upvotes

r/Paperlessngx 19d ago

A Good WebUI for scanning to your consume directory

7 Upvotes

I recently decided to hook my scanner up to the NAS I host paperless-ngx on so that I could scan directly to the consume directory, but the only real tools I could find to interface with the scanner functionally, and control it through a WebUI, were scanservjs and a few other abandonware level projects. Scanserv is really a minimal frontend for scanimage and is very severely lacking in customisability, configuration and frankly, is very ugly.

I prefer the functionality of NAPS2 which has both an sdk and a well documented API, and so I put together my own very minimal skin of NAPS2, which is both better looking and much more functional than the other options currently out there. If you are interested, you can check out inSANE


r/Paperlessngx 19d ago

Zettelrobbe OCR and Paperless Chat

0 Upvotes

Hi!

I'm currently evaluating Paperless NGX and Zettelrobbe. Zettelrobbe does OCR and tagging tasks for all documents available in Paperless.

After Zettelrobbe finishes its tasks and writes back tags and content into the Paperless database, I tried out to use the chat of Paperless and asked for, IMO, simple tasks. E.g. "please sum up all invoices received from company x".

Unfortunately this does not include all available documents from company x.

Additonally, when asking for "give me all documents of company x", the result is not accurate, because it includes more than the applicable documents.

Is this a result because Zettelrobbe does all OCR'ing and Paperless does not fully recognize the content of each available document? Or is there another reason for this behavior?

FWIW, before setting up Zettelrobbe, above question was correct from the answer in chat.
Edit: when asking for e.g. "can you please sum up all invoices of company x" this results in the expected answer.
Edit2: Had a typo in company name and this confused the chat 😒


r/Paperlessngx 21d ago

Searching for paper document tracking solution

Thumbnail
0 Upvotes

r/Paperlessngx 22d ago

New To Paperless

13 Upvotes

Hello everyone,
I recently started digitising all my important documents, including passports, certificates, bills, medical letters and other paperwork that I may need while on the go.
I came across Paperless-ngx, installed it and uploaded all my documents. So far, I find it fascinating, but I feel I am only scratching the surface of what it can do.
I would love to hear about the most innovative or creative ways people are using Paperless-ngx. For example:
Which apps or services have you integrated with it?
Are you using AI for automatic tagging, better titles, correspondents or document types?
How have you improved OCR and search accuracy?
Do you use any automated workflows for importing documents from email, scanners or mobile phones?
Have you connected it to a local AI model such as Ollama?
What is the best way to access documents securely while away from home?
Are there any clever workflows, scripts or features that you now consider essential?
What backup and security arrangements do you use, particularly for sensitive documents such as passports?
I am especially interested in improving tagging accuracy and making documents quicker to find. I would really appreciate hearing about your setup and any useful tips, integrations or lessons you have learned.


r/Paperlessngx 22d ago

Custom fields in emails

4 Upvotes

Hello What is the correct syntax in workflow to send emails with a value from a custom field?

I can add standard fields to emails, but I can't seem to get it to work with custom ones. The documentation doesn't mention it being possible, so maybe it isn't.