An AI forensic composite & biometric intelligence suite — built for HackFest 2026
Chitragupta is an AI-assisted forensic facial composite suite designed for investigators. It turns a witness's description, typed or spoken in Hindi, Kannada, Tamil, Telugu or Hinglish, into candidate facial sketches, lets the investigator refine them region by region, compares them against a suspect registry, and records every step in a tamper-evident audit trail.
The project was built by Team TheHourned Ones (T1-32) for HackFest 2026. Traditional composite work depends on a trained sketch artist and on witnesses who can describe a face in a common language. Chitragupta lowers both barriers: witnesses can speak in their own language or point at reference images, and every edit is non-destructive, so earlier versions can always be compared or restored.
The investigator workstation is a React 18 + Vite single-page app. It talks over HTTPS and REST to a serverless backend written in TypeScript with Hono and running on Cloudflare Workers. A middleware layer handles authentication, JWT and role checks, and rate limiting before a request reaches the case, AI, image and audit services.
Structured data such as cases, access grants, the suspect registry, image lineage and audit metadata lives in Cloudflare D1 through a binding. Sketches, inpainting masks and revision assets live in a private Cloudflare R2 bucket and are only ever served through authenticated endpoints. Image generation goes to Cloudflare Workers AI (Flux.1 / SDXL), and speech-to-text and translation go through a server-side Gemini proxy, so API keys never reach the browser.
1. Witness input. The witness describes the face in text or speech, or picks traits from the visual feature catalogue. Gemini translates regional-language and Hinglish input into a structured English forensic description.
2. Feature extraction. The studio pulls out face shape, jawline, eyes, nose, facial hair and distinguishing marks from the description.
3. Candidate generation. Four candidate sketches are generated per round. The investigator selects one as the active composite.
4. Refinement. The investigator masks a region such as the eyes, nose or jawline and inpaints only that area, while the rest of the image is preserved pixel for pixel. Each edit creates a new revision in the version tree.
5. Verification and audit. The composite is compared against the suspect registry, and every action (case created, generation requested, image selected, revision created, export generated) is sealed in the audit ledger.
You'll need Node.js 20+ and the Cloudflare Wrangler CLI. Clone the repository and install both the backend and frontend dependencies:
Add your own keys in .dev.vars (see .dev.vars.example), then run the tests and start both servers in separate terminals:
Challenge: Editing one part of a generated face without disturbing the rest, since AI inpainting tends to alter the whole image.
Solution: Built a pure TypeScript region-mask compositor that blends the edited region back onto the original, so every unselected pixel stays identical.
Challenge: Witnesses describe faces in many languages, including romanized Hinglish, and speech models are not equally reliable.
Solution: Added a server-side Gemini translation proxy with a cascading model fallback, ending in a client-side forensic dictionary, so translation keeps working even when a model is unavailable and keys stay off the browser.
Challenge: Forensic work needs a history that can't be quietly rewritten.
Solution: Made the audit trail append-only with SHA-256 digests, rejected update and delete operations with 405 Method Not Allowed, and kept image revisions as a non-destructive tree.
Chitragupta delivers an end-to-end composite workflow in one application: multilingual witness input, candidate generation, surgical refinement, registry comparison and a tamper-evident audit log. The backend is covered by 19 automated tests across 6 suites, spanning case management, candidate limits, mask editing, version restore, rate limiting and audit immutability, and the API is documented in an OpenAPI 3.1 specification. As a hackathon project it was a hands-on exercise in serverless architecture, AI integration, access control and forensic-grade record keeping.
The project's package.json declares the ISC license. See the GitHub repository for details.
Built by Team TheHourned Ones for HackFest 2026: Ankush Kumar, S Vaishnavi and Adeep AG
Found a bug or have a question? Open an issue on GitHub, or reach out through the contact page.