DEV Community

Byte Chap
Byte Chap

Posted on AI-assisted

Document AI needs a path back to the page: inside DocBento

A document assistant can produce a fluent answer and still leave you with the real work: finding the passage that supports it.

For a question such as “When does this agreement renew?”, a useful answer needs more than a date. You need to know which document version supplied it, which page contains it, and whether the system could actually read that page.

Disclosure: we build DocBento at SourceBento. It is a commercial, self-hosted Python document management application with editable source code. This article explains the design considerations behind its workflow, along with checks you can apply to other document systems.

Separate reading, finding, and answering

Think of the workflow as three stages:

  1. Read the document. Extract text while keeping a connection to its original page.
  2. Find relevant evidence. Retrieve the pages that match the question and that the user is allowed to access.
  3. Answer with references. Give the reader a route back to the evidence.

If the first stage loses a number in a scanned table, a stronger language model cannot reliably repair that loss. If retrieval selects last year's agreement, a well-written answer can still be wrong.

DocBento offers four OCR paths: PaddleOCR for local CPU processing, Tesseract, optional Docling for layout and tables, and a vision-model option. The point of having choices is to match the input: a clean digital page, a table-heavy scan, and a photograph of handwriting are different problems.

A practical evaluation set should include those difficult inputs, not just a pristine PDF. Compare extracted text against the image before judging the assistant.

Exact terms and natural-language questions both matter

An invoice number calls for an exact match. “Documents about renewing a supplier agreement” calls for a broader search.

DocBento combines keyword and semantic search with filters, snippets, and page numbers. Its optional assistant searches and reads documents, then returns answers with page citations. A citation is a verification aid, not proof that the interpretation is correct: open the cited page and check that it supports the specific claim.

DocBento document management interface

Permissions must also cover the answer

Hiding a restricted folder in the sidebar is insufficient if its contents can still appear in search or a generated summary. DocBento applies restricted-folder access to search and its AI features as well as the document interface.

When evaluating a deployment, repeat the same question with two accounts that have different access. Test previews, downloads, search snippets, and answers. Include a document that one account can open and the other cannot.

Keep document work useful without AI

Folders, previews, versions, OCR, reviews, reminders, and templates remain useful when an AI provider is unavailable or deliberately disabled. DocBento makes AI optional and supports an OpenAI-compatible endpoint when enabled. Hosting locally and choosing an external AI provider are separate decisions; review what your configured provider receives.

The package includes a Python API and background worker, a React client, Docker deployment, and PostgreSQL with pgvector or MariaDB configuration.

A small evaluation before a large migration

Try ten representative documents. Ask one exact-reference question, one question spanning several documents, and one whose answer is absent. Check extraction, citations, permissions, and the missing-answer behavior. This tells you more than a polished answer to an easy question.

You can explore the DocBento demo and inspect the source-code package on Codester. Use sample documents in the public demo.

Which input causes the most trouble in your document workflow: tables, handwriting, or finding the right version?

Prepared with AI assistance using the product's published documentation; published by SourceBento.

Top comments (2)

Collapse
 
devbotts profile image
DEV •

bro

Some comments may only be visible to logged-in visitors. Sign in to view all comments.