An AI-powered construction project management platform that provides explainable insights, scenario simulations, and intelligent document analysis through an intuitive chat-based experience.
Built by The Multiverse Task Force โ Sparsh Agarwal & Divy Dobariya
This project addresses two critical challenges in construction and capital planning:
Challenge 1: What-If Analysis with Explainable AI:
- Existing tools cannot simulate project changes in real-time or show impact instantly
- No transparency on why decisions are suggested, making planning slow and unclear
Challenge 2: NLP-based Contract Analysis:
- Key contract details are buried in documents, causing delays and missed risks
- No smart search or automated compliance alerts โ review is manual and error-prone
Construction projects suffer from:
- Scattered Data: Critical information buried across PDFs, contracts, BIM models, and reports
- Manual Review Bottlenecks: Hours spent searching for clauses, deadlines, and compliance requirements
- Opaque Dashboards: No understanding of why metrics are flagged or how scores are calculated
- Slow Decision-Making: Unable to quickly simulate "what-if" scenarios for cost overruns or timeline delays
๐ RAG-Based Document Intelligence โ Natural language queries on project documents with source citations
๐๏ธ Interactive What-If Simulator โ Real-time scenario testing with explainable impact analysis using tunable sliders
๐ Visual Insights Dashboard โ Highlights, risks, and document chat with transparent reasoning
๐ Explainable AI โ Every insight includes reasoning chains and audit trails
๐ค Dual AI Backend โ Choose between OpenAI GPT-4 (production) or Google Gemini (free tier)
Option A: OpenAI Backend (Recommended for production)
# Navigate to backend
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add: OPENAI_API_KEY=sk-your_key_here
# Start server
uvicorn main:app --reload --host 0.0.0.0 --port 8000Option B: Google Gemini Backend (Free alternative)
# Navigate to Gemini version
cd backend/gemini_version
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add: GOOGLE_API_KEY=your_gemini_key_here
# Start server
uvicorn main:app --reload --host 0.0.0.0 --port 8000โ
Backend running at: http://localhost:8000
๐ API Docs: http://localhost:8000/docs
# Open new terminal and navigate to frontend
cd frontend
# Install dependencies
npm install
# Configure backend connection
cp .env.example .env
# Edit .env and add: VITE_API_BASE_URL=http://localhost:8000
# Start development server
npm run devโ Frontend running at: http://localhost:5173
whatif-rag-construction/
โ
โโโ backend/ # OpenAI-powered backend
โ โโโ loader.py # Multi-format document ingestion
โ โโโ vectorstore.py # ChromaDB + OpenAI embeddings
โ โโโ rag_chain.py # AI reasoning engine
โ โโโ main.py # FastAPI server
โ โโโ requirements.txt
โ
โโโ backend/gemini_version/ # Google Gemini backend (free)
โ โโโ loader.py
โ โโโ vectorstore.py # ChromaDB + Gemini embeddings
โ โโโ rag_chain.py
โ โโโ main.py
โ โโโ requirements.txt
โ
โโโ frontend/ # React + TypeScript UI
โโโ src/
โ โโโ components/ # Reusable UI components
โ โโโ pages/ # Main application views
โ โ โโโ Welcome.tsx
โ โ โโโ Chat.tsx
โ โ โโโ ScenarioTuning.tsx
โ โ โโโ VisualInsights.tsx
โ โโโ contexts/ # Global state management
โ โโโ App.tsx
โโโ package.json
โโโโโโโโโโโโโโโโโโโ
โ Upload Documentsโ โ PDF, DOCX, BIM, CSV, Images
โโโโโโโโโโฌโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Document Loaderโโโโโโโถโ Vector Store โ โ ChromaDB
โ (Chunking) โ โ (Embeddings)โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ RAG Chat โ โ Dashboard AI โ โ What-If Engine โ
โ Q&A + Citationsโ โ Health Scoring โ โ Scenario Tuningโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ React Frontend โ
โ Chat Interface โ
โโโโโโโโโโโโโโโโโโโ
- AI Models: OpenAI GPT-4/GPT-4o | Google Gemini Pro
- RAG Framework: LangChain 0.3.14
- Vector Database: ChromaDB 0.5.23
- API Framework: FastAPI 0.120.3
- Document Processing: PyPDF, python-docx, ezdxf, IfcOpenShell, Pandas
- Framework: React 18+ with TypeScript
- Build Tool: Vite
- Routing: React Router
- State Management: Context API
- Styling: Tailwind CSS (via UI components)
- Ask natural language questions about uploaded documents
- Get instant answers with source citations
- Conversational follow-ups maintain context
- Example: "What is the payment schedule?" โ Returns answer with contract section reference
- 5 Adjustable Sliders (scored 1-5):
- Cost Management
- Timeline Adherence
- Design Quality
- Regulatory Compliance
- Sustainability
- Real-time Analysis: View strengths, weaknesses, and top 3 recommended changes
- What-If Simulation: See instant impact of parameter adjustments
- Example: "What if I reduce timeline score from 4 to 2?" โ Shows impact + mitigation steps
- Highlights: Key achievements and positive indicators
- Risks: Identified threats requiring attention
- Document Chat: Ask specific questions with contextual answers
- Example: "Which clauses address force majeure events?" โ Extracts and cites relevant sections
- Every response includes reasoning chain
- Source citations for all claims
- Audit trails for compliance and transparency
| Format | Use Case | Processing |
|---|---|---|
| Contracts, reports | Page-based chunking | |
| DOCX | Proposals, change orders | Text extraction |
| CSV/XLSX | Cost sheets, schedules | Table summarization |
| IFC/BIM | 3D building models | Entity extraction |
| DWG/DXF | CAD drawings | Layer analysis |
| Images | Site photos, diagrams | Tesseract OCR |
| Endpoint | Method | Description |
|---|---|---|
/upload |
POST | Upload and index documents |
/search |
POST | Ask questions (RAG Q&A) |
/dashboard |
GET | Get AI project health scores |
/highlights |
GET | Extract key terms and risks |
/ask |
POST | Run what-if scenario simulations |
curl -X POST "http://localhost:8000/search" \
-H "Content-Type: application/json" \
-d '{"question": "What are the liquidated damages?"}'-
Upload Project Documents (via UI)
- Contract PDF
- Cost estimate XLSX
- Structural plans PDF
-
View Dashboard โ Get overall health score with AI reasoning
-
Extract Insights โ Automated highlights of deadlines, risks, compliance gaps
-
Run Scenario โ "What if steel delivery is delayed 4 weeks?" โ Impact analysis + 3-step mitigation
-
Ask Questions โ "What are the payment milestones?" โ Answer with section citations
# Build for production
pip install -r requirements.txt
# Run with Gunicorn
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000# Build production bundle
npm run build
# Preview locally
npm run preview
# Deploy dist/ folder to hosting service (Vercel, Netlify, AWS S3)Backend won't start:
- Verify Python 3.10+:
python --version - Check API key in
.env - Ensure dependencies:
pip install -r requirements.txt
Frontend can't connect:
- Verify backend running:
curl http://localhost:8000/about - Check
VITE_API_BASE_URLin frontend.env - Ensure CORS enabled in backend
main.py
Vector search fails:
- Clear ChromaDB:
rm -rf /tmp/chroma_store - Check write permissions
We welcome contributions! Please:
- Fork the repository
- Create feature branch:
git checkout -b feature/AmazingFeature - Commit changes:
git commit -m 'Add AmazingFeature' - Push to branch:
git push origin feature/AmazingFeature - Open Pull Request
This project is licensed under the MIT License - see LICENSE file for details.
The Multiverse Task Force
- Sparsh Agarwal โ Front End and System Integration
- Divy Dobariya โ Backend Development & AI/ML, Langchain, RAG Architechture
Built for Aurigo Hackathon 2025 ๐
- Issues: GitHub Issues
- Email: divydobariya11@gmail.com
โก Make better construction decisions, faster, with transparent AI reasoning.
โญ Star this repo if you find it useful!
