Inspiration
The inspiration for ChainDetective came from the need to modernize **how police and investigators **handle interrogation footage. Reviewing hours of video manually is slow and resource-heavy, often delaying critical actions. ChainDetective automates this process by turning recordings into a searchable knowledge base using LangChain, vector search, and TiDB Serverless. It also integrates with the FBI Most Wanted API to flag suspects and can alert the nearest police stations in real time, making evidence retrieval and response faster and smarter.
What it does
ChainDetective allows police to upload interrogation videos, which are automatically transcribed into text. The transcripts are chunked into manageable pieces, embedded, and stored in TiDB Serverless with vector search enabled. Investigators can then query past interrogations to find relevant patterns, similar questions, or recurring narratives. The system also integrates with the FBI API to cross-check suspects against most wanted criminals. If a match is found, ChainDetective automatically identifies the nearest police stations and sends out alerts, making it a complete end-to-end investigative assistant powered by AI and TiDB.
How we built it
To build ChainDetective, I focused on these main components:
Transcription – The interrogation videos are uploaded to Amazon S3 and transcribed to text using Amazon Transcribe.
Text Splitting – Since transcripts can be very long, I used LangChain’s Recursive Text Splitter to break them into smaller, meaningful chunks.
Embeddings – The chunks are converted into embeddings using SentenceTransformer, which capture semantic meaning.
Vector Search – The embeddings are stored in TiDB Serverless, where vector search enables fast retrieval of relevant transcript segments.
LLM Analysis – The top results from vector search are passed to Gemini, which analyzes the content, summarizes interrogation insights, and assists with answering investigator queries.
Challenges we ran into
I faced challenges such as rate-limit and data consistency issues while integrating the FBI API, as well as difficulties in setting up geolocation alerts to notify the nearest police stations
Accomplishments that we're proud of
a) Automating Evidence Processing: ChainDetective eliminates the need for officers to manually review hours of interrogation footage by transforming videos into searchable transcripts. This automation frees investigators to focus on solving cases instead of spending time on repetitive tasks.
b) Enabling Real-Time Intelligence: By integrating the FBI Most Wanted API and geolocation alerts, ChainDetective provides instant suspect verification and notifies nearby police stations. This capability speeds up critical responses and enhances public safety.
c) Powering Smarter Investigations: With TiDB vector search and Gemini analysis, investigators can uncover patterns, compare past cases, and extract insights from suspect statements that might otherwise be overlooked. This makes case analysis more efficient, accurate, and impactful
What we learned
I learned power of Langchain and LLMs. How we can query a large large documents using splitting and generating embedding. Also, I learned mathematics of vector search and how it works in TiDB.
What's next for ChainDetective
1) Extending to CCTV and Crime Scene Footage: I plan to expand beyond interrogation videos to support CCTV and crime scene recordings. Using computer vision, footage can be broken into one-second frames, converted into descriptive text, and compiled into structured reports. These can then be processed with the same transcription, embedding, and vector search pipeline to provide deeper investigative insights.
2) Multilingual Support: To make ChainDetective accessible to law enforcement agencies worldwide, we aim to add multilingual transcription and analysis. This will allow officers to work with cases in different languages seamlessly, broadening the platform’s usability for global investigations.
Built With
- flask
- langchain
- tidb

Log in or sign up for Devpost to join the conversation.