Skip to content

hollandkevint/CensusChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

110 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CensusChat: Healthcare Demographics Made Simple

Natural language interface to US Census data for healthcare strategy teams

Transform 6-week $50K demographic consulting into 6-second $297/month queries

πŸ“Š Foundation Data β€’ πŸ“– Quick Start β€’ πŸ“§ Get Early Access


πŸŽ‰ v1 Shipped (February 3, 2026)

DuckDB 1.4 MCP HTTP Agent SDK Interactive UI

What's New in v1

  • DuckDB 1.4 β€” New async API, MERGE statements, encryption support, query profiler
  • MCP HTTP Transport β€” External client connections (Claude Desktop, Postman)
  • Interactive Data Tables β€” TanStack Table with sorting, filtering, pagination, drill-down
  • Chart Visualizations β€” Recharts bar/line charts with export controls
  • Claude Agent SDK β€” Zod schema validation, parallel region comparison, conversational context
  • Document Generation β€” Excel and PDF reports via MCP tools

Core Features

  • βœ… TRUE MCP IMPLEMENTATION: Production SQL validation layer with security policies
  • βœ… SQL Injection Protection: Table/column allowlists, row limits, dangerous pattern blocking
  • βœ… Interactive Results: Sortable tables, filterable data, drill-down navigation
  • βœ… Parallel Queries: "Compare Tampa Bay vs Phoenix" runs both simultaneously
  • βœ… Conversational Context: "Now filter to income > $75K" understands prior query
  • βœ… Audit Compliance: All queries logged for HIPAA/GDPR

Current Data:

  • County Level: 3,144 US counties with demographics
  • Block Group Level: 239,741 block groups with 84 variables

🎯 The Problem

Healthcare strategy teams wait 6+ weeks and pay $50K+ for demographic analysis that CensusChat delivers in seconds for $297/month.

"Compare Medicare eligible seniors in Tampa Bay vs Phoenix with income over $75K"
β†’ Parallel queries, interactive comparison table, instant Excel export

⚑ How It Works

1. Natural Language Input

Ask questions in plain English - no SQL knowledge required

2. AI-Powered Processing with Security

  • Claude Sonnet 4 translates natural language to SQL
  • MCP Validation Layer validates SQL against security policies
  • DuckDB 1.4 executes validated queries on Census data
  • Agent SDK handles parallel queries and conversational context

3. Interactive Output

  • Sortable, filterable data tables
  • Bar and line chart visualizations
  • Drill-down from county to block groups
  • Excel/PDF export with one click

πŸ₯ Built for Healthcare Professionals

Primary Users:

  • Business Analysts at health systems and Medicare Advantage plans
  • Strategy Teams planning market expansion and facility placement
  • Healthcare Researchers conducting population health studies

πŸ›  Technical Stack

const stack = {
  backend: "Node.js 20 + TypeScript + Express 5",
  frontend: "Next.js 15 + React 19 + Tailwind CSS 4",
  databases: "PostgreSQL 15 + Redis 7 + DuckDB 1.4.3",
  ai: "Claude Sonnet 4 + Agent SDK 0.2.30 + MCP SDK 1.25.3",
  interactive: "TanStack Table + Recharts + MCP Apps",
  deployment: "Docker + containerized testing"
};

Performance Metrics

  • Sub-2 Second Queries with MCP validation
  • Parallel Execution for comparison queries
  • 82%+ Test Coverage with comprehensive test suites
  • HIPAA-Ready Architecture with encryption and audit logging

🚦 Quick Start

Step 1: Get API Keys (Required)

See API_KEY_SETUP.md for detailed instructions.

  1. Anthropic API: Get key at console.anthropic.com
  2. Census API: Request key at api.census.gov/data/key_signup.html
  3. Add both keys to backend/.env

Step 2: Load Census Data (First Time Only)

cd backend
./scripts/setup-database.sh  # Takes 2-3 hours

Step 3: Start the Application

./demo-setup.sh

Open http://localhost:3000 and start querying.


πŸ“Š Features

Healthcare-Specific Queries

  • Medicare eligibility calculations (age 65+ demographics)
  • Senior care demographics for facility planning
  • Population health indicators and social determinants
  • Market analysis for health system expansion

Interactive Data Exploration

  • Click column headers to sort
  • Filter rows without re-querying
  • Drill down from county to block groups
  • Export selected columns to Excel/CSV

Comparison Queries

  • "Compare Tampa Bay vs Phoenix" runs in parallel
  • Side-by-side demographic breakdowns
  • Automatic chart generation for comparisons

Conversational Follow-up

  • "Show seniors in Tampa Bay"
  • "Now filter to income over $75K" (understands context)
  • "Export that to Excel"

Enterprise Security

  • HIPAA-ready architecture with encryption at rest
  • SQL injection protection with validation layer
  • Complete audit trail for compliance
  • No PHI storage - only aggregated demographic data

πŸ“š Documentation

Getting Started

Technical Guides

Deployment


πŸ“ˆ Market Impact

Problem We Solve:

  • $2.8B spent annually on demographic consulting
  • 6,090 hospitals needing demographic analysis
  • 30,000+ senior care facilities planning expansion

Our Solution:

  • 200x cost reduction: $50K β†’ $297/month
  • 300x speed improvement: 6 weeks β†’ seconds
  • Unlimited iterations with conversational follow-up

πŸš€ Get Involved

For Healthcare Teams

πŸ“§ Request Early Access

For Developers

  • Write quality TypeScript with 90%+ test coverage
  • Maintain sub-2s query response times
  • Follow HIPAA-ready security practices
  • Run npm run secret-scan before committing

⭐ Star this repository if CensusChat helps your healthcare data work

Transforming healthcare demographic analysis from weeks to seconds


πŸ‘€ About Kevin Holland

10+ years healthcare data experience β€’ Frustrated by $50K consulting delays

πŸ“– Read Kevin's Full Story | πŸ“§ Get Updates

About

Natural language interface for US Census data. Built with Claude AI, DuckDB, and MCP. Ask questions in plain English, get data back.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors