cat ./projects/chicago-crime-analysis

Chicago crime analysis agent

Last updated ยท 1 min read

  • AI Agents
  • Cloud

What it is

An AI agent that answers questions like "what's been happening near this neighborhood this week?" using the City of Chicago's public crime data. It returns trends and safety guidance instead of a raw table. It was later extended to Dallas data as a multi-city agent.

How it works

  • A LangGraph agent running Claude plans the analysis and calls a tool that queries the Chicago Data Portal API by location, crime type and time range.
  • A Streamlit front end offers four modes: open-ended analysis, a safety advisory, direct tool queries, and an observability dashboard.
  • Safety-sensitive questions go through a human-in-the-loop review step before a recommendation is shown.

Observability

Every LLM call is traced in LangSmith. Custom evaluators check for hallucination and whether safety advice is appropriate, and the dashboard tracks response times, success rates, token usage and cost.

Stack

  • AI: Claude via the Anthropic API, LangChain, LangGraph, LangSmith
  • App: Python, Streamlit, Docker
  • AWS, as Terraform modules: VPC with private subnets, Application Load Balancer, ECS Fargate, ECR, Secrets Manager, CloudWatch

Status

Deployed to AWS by hand: I ran the deploy script, which applies the Terraform modules and then builds and pushes the container image to ECR for ECS Fargate. There is no CI/CD pipeline.

Source

github.com/digitalShokri/chicago-crime-analysis

All projects