Skip to content

AI-Requirement-Analyzer-Estimator is an intelligent dual-AI system that transforms client software requirements into structured, professional project insights. Built using FastAPI, Google Gemini 2.5 Flash, and OpenAI GPT, it analyzes project descriptions to estimate complexity, developer count, timelines, and potential risks.

License

Notifications You must be signed in to change notification settings

Elanchezhiyan-P/ai-requirement-analyzer-estimator

Repository files navigation

AI-Requirement-Analyzer-Estimator

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.

🎯 Features

  • 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

πŸ“‹ Requirements

  • Python 3.10 or higher
  • API keys for:

πŸš€ Installation

  1. Clone or download this repository

  2. Install dependencies:

pip install -r requirements.txt
  1. Set up API keys:
    • Copy .env.example to .env
    • Add your API keys to the .env file:
      GEMINI_API_KEY=your_actual_gemini_api_key
      OPENAI_API_KEY=your_actual_openai_api_key
      

πŸ“– Usage

Option 1: Web UI (Recommended)

Start the FastAPI server:

python app.py

Or using uvicorn directly:

uvicorn app:app --reload --host 0.0.0.0 --port 8000

Access the Web UI:

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

Option 2: FastAPI REST API

The API is available at: http://localhost:8000

API Endpoints

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 models
  • follow_up_questions: List of questions for next client meeting
  • report_id: Unique ID to download the PDF report
  • pdf_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"

Example Python Client

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)

Option 3: CLI (Command Line Interface)

Run the main script:

python main.py

The application will prompt you for:

  1. Client Requirements: Detailed project description
  2. Number of Developers: Integer input
  3. Developer Roles: Comma-separated list (e.g., "2 Frontend, 2 Backend, 1 AI Engineer")
  4. Suggested Tech Stack: Comma-separated list (e.g., "React, FastAPI, TensorFlow, PostgreSQL, Google Cloud")

After collecting inputs, the application will:

  1. Analyze requirements with Gemini 2.5 Flash
  2. Analyze requirements with OpenAI GPT
  3. Merge both analyses
  4. Generate a professional PDF report

The output PDF will be saved as AI_Requirement_Report.pdf in the current directory.

πŸ“ Project Structure

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

πŸ“„ Example Input

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

πŸ“Š Example Output

The generated PDF report includes:

  1. Title Page - Project title and generation date
  2. Table of Contents - Complete navigation with page numbers
  3. Project Overview - Summary of the project requirements
  4. AI Analyses Summary - Results from both Gemini and GPT
  5. Key Features - Merged list of identified features
  6. Detailed Feature Breakdown - Feature-by-feature analysis with complexity and effort estimates
  7. Complexity Level - Consensus complexity assessment (Low/Medium/High)
  8. Estimated Duration - Average duration in months
  9. Developer Details - Number and roles of developers
  10. Suggested Tech Stack - Technology recommendations
  11. Risk Factors - Identified project risks
  12. Recommendations / Observations - Merged recommendations from both AIs
  13. Report Information - Timestamp and generation details
  14. 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

πŸ”§ Technical Details

AI Models Used

  • 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

Merging Logic

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

PDF Generation

  • 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

πŸ› οΈ Dependencies

  • openai - OpenAI API client
  • google-generativeai - Google Gemini API client
  • reportlab - PDF generation
  • python-dotenv - Environment variable management
  • fastapi - Modern web framework for building APIs
  • uvicorn[standard] - ASGI server for FastAPI
  • pydantic - Data validation using Python type annotations
  • python-multipart - Support for form data parsing

⚠️ Important Notes

  • 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

πŸ“ License

This project is provided as-is for educational and professional use.

πŸ‘€ Author

Elanchezhiyan P
Senior Software Developer
Portfolio: codebyelan.in

Version: 1.0.0
Date: November 2025


About

AI-Requirement-Analyzer-Estimator is an intelligent dual-AI system that transforms client software requirements into structured, professional project insights. Built using FastAPI, Google Gemini 2.5 Flash, and OpenAI GPT, it analyzes project descriptions to estimate complexity, developer count, timelines, and potential risks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published