
Deduct AI
An AI assistant for law enforcement that retrieves case evidence and suggests applicable legal sections from a crime scenario.
Field officers need fast, defensible suggestions for which legal sections apply to a scenario, plus a way to surface relevant evidence, without waiting on a slow manual legal search.
A retrieval-augmented assistant that indexes legal text in a vector store and pairs it with a computer-vision pipeline for evidence detection, exposed through a lightweight field-team app.
Built the query-retrieval system over the legal-text vector store, trained the YOLO-based evidence detector on hand-labelled data, and deployed the inference endpoints.
Retrieval-augmented generation over a legal-text vector store, with an LLaMA-13B model producing section suggestions grounded in retrieved passages.
Grounding a generative model in a retrieval layer made its suggestions far more reliable than prompting alone, and cheap enough to run on a modest AWS box.
Deduct AI was built for the Vimarsh 5G Hackathon, a national initiative run by the Department of Telecommunications and IIT Madras, focused on applying emerging tech to public-sector problems.
- Had to run on modest, low-cost cloud infrastructure (AWS T2-micro) rather than GPU-backed inference servers.
- Needed a field-usable client, not just a research notebook.
- Legal suggestions needed to be traceable back to source text, not free-floating generative claims.
Split the problem in two: a retrieval-augmented language pipeline for legal-section suggestions grounded in an indexed corpus, and a separate computer-vision pipeline for evidence detection, unified behind one FastAPI service and a Flutter client.
The Flutter app collects a short scenario description and optional evidence photos, then submits both to the API and renders section suggestions and detected objects in a simple field-friendly layout.
FastAPI receives the request, forwards text to the LangChain retrieval pipeline and images to the YOLO endpoint, then merges both results into a single response.
The scenario text is embedded and matched against a Chroma-indexed corpus of legal text. The top passages are passed as context to LLaMA-13B, which produces a suggestion grounded in that retrieved text rather than relying on parametric memory alone. Evidence photos are handled separately by a YOLO model trained on hand-labelled data with LabelImg.
- Chose retrieval-augmented generation over fine-tuning so the legal corpus could be updated without retraining the model.
- Kept vision and language pipelines independent so either could be swapped without touching the other.
- Used FastAPI for the gateway to get async I/O and simple request validation with minimal ceremony.
- Keeping inference latency reasonable on a T2-micro instance meant being deliberate about model size and batching.
- Hand-labelling enough evidence photos for a usable detector was the slowest part of the project.
- A 13B parameter model is smaller and cheaper to host than larger alternatives, at some cost to suggestion nuance, which is a fair trade since the retrieval grounding does most of the heavy lifting anyway.
- Optimized for a working field prototype over a fully productionized, horizontally-scaled service.
The prototype placed 3rd at the Vimarsh 5G national finals, judged by the Department of Telecommunications and IIT Madras.
- Grounding generation in retrieval is a much bigger reliability lever than prompt tweaking alone.
- Separating concerns between the vision and language pipelines made the system far easier to debug under deadline pressure.
- Add an evaluation harness to measure suggestion quality against a labelled set of scenarios.
- Explore swapping the fixed retrieval step for a lightweight agent that can decide when to search versus answer directly.
Flutter Field App
FastAPI Gateway
FastAPI Gateway
LangChain Retrieval Layer
LangChain Retrieval Layer
Chroma Vector Store
Chroma Vector Store
LLaMA-13B
LLaMA-13B
FastAPI Gateway
FastAPI Gateway
YOLO Evidence Detector
YOLO Evidence Detector
FastAPI Gateway
FastAPI Gateway
AWS Deployment
Flutter Field App: Companion app used by the field team to submit a scenario and photos.
FastAPI Gateway: Single entry point that routes requests to the retrieval and vision pipelines.
LangChain Retrieval Layer: Embeds the query and retrieves relevant passages from the legal-text store.
Chroma Vector Store: Indexed embeddings of statutory text used for grounded retrieval.
LLaMA-13B: Generates section suggestions grounded in retrieved passages.
YOLO Evidence Detector: Object-detection model trained on hand-labelled evidence photos.
AWS Deployment: Hosts inference endpoints for both pipelines.

