INNOCENTRA — Where Evidence Speaks, Truth Emerges.

Inspiration

Most wrongful convictions don't come from evidence that was missing. They come from a detail that was in the case file all along, but nobody connected.

A witness's timeline that doesn't match the 911 log. A dashcam recording mentioned in a police report but missing from the disclosure log. A vehicle seen by only one witness.

The people reviewing these cases—defence lawyers, public defenders, and innocence projects—face thousands of pages and very little time. The evidence is also highly sensitive, making cloud-based AI analysis a potential privacy concern.

We wanted to build a tool that gives every piece of evidence a second look, keeps case text on the reviewer's own device by default, and never allows an AI-generated claim to go unchecked.

What It Does

INNOCENTRA is a privacy-first, human-supervised case review workspace that runs in Chrome.

1. Instant Evidence Checks — No AI Required

As soon as files are added (.txt or .pdf), built-in deterministic rules identify:

  • Time conflicts between witness statements and records.
  • Documents or recordings cited but never disclosed.
  • Leads supported by only a single source.

2. Story & Timeline Reconstruction

INNOCENTRA rebuilds the case as a unified timeline. When two accounts of the same moment disagree, they remain side by side as a versus card (e.g., ~21:40 vs ~22:10), rather than being silently merged.

3. Evidence & People

  • Highlight exact quotations from source documents.
  • Explore a who-said-what matrix to identify differences between witnesses.
  • Compare any two statements side by side.

4. Evidence Network

Explore an interactive connection map of people, places, evidence, and events. Every connection links back to the document supporting it.

5. Fairness Review

Tests the original investigation theory against four evidence groups:

  • Overlooked evidence.
  • Contradictions.
  • Alternative explanations.
  • Unresolved questions.

The Open Original feature jumps directly to the highlighted words in the source document.

6. Ask the Case

Ask questions in plain English and receive streamed AI-generated answers. Every quotation in an answer is checked against the passage it cites.

7. Hybrid AI with Privacy Consent

  • Gemini Nano runs on the device first.
  • Gemini in the cloud is used only when necessary.
  • Before any cloud request, reviewers see and approve the exact passages through the Privacy Gate.

8. Human-Controlled Decisions

Every finding is presented as a question for human review. Reviewers can:

  • Confirm a finding.
  • Reject it with a reason.
  • Mark it for further review.

Decisions and findings can be exported as HTML, Markdown, or PDF reports.

How We Built It

Technology Stack

  • Frontend: React 19, TypeScript, Vite, Tailwind CSS, Framer Motion, React Flow.
  • Document Processing: PDF.js.
  • Local Storage: IndexedDB with Dexie.
  • Cloud Storage: Firestore for case metadata and reviewer decisions.
  • AI: Firebase AI Logic with Gemini Nano and Gemini cloud inference.

Firebase AI Logic Integration

INNOCENTRA uses Firebase AI Logic for hybrid AI inference.

  • getAI with GoogleAIBackend.
  • getGenerativeModel with InferenceMode for each task:
    • ONLY_ON_DEVICE
    • PREFER_ON_DEVICE
    • PREFER_IN_CLOUD
  • The same JSON schema is used across both inference lanes: responseConstraint for Gemini Nano and responseJsonSchema for Gemini.
  • generateContentStream powers Ask the Case.
  • response.inferenceSource records where each inference actually ran.

Intelligent Task Router

The task router selects the appropriate inference lane based on the reviewer's AI mode:

  • Local Only: On-device inference only.
  • Ask Before Cloud: Requires reviewer approval before cloud inference.
  • Auto Hybrid: Automatically selects the appropriate inference lane according to configured rules.

It also:

  • Opens the Privacy Gate before cloud requests.
  • Queues tasks when offline.
  • Records every AI call in a route ledger, including task, lane, reason, latency, and passages sent.

AI Output Verification

Trustworthiness is built into the system:

  • Every model response is validated using Zod.
  • Invalid responses are retried once.
  • Every generated quotation is checked against its original passage.
  • Unmatched quotations are marked UNVERIFIED and cannot be confirmed.

Firebase Infrastructure

  • Firebase App Check with reCAPTCHA Enterprise.
  • Firebase Authentication.
  • Cloud Firestore.
  • Firebase Remote Config for cloud model selection and the threshold for transferring tasks from Gemini Nano to cloud inference.

Testing

  • 50 Vitest unit and golden tests.
  • Playwright end-to-end tests covering existing-case and new-case workflows.

Challenges We Ran Into

1. Making Both AI Lanes Behave Consistently

Gemini Nano and Gemini handle structured-output settings differently. We developed a schema-driven model factory and standardized response validation across both lanes.

2. App Check During Development

Cloud requests initially failed with an "App attestation failed" error because the registered debug token did not match the token sent by the application. We resolved this using a fixed debug token exclusively for development builds.

3. Improving Ask the Case

Early responses frequently returned "not in the provided materials" because retrieval missed relevant passages. We improved retrieval by prioritizing references to dates and times, covering every document, and expanding the context supplied to the model.

4. Reliable Citation Extraction

Models sometimes cite multiple sources within one bracket and mix curly and straight quotation marks. We improved the citation checker to handle these variations reliably.

5. Gemini Nano Availability

On-device inference depends on Chrome version, hardware compatibility, and a substantial model download. We added an in-app Test AI Now check and clear messages explaining when on-device AI is unavailable.

Accomplishments That We're Proud Of

  • Real Hybrid AI: Every result displays the actual inference route used by the SDK—on-device or cloud.
  • Privacy by Design: Case text stays on the device unless the reviewer explicitly approves the exact passages for cloud processing.
  • Nothing Without a Source: Every finding links back to the original evidence, and fabricated quotations are automatically flagged.
  • Useful Before AI Runs: Built-in rules identify a 30-minute time conflict, an undisclosed camera recording, and a single-witness lead within seconds of uploading the demo case.
  • Human-Centered AI: Findings are presented as questions for human verification. Verdict and credibility language is filtered out of AI-generated output.

What We Learned

  • On-device AI creates new possibilities for privacy-sensitive domains by enabling summaries and short questions without sending case text to the cloud.
  • Letting AI extract facts while deterministic code compares them produces more trustworthy results than asking a model to judge evidence.
  • Showing users where each AI call ran builds greater trust.
  • In legal investigations, the citation matters just as much as the answer.

What's Next for INNOCENTRA

  • OCR support for scanned PDFs.
  • Transcription support for audio and video evidence.
  • Multi-day timelines.
  • Support for additional document types, including forensic and phone records.
  • Collaborative reviews with complete audit trails.
  • Pilot programs with innocence projects and public defenders using anonymized case files.
  • Support for additional languages.

Built With

  • chrome-prompt-api
  • cloud-firestore
  • dexie
  • firebase
  • firebase-ai-logic
  • firebase-app-check
  • firebase-authentication
  • firebase-hosting
  • firebase-remote-config
  • framer-motion
  • gemini
  • gemini-nano
  • google-cloud
  • indexeddb
  • pdf.js
  • react
  • react-flow
  • recaptcha-enterprise
  • tailwindcss
  • typescript
  • vite
  • vitest
  • zod
  • zustand
Share this project:

Updates

Submission history