>_ Jorge Uc / projects← All projects
~/projects/doculens-ai // APPLIED AI
✦ Portfolio projectRetrieval-Augmented Generation2026

Every change, in clear view.

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.

DocuLens AI Overview screen in English
PRODUCT PREVIEW / DOCULENS-001PDF · RAG · REPORTS
DOCUMENT MODES02English & Spanish
DEMO LIBRARY04synthetic PDFs · 2 pairs
TEST SUITE11automated checks passed
INFERENCELocalOllama models
01 / PROJECT CONTEXT

Finding the changes that matter

Contracts and policies evolve over time. Reviewing different versions manually can be slow, especially when the changes are small but important.

01COMPARISON

Detect changes between versions

Highlight added, removed, and modified passages without reading two documents line by line.

TEXT EXTRACTION / DIFF
02EVIDENCE

Ask questions with context

Retrieve relevant excerpts from both documents before asking a local language model to generate an answer.

RETRIEVAL / LOCAL LLMS
03REPORTING

Summarize for review

Turn detected changes into a structured overview and export a PDF that a reviewer can inspect.

EXECUTIVE SUMMARY / PDF
PRODUCT PRINCIPLE

Make the documents the source of truth. AI helps explain findings, while reviewers retain access to the original passages and must verify important conclusions.

02 / DOCUMENT WORKFLOW

From two PDFs to a usable comparison

A focused workflow organized around the reviewer’s task rather than around a general-purpose chatbot.

> doculens.compare()WORKFLOW OVERVIEW
01

Load PDFs

Upload two text-based versions or select a synthetic demo.

02

Extract text

PyMuPDF keeps page references alongside extracted passages.

03

Compare

Heuristic alignment surfaces additions, deletions, and edits.

04

Review evidence

Inspect source text and ask questions through local RAG.

05

Export

Generate a structured comparison report as a PDF.

Text-based PDFs only · No OCR in the current prototype · Human verification required
DocuLens side-by-side PDF comparison workspace
WORKSPACE / Visual comparison of document versions. Click to expand.
03 / SYSTEM DESIGN

Retrieval before generation

Two complementary paths power the product: deterministic text comparison and evidence-aware question answering using local language models.

> doculens.rag_pipelineCONCEPTUAL ARCHITECTURE
SOURCETwo PDF filesOlder + newer version
→
EXTRACTPyMuPDFPassages + page metadata
→
RETRIEVEOllama embeddingsFind relevant passages
→
GENERATELocal chat modelAnswer + source evidence
Parallel output: extracted passages → heuristic comparison → highlighted differences → ReportLab PDF.
01 PROCESSING

Text and page metadata

PDF extraction preserves page-level context so questions and reported changes can be checked against the source material.

PyMuPDF / Python
02 SEMANTIC SEARCH

Similarity-based retrieval

Document passages are represented as embeddings, then ranked to assemble relevant context for the user’s question.

Ollama / nomic-embed-text / NumPy
03 GENERATION

Evidence-grounded answers

A locally running LLM uses retrieved passages to draft answers. The source excerpts remain visible for independent review.

Ollama / llama3.2:3b
04 / PRODUCT WALKTHROUGH

A complete review experience

Actual screenshots of the English interface, from the product overview to question answering and executive reporting.

05 / MULTILINGUAL EXPERIENCE

One workflow, two languages

The product includes parallel English and Spanish demos and supports automatic document-language detection or a manual language setting.

EN / DEMO PAIR

English

Managed Services Agreement — 2025 vs 2026

“How did monthly availability, critical response time, and SLA service credits change?”

ENGLISH UI · ENGLISH ANSWERS · PDF HEADINGS
ES / DEMO PAIR

Español

Acuerdo de Servicios Gestionados — 2025 vs 2026

«¿Qué derechos de auditoría y obligaciones sobre subencargados aparecen en 2026?»

INTERFAZ EN ESPAÑOL · RESPUESTAS · INFORMES
LANGUAGE BEHAVIOR

Source excerpts retain their original wording.

UI labels and report headings follow the chosen language; generated text follows language instructions on a best-effort basis.

AUTO / EN / ES
06 / VALIDATION & SCOPE

Tested behavior, clear boundaries

Automated checks cover the application’s core and bilingual functionality, while important document interpretations still require human review.

> pytest -qDEVELOPMENT CHECKS
11 / 11automated tests passed

Includes comparison logic, bilingual features, demo content and report behavior. Tests alone do not establish live LLM answer accuracy.

HONEST LIMITATIONSEvidence is assistance, not a guarantee.

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.

07 / PROJECT REFLECTION

What I learned from building DocuLens

The central challenge was not just calling an LLM, but shaping retrieval, evidence, comparison and reporting into one usable workflow.

ENGINEERING TAKEAWAY / 2026

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.

01 / RETRIEVAL QUALITY

Relevant context is the foundation

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.

RAGEmbeddingsContext selection
02 / PRODUCT DESIGN

Documents should stay center stage

The UI evolved from an AI-centered demo into a reviewer-oriented workspace with comparison, evidence and reporting arranged around practical tasks.

UXStreamlitDocument workflows
03 / MULTILINGUAL SYSTEMS

Localization includes generated output

Supporting English and Spanish required more than translating buttons: language selection also had to influence the model instructions, summary generation and exported reports.

i18nPromptingPDF generation
04 / EVALUATION

Testing needs different layers

Automated tests can verify deterministic behavior, but generated answers remain probabilistic. Source-grounded checks and transparent limitations are necessary when showing this work publicly.

pytestHuman reviewReliability
THE BIGGER LESSON

Strong AI products are built around verifiable workflows.

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.

08 / CODE & REPRODUCIBILITY

Explore the source

The public repository includes installation steps, a technical overview, automated tests and four fictional PDFs for reproducing the workflow.

GITHUB / OPEN SOURCE REPOSITORY

DocuLens AI

Python + Streamlit + Ollama, document comparison, localized reports and example agreements.

View source code ↗
LOCAL DEMONSTRATION

Run with Ollama

This prototype requires local setup rather than offering a hosted public demo. Follow the repository README to install the dependencies and models.

Installation guide ↗
Expanded DocuLens screenshot