Inspiration
Criminal cases don't fail at the crime scene — they fail at the case file. A photo re-saved, a record back-dated, a statement quietly rewritten, and a court throws the case out on custody doubts alone. And the contradiction that decides a case — the witness says the man left at 21:15, the camera says 20:47 — sits across two folders nobody reads together until cross-examination. We wanted evidence that proves its own integrity, and an AI that reads the whole file but never gets the last word.
What it does
Chain of Truth seals every evidence item with a SHA-256 hash the moment it lands and chains it to the previous one; physical exhibits need a second officer and field ranks must add a live camera capture. It then reads the file: the AI extracts every dated event, person, place and vehicle and lays them on one timeline, quoting the excerpt it read. It questions the file: sources are compared against each other and contradictions surface with a severity, a confidence and both excerpts side by side; post-mortem findings are pinned on an anatomical figure and cross-checked against statements and cameras; a draft chargesheet is checked claim by claim; statement versions are diffed word by word; every other case is scored for the same signature — has this happened before? Finally an officer of the right rank decides: every AI output is a hypothesis until confirmed, and the decision, the rank and the time go to the audit trail. Sixteen working modules, a ten-stage demo case, three related cases for pattern search, and a hash ledger with a live tamper drill.
How we built it
FastAPI + SQLAlchemy 2 on PostgreSQL 16 with pgvector, MinIO for evidence files, Alembic migrations, a rank-and-role permission check on every route and an audit log on every action. React 18 + TypeScript + Vite on the front, with a real map (MapLibre / OpenStreetMap), a force-directed evidence graph and live WebSocket updates. The AI layer talks to Groq (openai/gpt-oss-120b), with Anthropic as a drop-in, through a provider-agnostic adapter: extraction, contradiction detection, procedural guidance (RAG over pgvector with the legal section cited), autopsy mapping and a grounded copilot. Everything that has to be certain is deliberately not AI: SHA-256, the previous-hash chain, HMAC-signed anchors kept outside the database, rule-based location scoring, Jaccard-based case similarity with the shared items listed, and closure readiness as printed arithmetic. Sixty automated checks — API smoke, rank-permission escalation attempts, evidence rules and a full browser suite — run against the live stack.
Challenges we ran into
Keeping the AI honest: a model happily invents a date, so a time is stored only when a source states it, and every claim carries its excerpt. Answering the obvious objection — "an admin can just edit the database" — took the anchoring design (a signed checkpoint that lives outside the DB) and a drill that lets a judge watch the chain catch an edit. Authority had to be two independent axes, rank and role, enforced on every route rather than hidden in the UI. And the interface had to feel like a tool a station would use, not a demo.
Accomplishments that we're proud of
The contradiction appears live, in front of the audience, the moment the receptionist's statement is logged. The tamper drill turns block two red and shows the anchor violated, then restores it. The pattern search finds an earlier case with the same knife, the same forced rear door and the same grey hatchback, and lists exactly why. Every page is populated by the real pipeline — nothing is pre-computed — and a Constable, an Inspector and a prosecutor each see a genuinely different system.
What we learned
Trust in an AI investigation tool comes from what it refuses to do — invent, overwrite, act above its rank — as much as from what it can do. Grounding, citation and human confirmation are not features on top of the product; they are the product.
What's next for Chain of Truth
Public timestamping of chain anchors (RFC 3161 / blockchain notary), automatic replay of offline field captures through the full pipeline, a verified legal knowledge base reviewed by counsel, multi-station deployment with per-station isolation, a redaction workflow for PII, a court-facing read-only portal, and speech-to-text intake for statements in Indian languages. Every item keeps the rule: AI assists, humans decide.
Built With
- alembic
- d3.js
- docker
- fastapi
- gpt-oss-120b
- groq
- jwt
- maplibre-gl
- minio
- motion
- openstreetmap
- pgvector
- postgresql
- python
- rag
- react
- sha-256
- sqlalchemy
- tailwindcss
- typescript
- vite
- voyage-ai
- websockets
Log in or sign up for Devpost to join the conversation.