A professional Python application that analyzes client software requirements using dual AI models β Google Gemini 2.5 Flash and OpenAI GPT β to produce comprehensive project estimations with developer count, complexity assessment, and duration predictions.
- Dual AI Analysis: Leverages both Google Gemini 2.5 Flash and OpenAI GPT for comprehensive requirement analysis
- Intelligent Merging: Combines insights from both AI models, reconciling differences and averaging estimates
- Modern Web UI: Beautiful, responsive web interface for easy interaction
- Professional PDF Reports: Generates well-formatted PDF reports with table of contents, page numbers, and proper alignment
- Follow-up Questions: Automatically generates questions for next client meeting (API only)
- REST API: Full-featured FastAPI with Swagger documentation
- CLI Support: Command-line interface for terminal users
- Comprehensive Analysis: Includes project goals, features, risk factors, complexity assessment, and recommendations
- Python 3.10 or higher
- API keys for:
- Google Gemini (Gemini 2.5 Flash) - Get from Google AI Studio
- OpenAI (GPT-4o or GPT-3.5-turbo) - Get from OpenAI Platform
-
Clone or download this repository
-
Install dependencies:
pip install -r requirements.txt- Set up API keys:
- Copy
.env.exampleto.env - Add your API keys to the
.envfile:GEMINI_API_KEY=your_actual_gemini_api_key OPENAI_API_KEY=your_actual_openai_api_key
- Copy
Start the FastAPI server:
python app.pyOr using uvicorn directly:
uvicorn app:app --reload --host 0.0.0.0 --port 8000Access the Web UI:
- Web Interface: http://localhost:8000
- Interactive API Docs: http://localhost:8000/docs (Swagger UI)
- Alternative Docs: http://localhost:8000/redoc (ReDoc)
The web UI provides a user-friendly interface to:
- Enter project requirements
- View analysis results with visual cards
- See follow-up questions for client meetings
- Download PDF reports
The API is available at: http://localhost:8000
1. Analyze Requirements (POST /analyze)
curl -X POST "http://localhost:8000/analyze" \
-H "Content-Type: application/json" \
-d '{
"client_requirements": "An AI-powered chatbot platform with analytics dashboard and voice recognition.",
"num_developers": 5,
"developer_roles": "2 Frontend, 2 Backend, 1 AI Engineer",
"tech_stack": "React, FastAPI, TensorFlow, PostgreSQL, Google Cloud"
}'Response includes:
analysis: Complete merged analysis from both AI modelsfollow_up_questions: List of questions for next client meetingreport_id: Unique ID to download the PDF reportpdf_filename: Generated PDF filename
2. Download PDF Report (GET /download/{report_id})
curl -O "http://localhost:8000/download/{report_id}"3. List All Reports (GET /reports)
curl "http://localhost:8000/reports"4. Health Check (GET /health)
curl "http://localhost:8000/health"import requests
# Analyze requirements
response = requests.post("http://localhost:8000/analyze", json={
"client_requirements": "An AI-powered chatbot platform with analytics dashboard and voice recognition.",
"num_developers": 5,
"developer_roles": "2 Frontend, 2 Backend, 1 AI Engineer",
"tech_stack": "React, FastAPI, TensorFlow, PostgreSQL, Google Cloud"
})
result = response.json()
print(f"Report ID: {result['report_id']}")
print(f"Analysis: {result['analysis']}")
print(f"Follow-up Questions: {result['follow_up_questions']}")
# Download PDF
report_id = result['report_id']
pdf_response = requests.get(f"http://localhost:8000/download/{report_id}")
with open("report.pdf", "wb") as f:
f.write(pdf_response.content)Run the main script:
python main.pyThe application will prompt you for:
- Client Requirements: Detailed project description
- Number of Developers: Integer input
- Developer Roles: Comma-separated list (e.g., "2 Frontend, 2 Backend, 1 AI Engineer")
- Suggested Tech Stack: Comma-separated list (e.g., "React, FastAPI, TensorFlow, PostgreSQL, Google Cloud")
After collecting inputs, the application will:
- Analyze requirements with Gemini 2.5 Flash
- Analyze requirements with OpenAI GPT
- Merge both analyses
- Generate a professional PDF report
The output PDF will be saved as AI_Requirement_Report.pdf in the current directory.
AI-Requirement-Analyzer-Estimator/
βββ app.py # FastAPI application (Web API)
βββ main.py # CLI/Console entry point
βββ gemini_module.py # Handles Gemini API calls
βββ gpt_module.py # Handles GPT API calls
βββ merger.py # Merges and reconciles both AI outputs
βββ pdf_generator.py # Creates professional PDF reports
βββ question_generator.py # Generates follow-up questions for client meetings
βββ static/ # Web UI files
β βββ index.html # Main HTML page
β βββ styles.css # CSS styling
β βββ script.js # JavaScript for API interaction
βββ requirements.txt # Python dependencies
βββ .env # API keys (create from .env.example)
βββ .env.example # Template for API keys
βββ generated_reports/ # Directory for generated PDF reports
βββ README.md # This file
Client Requirements:
An AI-powered chatbot platform with analytics dashboard and voice recognition capabilities.
The system should support multiple languages and integrate with existing CRM systems.
Number of Developers: 5
Developer Roles: 2 Frontend, 2 Backend, 1 AI Engineer
Suggested Tech Stack: React, FastAPI, TensorFlow, PostgreSQL, Google Cloud
The generated PDF report includes:
- Title Page - Project title and generation date
- Table of Contents - Complete navigation with page numbers
- Project Overview - Summary of the project requirements
- AI Analyses Summary - Results from both Gemini and GPT
- Key Features - Merged list of identified features
- Detailed Feature Breakdown - Feature-by-feature analysis with complexity and effort estimates
- Complexity Level - Consensus complexity assessment (Low/Medium/High)
- Estimated Duration - Average duration in months
- Developer Details - Number and roles of developers
- Suggested Tech Stack - Technology recommendations
- Risk Factors - Identified project risks
- Recommendations / Observations - Merged recommendations from both AIs
- Report Information - Timestamp and generation details
- Project Information - Developer information and website
PDF Features:
- Professional formatting with proper alignment
- Page numbers on every page (Page X of Y)
- Table of contents
- Footer with developer information on every page
- Clean, readable layout
API Response includes:
- Complete analysis results
- Follow-up questions for next client meeting
- Report ID for PDF download
- Google Gemini 2.5 Flash: Analyzes project goals, key features, risk factors, technical complexity, and potential timeline
- OpenAI GPT (GPT-4o): Analyzes feature breakdown, effort estimation, developer count, duration, complexity, and provides role suggestions
The merger module:
- Combines feature lists from both AI models
- Averages duration estimates
- Determines complexity consensus
- Merges recommendations while removing duplicates
- Preserves unique insights from each model
- Uses ReportLab for professional PDF creation
- Custom page numbering (Page X of Y)
- Table of contents with page references
- Proper margins and alignment
- Footer on every page with developer information
openai- OpenAI API clientgoogle-generativeai- Google Gemini API clientreportlab- PDF generationpython-dotenv- Environment variable managementfastapi- Modern web framework for building APIsuvicorn[standard]- ASGI server for FastAPIpydantic- Data validation using Python type annotationspython-multipart- Support for form data parsing
- Ensure you have valid API keys with sufficient credits/quota
- The application requires internet connectivity to call AI APIs
- PDF generation requires write permissions in the current directory
- If GPT-4o is not available, the application will fallback to GPT-3.5-turbo
- The FastAPI server runs on port 8000 by default (configurable in
app.py) - Generated PDFs are stored in the
generated_reports/directory - The API includes CORS middleware allowing all origins (configure for production)
- Follow-up questions are only available in the API response, not in the PDF
This project is provided as-is for educational and professional use.
Elanchezhiyan P
Senior Software Developer
Portfolio: codebyelan.in
Version: 1.0.0
Date: November 2025