A production-ready natural language question-answering system for NYC Department of Transportation analysts. Routes analyst questions to pre-built Metric answers (Tier 1) with optional Claude-powered synthesis (Tier 2).
git clone <repo-url>
cd nyc_data
./scripts/setup.shsocrata-nlquery "How many violations were fixed by borough?"socrata-nlquery "Why are violations spiking?" --expand- Tier 1 (Instant): Pre-built answers via hybrid ensemble router (BM25 + Claude embeddings)
- Tier 2 (Expansion): Claude synthesis + NLP-suggested follow-up questions
- Feedback Loop: Record helpful/wrong markings for continuous improvement
- Observability: DuckDB-based tracking of routing decisions and accuracy
- CLI: Full-featured command-line interface with JSON output
- Training: Built-in accuracy evaluation and weight optimization
Question → [Hybrid Router] → Tier 1 Answer
↓
Optional: Claude Expansion → Tier 2 Synthesis
↓
Feedback Collection
↓
Weight Optimization
# Basic query (Tier 1 only)
socrata-nlquery "violations fixed by borough"
# With Claude expansion (Tier 2)
socrata-nlquery "Why violations spiking?" --expand
# Mark feedback
socrata-nlquery "violations" --helpful
socrata-nlquery "violations" --wrong --corrected-metric METRIC-045
# JSON output (for scripting)
socrata-nlquery "question" --json
# Evaluation & training
socrata-nlquery evaluate --registry config/metric_registry_full.json
socrata-nlquery train --feedback-source data/local_db/router_observability.duckdb
# Run demo
socrata-nlquery demoSee DEPLOYMENT_GUIDE.md for:
- Environment variables
- Configuration files
- Performance tuning
- Troubleshooting
pytest tests/ -qmake test # Run all tests
make lint # Check code style
make demo # Run end-to-end demo
make evaluate # Evaluate router accuracy
make train # Optimize router weightsDEPLOYMENT_GUIDE.md— Production deploymentdocs/superpowers/specs/— System design specificationsdocs/superpowers/plans/— Implementation plans
For issues or questions, contact the development team.