Kavach AI is an intelligent crime analytics platform developed for the Karnataka State Police Datathon 2026. The platform transforms raw FIR records into actionable intelligence through interactive visualisations, predictive analytics, criminal network exploration, hotspot identification, and an AI-powered investigation assistant.
Rather than functioning as a traditional record management system, Kavach AI focuses on assisting investigators and decision-makers by extracting operational insights from historical FIR data. The application processes structured CSV datasets to generate district-level intelligence, identify crime trends, detect repeat offenders, forecast crime patterns, and support evidence-driven policing.
Live Deployed Prototype: https://kavach-snowy.vercel.app
- Overview
- Objectives
- Key Features
- System Architecture
- Technology Stack
- Project Structure
- Core Modules
- Dataset Processing
- REST API
- Installation
- Running the Project
- Deployment
- Security
- Future Scope
- Contributors
- License
Law enforcement agencies collect vast amounts of FIR data every day. While these datasets contain valuable investigative information, extracting meaningful intelligence from them is often difficult and time-consuming.
Kavach AI addresses this challenge by providing a unified analytical platform capable of:
- analysing crime distribution
- identifying crime hotspots
- detecting repeat offenders
- discovering criminal associations
- forecasting crime trends
- assisting investigators through natural-language queries
- generating district-wise operational intelligence
The platform is designed around real Karnataka FIR datasets and performs all analytics dynamically without requiring a traditional relational database.
The primary objectives of Kavach AI are:
- Transform raw FIR datasets into operational intelligence.
- Provide investigators with interactive analytical dashboards.
- Identify emerging crime patterns across districts.
- Detect criminal relationships and repeat offenders.
- Enable predictive crime analysis using historical trends.
- Assist police personnel through an AI-powered investigation assistant.
- Deliver a modern, scalable and responsive investigative platform.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Provides an executive overview of crime statistics including:
- Total registered cases
- Active investigations
- Heinous offences
- Highest crime volume district
- Crime category distribution
- Severity distribution
- Monthly crime trends
An investigation assistant capable of answering dataset-grounded queries.
Examples include:
- District with the highest crime rate
- Leading crime categories
- Repeat offender analysis
- FIR search assistance
- Investigation recommendations
- Dataset summarisation
Interactive GIS visualisation showing:
- Crime concentration
- District hotspots
- Spatial crime distribution
- High-risk locations
Built using Leaflet.
Analyses historical crime behaviour through:
- Monthly trends
- Category comparison
- Severity comparison
- Resolution statistics
Visualises relationships between offenders and linked criminal activity using an interactive graph built with Cytoscape.js.
Automatically identifies:
- Individuals appearing in multiple FIRs
- High-frequency offenders
- District-level offender statistics
Forecasts future crime activity based on historical FIR patterns.
Outputs include:
- High-risk districts
- Expected crime volume
- Forecasted growth
- Operational risk indicators
Provides comprehensive district-wise intelligence including:
- Registered FIRs
- Resolved cases
- Pending investigations
- Heinous offences
- Crime comparison
Fast searching across FIR records by:
- Case number
- District
- Accused
- Keywords
Generate analytical reports in multiple formats including:
- CSV
- JSON
Interactive dataset explorer displaying:
- Dataset information
- Column metadata
- Record counts
- Schema summary
flowchart TB
User[Police Officer / Analyst]
subgraph Frontend["Frontend Layer - Vercel"]
UI[React + Vite Application]
Router[React Router]
Visuals[Recharts, Leaflet, Cytoscape]
Auth[Authentication and Protected Routes]
ClientState[Settings, Alerts and Audit State]
APIClient[Centralised API Service]
end
subgraph Backend["Application Layer - Render"]
Express[Express.js REST API]
Middleware[CORS, JSON Parsing and Request Handling]
subgraph Services["Analytics Services"]
DashboardService[Dashboard Analytics]
TrendService[Crime Trend Analysis]
HotspotService[Hotspot Intelligence]
NetworkService[Criminal Network Analysis]
OffenderService[Repeat Offender Detection]
PredictiveService[Predictive Intelligence]
DistrictService[District Analytics]
SearchService[FIR Search]
ReportService[Report Generation]
AssistantService[AI Crime Assistant]
end
end
subgraph Data["Data Layer"]
CSVEngine[CSV Processing and Aggregation Engine]
FIRData[(Karnataka FIR Dataset<br/>29 CSV Files)]
end
subgraph External["Deployment and Source Control"]
GitHub[GitHub Repository]
Vercel[Vercel Deployment]
Render[Render Deployment]
end
User --> UI
UI --> Router
UI --> Visuals
UI --> Auth
UI --> ClientState
UI --> APIClient
APIClient -->|HTTPS REST Requests| Express
Express --> Middleware
Middleware --> DashboardService
Middleware --> TrendService
Middleware --> HotspotService
Middleware --> NetworkService
Middleware --> OffenderService
Middleware --> PredictiveService
Middleware --> DistrictService
Middleware --> SearchService
Middleware --> ReportService
Middleware --> AssistantService
DashboardService --> CSVEngine
TrendService --> CSVEngine
HotspotService --> CSVEngine
NetworkService --> CSVEngine
OffenderService --> CSVEngine
PredictiveService --> CSVEngine
DistrictService --> CSVEngine
SearchService --> CSVEngine
ReportService --> CSVEngine
AssistantService --> CSVEngine
CSVEngine --> FIRData
GitHub -->|Automatic Deployment| Vercel
GitHub -->|Automatic Deployment| Render
Vercel --> Frontend
Render --> Backend
flowchart TD
A["Crime Incident / User Request"]
-->
B["Extract FIR Records<br/>Karnataka Crime Dataset"]
-->
C["Data Processing & Feature Extraction"]
-->
D["Crime Intelligence Engine"]
D --> E["Crime Hotspot Detection"]
D --> F["Crime Trend Analysis"]
D --> G["Repeat Offender Detection"]
E --> H["Generate Intelligence Report"]
F --> H
G --> H
H --> I["Interactive Dashboard & Maps"]
- React
- Vite
- React Router
- Tailwind CSS
- Axios
- Recharts
- React Leaflet
- Cytoscape.js
- Node.js
- Express.js
- CSV Parser
- File System API
- CORS
- Karnataka FIR Dataset
- 29 CSV files
kavach/
├── backend/ Express.js backend and analytics API
│ ├── data/ Karnataka FIR CSV datasets
│ ├── node_modules/ Backend dependencies
│ ├── .env.example Backend environment variable template
│ ├── package.json Backend dependencies and scripts
│ ├── package-lock.json Backend dependency lock file
│ └── server.js REST API, CSV processing and analytics engine
│
├── functions/ Catalyst function configuration
│
├── public/ Static frontend assets
│
├── src/ React application source
│ ├── components/ Reusable user interface components
│ │ ├── DashboardTour.jsx Interactive dashboard walkthrough
│ │ ├── MetricCard.jsx Dashboard KPI card component
│ │ ├── ProtectedRoute.jsx Authentication-based route protection
│ │ ├── Sidebar.jsx Main navigation sidebar
│ │ └── Topbar.jsx Search, settings and profile navigation
│ │
│ ├── context/ Global React context providers
│ │ └── AuthContext.jsx Authentication state and session handling
│ │
│ ├── hooks/ Reusable React hooks
│ │ └── useApi.js API request, loading and error-state management
│ │
│ ├── layouts/ Shared application layouts
│ │ └── DashboardLayout.jsx Main authenticated dashboard layout
│ │
│ ├── pages/ Application screens
│ │ ├── AIAssistant.jsx Dataset-grounded crime investigation assistant
│ │ ├── Alerts.jsx Operational and high-severity alerts
│ │ ├── AuditLogs.jsx Local application activity history
│ │ ├── CaseSearch.jsx FIR, accused and district search
│ │ ├── CrimeTrends.jsx Historical crime trend visualisation
│ │ ├── CriminalNetwork.jsx Criminal relationship network graph
│ │ ├── Dashboard.jsx Crime intelligence overview
│ │ ├── DistrictAnalysis.jsx District-wise case and resolution analytics
│ │ ├── HotspotMap.jsx Geospatial crime hotspot visualisation
│ │ ├── Login.jsx User authentication page
│ │ ├── Predictions.jsx Predictive crime intelligence
│ │ ├── Profile.jsx User profile information
│ │ ├── RepeatOffenders.jsx Repeat offender identification
│ │ ├── Reports.jsx Dataset report generation and export
│ │ ├── Resources.jsx Dataset schema and file explorer
│ │ └── Settings.jsx Application preferences and configuration
│ │
│ ├── routes/ Route definitions and access configuration
│ │
│ ├── services/ Frontend service layer
│ │ └── api.js Centralised backend API client
│ │
│ ├── styles/ Shared style definitions
│ │
│ ├── utils/ Utility functions and local storage helpers
│ │ ├── auditLogger.js Client-side audit activity logger
│ │ └── settings.js Application settings persistence
│ │
│ ├── App.jsx Main route and application configuration
│ ├── index.css Global styling
│ └── main.jsx React application entry point
│
├── .catalystrc Catalyst project association
├── .env.example Frontend environment variable template
├── .gitignore Git exclusion rules
├── app-config.json AppSail configuration
├── catalyst.json Catalyst deployment configuration
├── cli-config.json Catalyst CLI configuration
├── index.html Vite HTML entry point
├── package.json Frontend dependencies and scripts
├── package-lock.json Frontend dependency lock file
├── README.md Project documentation
├── vercel.json Vercel SPA routing configuration
└── vite.config.js Vite build and development configuration
Unlike traditional applications that rely on SQL databases, Kavach AI processes structured CSV datasets directly.
The backend dynamically:
- Reads FIR datasets
- Cleans records
- Aggregates statistics
- Calculates district summaries
- Detects hotspots
- Builds criminal relationship graphs
- Computes predictive metrics
- Generates dashboard analytics
No manual preprocessing is required.
| Endpoint | Description |
|---|---|
/api/dashboard |
Dashboard metrics |
/api/crime-trends |
Crime trend analytics |
/api/hotspots |
Hotspot analysis |
/api/network |
Criminal network graph |
/api/repeat-offenders |
Repeat offender analysis |
/api/predictive |
Predictive intelligence |
/api/districts |
District listing |
/api/district-analytics/:id |
District insights |
/api/search |
FIR search |
/api/reports |
Report generation |
/api/resources |
Dataset explorer |
/api/alerts |
Alerts |
/api/assistant |
AI assistant |
Clone the repository
git clone https://github.com/barsha20061001/kavach
cd kavachInstall frontend dependencies
npm installInstall backend dependencies
cd backend
npm installStart the backend
cd backend
npm startBackend URL
http://localhost:5000
Start the frontend
npm run devFrontend URL
http://localhost:5173
Frontend
VITE_API_BASE_URL=http://localhost:5000
Production
VITE_API_BASE_URL=https://kavach-ai-api.onrender.com
- Render
- Vercel
The frontend communicates with the backend through the VITE_API_BASE_URL environment variable.
The platform includes:
- Protected application routes
- Configurable CORS policy
- Environment-based configuration
- Secure API communication
- Client-side authentication
- Modular backend architecture
The backend performs in-memory aggregation over CSV datasets and exposes lightweight REST endpoints for the frontend. Expensive computations are performed once per request, allowing the client to remain responsive while rendering interactive visualisations.
Potential future improvements include:
- Machine learning-based crime forecasting
- Real-time FIR ingestion
- Role-based access control
- Advanced GIS heatmap clustering
- Natural language FIR summarisation
- Voice-enabled investigation assistant
- Mobile application
- PDF report generation
- Real-time notifications
- Database support for large-scale deployments
Developed as part of the Karnataka State Police Datathon 2026.
~ Barsha
This project has been developed for educational, research and hackathon purposes. The Karnataka FIR dataset belongs to its respective owners and is used solely for analytical demonstration within the scope of the competition.













