Governing with AI for the People
AI-powered citizen service system for Montelíbano Municipality, Córdoba
SERENO is an intelligent citizen service system that transforms how local governments interact with their citizens. More than a chatbot, SERENO is a complete case management platform with institutional memory that ensures:
- ✅ Reception Certainty: Every report receives a unique case number
- ✅ Proactive Support: Automatic notifications without citizens needing to follow up
- ✅ Complete Traceability: Full history of every interaction
- ✅ Artificial Intelligence: Predictive analytics and intelligent policy segmentation
| Traditional System | SERENO |
|---|---|
| Conversational chatbot without memory | Case-based tracking with active follow-up |
| No reception guarantee | Immediate confirmation with case number |
| Generic responses | Contextual conversational flow by emergency type |
| No data analysis | AI for segmentation and data-driven policies |
| Citizen must follow up | Proactive automatic support |
- Report emergency: "There was a traffic accident on 5th Street"
- Receive confirmation: "Your report has been registered. Case number: SER-000001"
- Answer guided questions: Location, injuries, additional details
- Receive automatic updates: No need to call or follow up
- Complete case management panel
- Filters by status (received, in progress, closed)
- Status updates with automatic notifications
- Analytics dashboard (coming soon)
┌─────────────────────────────────────────────────────────────┐
│ FRONTEND (Web Interface) │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Citizen Chat │ │ Admin Panel │ │
│ └──────┬───────┘ └──────┬───────┘ │
└─────────┼─────────────────────────────┼─────────────────────┘
│ │
└──────────────┬───────────────┘
│ REST API
┌──────────────▼───────────────┐
│ BACKEND (FastAPI) │
│ ┌─────────────────────────┐ │
│ │ Business Logic Layer │ │
│ │ - Case Management │ │
│ │ - Conversation Flow │ │
│ │ - Message Templates │ │
│ └─────────────────────────┘ │
│ ┌─────────────────────────┐ │
│ │ AI/ML Services │ │
│ │ - Intent Classification│ │
│ │ - Data Segmentation │ │
│ │ - Policy Suggestions │ │
│ └─────────────────────────┘ │
└──────────────┬────────────────┘
│
┌──────────────▼───────────────┐
│ DATABASE (SQLite/PostgreSQL)│
│ - Cases │
│ - Messages │
│ - Analytics Metadata │
└───────────────────────────────┘
SERENO uses Natural Language Processing (NLP) to:
-
Emergency Type Detection
- Automatic classification: accidents, security, infrastructure, public services
- Entity extraction: locations, dates, affected persons
-
Intelligent Conversational Flow
- Contextual questions based on emergency type
- Critical information validation (injuries, exact location)
- Intent detection (new report vs. follow-up)
-
Active Case Management
- Context memory per session
- Prevention of case duplication
- Intelligent message association to correct case
Goal: Identify patterns and trends in citizen reports to inform public policies.
Capabilities:
- Geographic clustering: Identify critical zones by emergency type
- Temporal analysis: Detect seasonal patterns and peak incident hours
- Demographic segmentation: Understand which populations are most affected
- Event correlation: Identify relationships between different report types
Use Case Example:
Analysis: "Traffic accidents in Centro neighborhood increase 300%
on Fridays between 6-9 PM. Correlation with reports of insufficient
public lighting in the same area."
Goal: Provide actionable recommendations to emergency services and planning entities.
AI Modules:
a) Predictive Analytics
- Time series models to predict emergency peaks
- Early warnings based on historical patterns
- Resource optimization (police, fire, ambulances)
b) Policy Recommendations
- Infrastructure: "Install 15 additional traffic lights in identified critical zones"
- Security: "Increase patrols in neighborhood X during weekends based on 6-month analysis"
- Public Services: "Prioritize sewer maintenance in sector Y due to correlation with health reports"
c) Niche Segmentation
- Identify specific citizen groups with particular needs
- Policy personalization by segment (elderly, students, merchants)
- Impact analysis by gender, age, location
Example Output:
{
"policy_recommendation": {
"type": "infrastructure",
"priority": "high",
"evidence": {
"cases_analyzed": 1247,
"time_period": "6 months",
"correlation": "traffic_accidents + insufficient_lighting"
},
"recommendation": "Install LED lighting system at 8 critical points",
"estimated_impact": "45% reduction in nighttime accidents",
"cost_benefit": {
"investment": "$2.4M COP",
"savings_emergency_services": "$1.8M COP/year"
}
}
}Features:
- Geographic hotspot visualization
- Temporal trends with predictions
- Policy impact scorecards
- Intervention effectiveness comparison
- FastAPI: Modern and fast framework for APIs
- SQLAlchemy: ORM for database management
- SQLite/PostgreSQL: Data persistence
- Pydantic: Data validation with type hints
- HTML5/CSS3: Modern and responsive interface
- Vanilla JavaScript: No heavy dependencies
- Institutional Design: Montelíbano colors (green and white)
- scikit-learn: Clustering and classification
- spaCy/NLTK: Natural language processing
- Pandas/NumPy: Data analysis
- TensorFlow/PyTorch: Deep learning models (optional)
- Python 3.8+
- pip
- Git
# 1. Clone the repository
git clone https://github.com/CaPerez17/SERENO.git
cd SERENO
# 2. Install dependencies
cd backend
pip install -r requirements.txt
# 3. Initialize database (created automatically on startup)
# Database is created automatically when starting the server
# 4. Start the server
uvicorn main:app --reload --host 0.0.0.0 --port 8000- Citizen Chat: http://localhost:8000/
- Admin Panel: http://localhost:8000/admin
- API Docs (Swagger): http://localhost:8000/docs
POST /api/messages- Send message and create/update caseGET /api/cases/{case_number}- Check case statusGET /api/cases/{case_number}/messages- Message history
GET /api/cases- List all cases (with filters)PUT /api/cases/{case_number}/status- Update case status
✅ Immediate Confirmation: Every report receives unique case number (SER-XXXXXX)
✅ Guided Conversational Flow: Contextual questions by emergency type
✅ Proactive Support: Automatic notifications without needing to follow up
✅ Status Query: Check status with simple command "estado SER-XXXXXX"
✅ Institutional Memory: System remembers your active case
✅ Management Panel: Complete view of all cases
✅ Smart Filters: By status, date, emergency type
✅ Status Updates: With automatic citizen notifications
✅ Complete History: Traceability of every interaction
✅ Analytics Dashboard: (Coming soon) Trend and pattern visualization
- Emergency type detection
- Intent classification (new report vs. follow-up)
- Contextual conversational flow
- Geographic case clustering
- Temporal trend analysis
- Demographic segmentation
- Correlation between emergency types
- Predictive emergency models
- Data-driven policy suggestions
- Intervention impact analysis
- Emergency resource optimization
- Interactive hotspot visualization
- Policy scorecards
- Automatic executive reports
- Predictive early warnings
Citizen: "There was an accident on 5th Street"
System: "What is the exact location? (neighborhood, landmark)"
Citizen: "Centro neighborhood, near the park"
System: "Are there any injured persons?"
Citizen: "Yes, two people"
System: "Case SER-000001 registered. Traffic Department notified."
Citizen: "How long will it take?"
System: "Your case SER-000001 is being attended. We will notify you when there are updates."
System: "6-month analysis shows 40% of accidents occur in zone X
on weekends. Recommendation: increase patrols and improve signage."
Contributions are welcome. Please:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Camilo Pérez - CaPerez17
- Montelíbano Municipality, Córdoba
- Open source developer community
- System contributors and users
Developed with ❤️ for the people of Montelíbano
Governing with AI for the People