# Dziwani - Infrastructure Transparency Chatbot
A specialized chatbot for querying and exploring Malawi's infrastructure projects database. Named "Dziwani" (meaning "what you should know" in Chichewa), this tool provides a natural language interface to access detailed information about infrastructure projects, their status, and related statistics.
## Features
- Natural language querying of infrastructure projects
- Interactive chat interface with guidance tiles for:
- Finding projects by sector (Infrastructure, Water, Energy, etc.)
- Finding projects by location (districts)
- Finding specific project details
- Detailed project information including:
- Project Name
- District
- Project Sector
- Project Status
- Budget (in MWK)
- Completion Percentage
- Start and Completion Dates
- Real-time chat responses
- Loading states and error handling
- Responsive design for all devices
## Technical Architecture
### Frontend Components
The frontend of Dziwani uses a lightweight, server-side rendered approach:
- **Technology Stack**:
- HTML with Jinja2 Templates
- Vanilla JavaScript (no framework)
- Plain CSS for styling
- No build process required
- **Key Files**:
- `frontend/templates/index.html` - Main chat interface
- `frontend/static/js/main.js` - Core application logic
- `frontend/static/css/styles.css` - Main styling
- `frontend/static/css/loading.css` - Loading animations
- **Features**:
- Responsive design for mobile and desktop
- Client-side form validation
- Interactive chat history
- Expandable query details for technical users
- Loading indicators and error handling
### Backend Components
The backend is built on FastAPI with LangChain for RAG-based SQL generation:
- **Technology Stack**:
- FastAPI web framework
- SQLite database
- LangChain for RAG-SQL capabilities
- Python 3.11+
- Jinja2 for templating
- **Key Components**:
- `app/main.py` - Entry point and API configuration
- `app/database/langchain_sql.py` - SQL generation with LangChain
- `app/model …