SourceLens — AI Document Comparison with Verifiable Evidence

SourceLens is an AI-powered research workspace that compares claims across two documents, connects findings to exact source passages, and allows users to review and correct AI interpretations.

Project Highlights

  • Verifiable evidence: Every accepted finding must contain quotations that match its declared source exactly.
  • Human review: Users can correct interpretations, annotate evidence, exclude findings, and export reviewed results.
  • Hackathon improvement: In a before-and-after test on the same sample documents, the proportion of findings accepted by evidence verification increased from 40% to 85.7%.

Built by a solo student developer using AI-assisted engineering tools.

1. Who is your project for, and why would they use it?

SourceLens is designed for students, independent researchers, and creators who need to compare information across documents.

Imagine preparing an application for an international competition. Its overview page and official rules may contain overlapping requirements, additional conditions, or differences in wording. Finding these differences manually requires switching between documents and repeatedly locating relevant passages.

For example, Apple's Swift Student Challenge eligibility guide and full terms contain differences in the use of "should" and "must." These distinctions are easy to miss during manual review.

Conventional text-diff tools identify textual changes, while general AI chatbots can summarize documents. I wanted a workspace that combines semantic comparison with direct access to the original evidence.

SourceLens classifies findings as Agreement, Potential Conflict, Context Difference, Single-Source Claim, or Needs Review.

Users can inspect the original passages, correct the AI's interpretation, record their own observations, and export their research.

2. What did your team build or improve during the hackathon?

My Contribution — Solo Developer

I designed SourceLens independently and was responsible for its product requirements, interaction design, architectural decisions, development priorities, and practical validation.

I used ChatGPT and Codex to assist with implementation, technical investigation, and debugging. I reviewed their proposed solutions, made the final engineering decisions, and evaluated the resulting application through real usage.

Before the Hackathon

SourceLens V0.9 was already a working application before the event.

Its existing capabilities included text and PDF import, AI comparison, a three-panel Evidence Explorer, exact-text highlighting, PDF page references, manual Finding Correction, local project storage, backups, and Markdown export.

During the Hackathon — V0.9.1

During the event, I focused on a reliability problem discovered through document comparison.

The model sometimes removed Markdown formatting characters, such as **, when copying source quotations. These changes caused findings to fail exact-text verification.

I investigated the problem with Codex and approved a targeted improvement to the comparison prompt. The updated instructions require the model to preserve source characters, including formatting and whitespace, and check quotations before responding.

The existing deterministic validator remained unchanged.

Same sample documents V0.9 V0.9.1
Accepted findings 4/10 6/7
Validation acceptance rate 40% 85.7%
Rejected findings 6 1

All 11 cited excerpts in the six accepted V0.9.1 findings matched their declared source texts. The model also identified differences in registration deadlines and team-size requirements.

These results come from one sample and two model runs. They measure evidence-validation acceptance, not overall AI accuracy.

Beyond this initial test, I evaluated V0.9.1 using real Devpost rules, Apple's Swift Student Challenge requirements, repeated comparisons, reformatted PDFs, and NIST AI Risk Management Framework materials. These cases helped me assess repeatability, PDF citation tracing, and failure handling.

The submitted demo shows the working application, human correction workflow, and the V0.9.1 reliability improvement.

View the V0.9.1 implementation commit

3. How did your team use AI?

AI in the Finished Application

SourceLens uses a configurable language model through an OpenAI-compatible Chat Completions API.

Model used for the demonstration: nvidia/nemotron-3.5-lightning-30b-a3b

The language model receives both documents and produces structured findings containing relationship classifications, explanations, and supporting quotations.

A language model is suitable for this task because documents can express equivalent or different requirements using substantially different wording. Simple string matching alone cannot reliably identify these semantic relationships.

The application separates semantic interpretation from deterministic verification:

  1. The model generates structured findings.
  2. Zod validates the output structure.
  3. Each quotation is checked against its declared source.
  4. Findings with invalid evidence are rejected.
  5. Users inspect and review accepted findings.

This design allows the model to interpret claims while requiring its supporting quotations to exist in the original documents.

The V0.9.1 comparison results demonstrate the contribution of the revised prompt without weakening the verification rules. Repeated real-world tests also revealed inconsistent coverage and occasional misinterpretations.

AI During Development

I used ChatGPT for requirements refinement, technical discussions, and implementation-plan reviews. Codex assisted with implementation, repository inspection, debugging, and build verification.

