CrimeCopilot AI is a premium, high-performance, AI-driven crime analysis console built for the Karnataka State Police (KSP) Datathon 2026. It integrates relational database filters (SQLite), graph network traversals (Neo4j), TF-IDF semantic case matching, offender risk timelines, and bilingual voice recognition (English/Kannada) into a unified "Stadium Noir" command dashboard.
Modern police intelligence relies on fragmented silos (Excel, PDF files, isolated databases). When investigating crime syndicates, officers face:
- Hidden Connections: Difficulty identifying links between suspects, shared vehicles, and bank accounts.
- Information Overload: Scanning thousands of written FIR descriptions to find patterns (modus operandi).
- Language Barriers: Inability to easily query or record voice notes in native languages like Kannada.
- Explainability Deficit: Black-box AI systems that make claims without verifiable sources.
- Conversational AI Console (SSE Streaming): Natural language routing with real-time progress logs.
- Interactive Cytoscape.js Network Graph: Visualizes 2-hop criminal syndicates, communications, and financial channels.
- Geospatial Hotspot Leaflet Map: Renders regional crime hotspots on custom dark-theme GIS tiles.
- TF-IDF Semantic Similar Case Search: Matches crime descriptions using local Cosine Similarity vectors.
- Offender Risk Profiling: Renders suspect cards with gang banners, timelines, and SVG risk gauges.
- Bilingual Voice Input (Speech-to-Text): Browser SpeechRecognition supporting Kannada and English transcription and automated query translation.
- Official PDF Report Export: Custom
@media printrules styling printable case sheets with 1 click. - Grounded Explainability (Hallucination Guard): Verifies all AI response tokens against evidence trails.
- Frontend: Next.js 16 (App Router + TS), Tailwind CSS (Stadium Noir Theme), Cytoscape.js, React-Leaflet.
- Backend: FastAPI (Python 3.13), LangGraph (Agent State Orchestration), SQLAlchemy ORM.
- Database: SQLite (Relational), Neo4j AuraDB (Graph database + Cypher engine).
- LLM Engine: Gemini 1.5 Flash (via
google-generativeai).
Reduces time-to-insight for field investigators from hours to seconds. Promotes native language usage in administrative interfaces, and ensures 100% auditability through verifiable evidence trails.
-
Navigate to the project root:
cd crimecopilot-ai -
Create and activate a Python virtual environment:
python -m venv .venv # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Copy the environment template and add your API Keys:
copy .env.example .env
Edit
.envto supply:GEMINI_API_KEY(Get from Google AI Studio)NEO4J_URI,NEO4J_USER,NEO4J_PASSWORD(Optional: Neo4j Aura DB credentials)
-
Seed the relational and graph databases:
python generate_data.py python validate_data.py python load_sql.py # Optional Neo4j graph seed: python load_neo4j.py -
Start the FastAPI development server:
python -m uvicorn main:app --host 127.0.0.1 --port 8000
- Navigate to the frontend directory:
cd frontend - Install npm dependencies:
npm install
- Start the Next.js development server with Turbopack:
npm run dev
- Access the command console at:
http://localhost:3000
To deploy the solution to the Zoho Catalyst platform, follow these steps:
Catalyst AppSail hosts full-stack python apps.
- Install Catalyst CLI globally:
npm install -g zcatalyst-cli
- Login to your Zoho account:
catalyst login
- Initialize the AppSail service in the root directory:
catalyst init # Select 'AppSail' and associate it with your Catalyst project. - Configure
app-config.jsoninside the root folder to point tomain:appusing uvicorn:{ "build": { "command": "pip install -r requirements.txt" }, "run": { "command": "uvicorn main:app --host 0.0.0.0 --port $PORT" } } - Deploy to Catalyst AppSail:
catalyst deploy
- Navigate to
frontend/and configure Next.js for static export by editingnext.config.ts:const nextConfig = { output: 'export' }; export default nextConfig;
- Build the static distribution:
npm run build # This generates an 'out/' directory. - Initialize Catalyst Slate hosting inside the
frontend/folder:catalyst init # Select 'Hosting' or 'Slate', point the public source directory to 'out'. - Deploy the frontend:
catalyst deploy --only hosting