Detect changes between versions
Highlight added, removed, and modified passages without reading two documents line by line.
DocuLens AI is a bilingual, local-first document intelligence application that compares PDF versions, answers questions using retrieved source evidence, and produces executive-ready comparison reports.

Contracts and policies evolve over time. Reviewing different versions manually can be slow, especially when the changes are small but important.
Highlight added, removed, and modified passages without reading two documents line by line.
Retrieve relevant excerpts from both documents before asking a local language model to generate an answer.
Turn detected changes into a structured overview and export a PDF that a reviewer can inspect.
Make the documents the source of truth. AI helps explain findings, while reviewers retain access to the original passages and must verify important conclusions.
A focused workflow organized around the reviewer’s task rather than around a general-purpose chatbot.
Upload two text-based versions or select a synthetic demo.
PyMuPDF keeps page references alongside extracted passages.
Heuristic alignment surfaces additions, deletions, and edits.
Inspect source text and ask questions through local RAG.
Generate a structured comparison report as a PDF.

Two complementary paths power the product: deterministic text comparison and evidence-aware question answering using local language models.
PDF extraction preserves page-level context so questions and reported changes can be checked against the source material.
PyMuPDF / PythonDocument passages are represented as embeddings, then ranked to assemble relevant context for the user’s question.
Ollama / nomic-embed-text / NumPyA locally running LLM uses retrieved passages to draft answers. The source excerpts remain visible for independent review.
Ollama / llama3.2:3bActual screenshots of the English interface, from the product overview to question answering and executive reporting.




The product includes parallel English and Spanish demos and supports automatic document-language detection or a manual language setting.
Managed Services Agreement — 2025 vs 2026
“How did monthly availability, critical response time, and SLA service credits change?”
ENGLISH UI · ENGLISH ANSWERS · PDF HEADINGSAcuerdo de Servicios Gestionados — 2025 vs 2026
«¿Qué derechos de auditoría y obligaciones sobre subencargados aparecen en 2026?»
INTERFAZ EN ESPAÑOL · RESPUESTAS · INFORMESUI labels and report headings follow the chosen language; generated text follows language instructions on a best-effort basis.
Automated checks cover the application’s core and bilingual functionality, while important document interpretations still require human review.
Includes comparison logic, bilingual features, demo content and report behavior. Tests alone do not establish live LLM answer accuracy.
PDFs must contain selectable text. Heuristic alignment can miss or duplicate changes, and local LLMs can omit, distort, or misinterpret findings.
This is a portfolio prototype, not a certified legal-review or compliance system.
The central challenge was not just calling an LLM, but shaping retrieval, evidence, comparison and reporting into one usable workflow.
A useful RAG product depends on trustworthy context and interface decisions as much as the language model itself. Making a response explainable requires attention to retrieval, source presentation and failure handling.
Early testing showed that a report could identify a contractual change while question answering missed it. Improving how source passages were selected and grouped mattered more than making the prompt sound impressive.
The UI evolved from an AI-centered demo into a reviewer-oriented workspace with comparison, evidence and reporting arranged around practical tasks.
Supporting English and Spanish required more than translating buttons: language selection also had to influence the model instructions, summary generation and exported reports.
Automated tests can verify deterministic behavior, but generated answers remain probabilistic. Source-grounded checks and transparent limitations are necessary when showing this work publicly.
DocuLens helped connect document engineering, retrieval-augmented generation, local inference and executive communication in a single application, while keeping the human reviewer responsible for important decisions.
The public repository includes installation steps, a technical overview, automated tests and four fictional PDFs for reproducing the workflow.
Python + Streamlit + Ollama, document comparison, localized reports and example agreements.
View source code ↗This prototype requires local setup rather than offering a hosted public demo. Follow the repository README to install the dependencies and models.
Installation guide ↗