For the V0.9.1 improvement, I directed Codex to investigate rejected quotations before changing the implementation. I reviewed the identified formatting problem, approved a prompt-only correction, and evaluated the resulting comparison.

I deliberately retained strict evidence verification rather than allowing approximate quotations.

AI also assisted with the production of the demonstration video, including automated recording, editing, and English synthetic narration. The software behavior shown in the demo comes from the actual running application.

4. How can people access and use the project, and what results does it achieve?

Access and Technology

GitHub: https://github.com/sx933229xiao-droid/sourcelens-evidence

Demo video: https://youtu.be/yoBxUZH59jE

SourceLens is a locally runnable web application built with Next.js, React, TypeScript, Tailwind CSS, Zod, PDF.js, and IndexedDB.

Users need Node.js 22.13 or later within the Node.js 22 release line, npm, a modern browser, and access to an OpenAI-compatible AI provider.

To run the project:

  1. Clone the GitHub repository.
  2. Run npm ci.
  3. Copy .env.example to .env.local.
  4. Configure the provider endpoint, model, and API key.
  5. Run npm run dev.

Complete instructions are available in the repository README.

The application can run locally without a software subscription. External AI provider charges may apply. Internet access is required for remote AI comparisons. Source documents and research projects are stored locally, while comparison requests send source text to the configured provider.

Judges can review the end-to-end workflow directly in the submitted demo video without installing the application.

Main Workflow

Users import or paste two documents and run an AI comparison.

Evidence Explorer connects three areas: Findings, Finding Detail, and Source Inspector. Selecting a citation highlights the corresponding source passage. Imported text-based PDFs also support physical-page references.

Users can revise classifications and explanations, add research notes, mark findings as reviewed, and exclude findings.

The original AI interpretation is preserved. Reviewed findings can be exported as Markdown, and complete project backups can be restored as separate projects.

The three-panel design keeps the interpretation and supporting evidence visible within the same workspace, reducing the need to switch between documents.

Real-World Verification

Using V0.9.1, I tested SourceLens with publicly available documents across several scenarios.

Scenario Observed result
Devpost overview and official rules 9 of 11 generated findings passed evidence verification. Two accepted findings required clarification during manual review.
Apple eligibility and full terms 9 of 12 generated findings passed verification. One overstated the English-language requirement.
Repeated Apple comparison 16 of 17 generated findings passed verification. Coverage changed, and some previously detected single-source requirements were omitted.
Apple PDF comparison 11 findings passed verification. The application identified a meaningful difference between "should" and "must" and traced evidence to physical PDF pages.

The Apple PDF was created by reformatting published eligibility guidance into a two-page text-based test document. It was not an original Apple-issued PDF.

The submitted demonstration also shows how an incorrect AI interpretation of the English-language requirement can be manually corrected and exported.

These results show why citation validity and semantic accuracy must be evaluated separately.

Source materials:

5. What are the current limitations, and what happens when something goes wrong?

Known Limitations

SourceLens currently compares two documents at a time and retains one successful analysis per project.

AI may omit important requirements or misinterpret relationships. In the repeated Apple comparison, the model produced substantially different coverage from identical inputs.

Exact quotation matching confirms that cited text exists. It does not prove that the AI interpreted the text correctly.

Scanned PDFs require OCR before import. Complex layouts may affect extracted reading order, and provider context limits constrain document size.

Projects are stored locally and do not currently support cloud synchronization.

Failure Handling

During a separate test involving NIST AI Risk Management Framework materials, SourceLens displayed the following error:

No findings could be matched to the sources.

The comparison did not complete, but the imported source documents remained available.

The exact cause of this particular failure was not fully isolated. The test involved a reformatted PDF and a shorter publication abstract.

The application is designed to preserve previous successful analysis and review data when a new comparison fails or is cancelled. It also requests confirmation before changes that would discard existing review work.

What I Learned

Building SourceLens taught me that reliable AI-assisted research requires more than generating plausible conclusions.

The evidence must be accessible, limitations must be visible, and users need a practical way to correct the model.

As a solo student developer, I learned to turn these requirements into a working product, use AI-assisted engineering effectively, and improve reliability through practical testing.

SourceLens is the research tool I wanted to build: one where I can inspect the evidence and make my own decisions.

Built With

Share this project:

Updates

Submission history