How samsraina/bob-ai-hackathon-cyber-elevate works
Bob Engine is a FIR intelligence application: users explore FIRs and related suspects, review cross-district offender patterns and explanations, and inspect crime geography and alerts. The sampled REST routes delegate scoped queries to a shared intelligence service backed by PostgreSQL; the web app presents dashboard, FIR, offender, graph, map, and alert views. The README documents entity resolution, MO-similarity clustering, and automatic pattern alerts, but their internal wiring is not established by the sampled engine source, so those links are left out.
Main entry points: intelligence.py Intelligence service · database.py Database sessions · main.py FastAPI application · routes_firs.py FIR routes
Components 20
Web application
- Application shell
src/web/src/App.tsx - API client
src/web/src/api/client.ts - Intelligence views
src/web/src/routes
REST API
- FastAPI application
src/app/main.py - FIR routes
src/app/api/routes_firs.py - Intelligence routes
src/app/api/routes_rest.py - Alert routes
src/app/api/routes_alerts.py
Intelligence services
- Intelligence service
src/app/services/intelligence.py
Analysis engine
- Entity resolution
src/app/engine/entity_resolution.py - MO similarity
src/app/engine/mo_similarity.py - Pattern alerts
src/app/engine/pattern_alerts.py - Graph builder
src/app/engine/graph_builder.py - Geo aggregation
src/app/engine/geo_aggregation.py - Reasoning gloss
src/app/engine/llm_client.py
Data and access
- Scope and RBAC
src/app/core/rbac.py - Database sessions
src/app/core/database.py - FIR and cluster models
src/app/models/fir_models.py
Other components
- Analyst
- LLM service
- PostgreSQL
Connections 22
- Analyst → Application shell: uses
- Application shell → Intelligence views: routes to
- Intelligence views → API client: requests data
- API client → FastAPI application: fetches
- FastAPI application → FIR routes: dispatches
- FastAPI application → Intelligence routes: dispatches
- FastAPI application → Alert routes: dispatches
- FIR routes → Intelligence service: calls
- Intelligence routes → Intelligence service: calls
- Alert routes → Intelligence service: calls
- FIR routes → Scope and RBAC: resolves scope
- Intelligence routes → Scope and RBAC: resolves scope
- Alert routes → Scope and RBAC: resolves scope
- FIR routes → Database sessions: gets session
- Intelligence routes → Database sessions: gets session
- Alert routes → Database sessions: gets session
- Intelligence service → Database sessions: queries
- Database sessions → PostgreSQL: reads and writes
- Database sessions → FIR and cluster models: registers models
- Intelligence service → Graph builder: builds graph
- Intelligence service → Geo aggregation: computes map data
- Reasoning gloss → LLM service: requests explanation