Skip to content

amgdy/rfp-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

46 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RFP Analyzer

License: MIT Python 3.13+ Azure

An AI-powered application for analyzing Request for Proposals (RFPs) and scoring vendor proposals using Azure AI services and a multi-agent architecture.

🎯 Overview

RFP Analyzer automates the complex process of evaluating vendor proposals against RFP requirements. It leverages Azure AI services to extract document content, analyze evaluation criteria, and score proposals using a sophisticated multi-agent system.

Key Capabilities

  • Automated Document Processing: Extract content from PDFs, Word documents, and images using Azure AI
  • Intelligent Criteria Extraction: Automatically identify evaluation criteria and weights from RFP documents
  • Multi-Vendor Comparison: Evaluate and rank multiple vendor proposals simultaneously
  • Comprehensive Reporting: Generate detailed reports in Word, CSV, and JSON formats

✨ Features

3-Step Workflow

  1. πŸ“€ Upload Documents

    • Upload your RFP document (PDF, DOCX, or images)
    • Upload multiple vendor proposals for comparison
  2. βš™οΈ Configure & Extract

    • Choose extraction service (Azure Content Understanding or Document Intelligence)
    • Extract structured content from all documents
  3. πŸ€– AI-Powered Evaluation

    • Automatic criteria extraction from RFP
    • Score each proposal against identified criteria
    • Generate comparative rankings and recommendations

Document Extraction Services

Service Best For Features
Azure Content Understanding Complex documents, mixed content Multi-modal analysis, layout understanding
Azure Document Intelligence Structured documents, forms High accuracy OCR, pre-built models

Multi-Agent Architecture

The evaluation system uses specialized AI agents:

Agent Responsibility
Criteria Extraction Agent Analyzes RFP to identify scoring criteria, weights, and evaluation guidance
Proposal Scoring Agent Evaluates each vendor proposal against extracted criteria
Comparison Agent Compares vendors, generates rankings, and provides recommendations

Export Options

  • πŸ“Š CSV Reports: Comparison matrices with all metrics
  • πŸ“„ Word Documents: Detailed evaluation reports per vendor
  • πŸ“‹ JSON Data: Structured data for further processing
  • πŸ“ˆ Interactive Charts: Visual score comparisons (requires Plotly)

πŸ—οΈ Architecture

See docs/ARCHITECTURE.md for detailed diagrams and component descriptions.

High-Level Architecture

flowchart TB
    subgraph App["πŸ–₯️ RFP Analyzer Application"]
        UI["Streamlit UI"]
        DP["Document Processor"]
        MAS["Multi-Agent Scoring System"]
        UI --> DP --> MAS
    end
    
    subgraph Azure["☁️ Azure AI Services"]
        AOAI["Azure OpenAI<br>GPT-4.1+"]
        ADI["Azure Document<br>Intelligence"]
        ACU["Azure AI Content<br>Understanding"]
    end
    
    App --> Azure
    
    style App fill:#e3f2fd,stroke:#1565c0
    style Azure fill:#e8f5e9,stroke:#2e7d32
Loading

Azure Resources (Deployed via azd)

Resource Purpose
Azure AI Foundry Account Hosts AI services (OpenAI, Content Understanding, Document Intelligence)
Azure Container Apps Runs the Streamlit application
Azure Container Registry Stores application container images
Log Analytics Workspace Centralized logging and monitoring
Application Insights Application performance monitoring
User-Assigned Managed Identity Secure authentication to Azure services

πŸš€ Getting Started

Prerequisites

Azure Subscription Requirements

Your Azure subscription needs:

  • Azure OpenAI access (with GPT-4.1 or GPT-5 model deployment)
  • Azure AI Foundry resource
  • Sufficient quota for model deployments

Quick Start (Local Development)

  1. Clone the repository

    git clone https://github.com/amgdy/rfp-analyzer.git
    cd rfp-analyzer
  2. Install dependencies

    cd app
    uv sync
  3. Configure environment

    cp .env.example .env
    # Edit .env with your Azure credentials
  4. Authenticate with Azure

    az login
  5. Run the application

    uv run streamlit run main.py
  6. Open your browser at http://localhost:8501

☁️ Azure Deployment

Deploy with Azure Developer CLI

The easiest way to deploy is using Azure Developer CLI (azd):

  1. Initialize the environment

    azd init
  2. Provision Azure resources and deploy

    azd up

    This will:

    • Create a resource group
    • Provision all required Azure resources
    • Build and push the container image
    • Deploy the application to Azure Container Apps
  3. Access your application

    After deployment, azd will output the application URL.

What Gets Deployed

Resource Group: rg-{environment-name}
β”œβ”€β”€ Azure AI Foundry Account
β”‚   β”œβ”€β”€ GPT-5.2 Model Deployment
β”‚   β”œβ”€β”€ GPT-4.1 Model Deployment
β”‚   β”œβ”€β”€ GPT-4.1-mini Model Deployment
β”‚   └── text-embedding-3-large Deployment
β”œβ”€β”€ Azure AI Foundry Project
β”œβ”€β”€ Azure Container Apps Environment
β”‚   └── rfp-analyzer (Container App)
β”œβ”€β”€ Azure Container Registry
β”œβ”€β”€ Log Analytics Workspace
β”œβ”€β”€ Application Insights
└── User-Assigned Managed Identity

Environment Variables

The following environment variables are configured automatically during Azure deployment:

Variable Description
AZURE_OPENAI_ENDPOINT Azure OpenAI endpoint URL
AZURE_OPENAI_DEPLOYMENT_NAME Default model deployment name
AZURE_CONTENT_UNDERSTANDING_ENDPOINT Content Understanding endpoint
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT Document Intelligence endpoint
AZURE_CLIENT_ID Managed identity client ID
APPLICATIONINSIGHTS_CONNECTION_STRING App Insights connection string

Manual Configuration (Local Development)

For local development, create a .env file in the app directory:

# Required
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o-mini

# Choose one extraction service
AZURE_CONTENT_UNDERSTANDING_ENDPOINT=https://your-ai-foundry.services.ai.azure.com/
# OR
AZURE_DOCUMENT_INTELLIGENCE_ENDPOINT=https://your-doc-intel.cognitiveservices.azure.com/

# Optional: Enable OpenTelemetry logging
OTEL_LOGGING_ENABLED=false

🐳 Docker Deployment

Using Docker Compose (Recommended)

cd app

# Configure environment
cp .env.example .env
# Edit .env with your Azure credentials

# Build and run
docker compose up --build

# Run in background
docker compose up -d

Using Docker Directly

cd app

# Build the image
docker build -t rfp-analyzer .

# Run the container
docker run -p 8501:8501 \
  -e AZURE_CONTENT_UNDERSTANDING_ENDPOINT=your-endpoint \
  -e AZURE_OPENAI_ENDPOINT=your-openai-endpoint \
  -e AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o-mini \
  -e AZURE_TENANT_ID=your-tenant-id \
  -e AZURE_CLIENT_ID=your-client-id \
  -e AZURE_CLIENT_SECRET=your-client-secret \
  rfp-analyzer

Access the application at http://localhost:8501

πŸ“ Project Structure

rfp-analyzer/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ LICENSE                            # MIT License
β”œβ”€β”€ azure.yaml                         # Azure Developer CLI configuration
β”œβ”€β”€ Dockerfile                         # Root Dockerfile
β”œβ”€β”€ docs/
β”‚   └── ARCHITECTURE.md               # Detailed architecture documentation
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ main.py                       # Streamlit application entry point
β”‚   β”œβ”€β”€ pyproject.toml                # Python dependencies (UV)
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies (pip)
β”‚   β”œβ”€β”€ Dockerfile                    # Application Dockerfile
β”‚   β”œβ”€β”€ docker-compose.yml            # Docker Compose configuration
β”‚   β”œβ”€β”€ .env.example                  # Environment template
β”‚   β”œβ”€β”€ scoring_guide.md              # Default evaluation criteria
β”‚   └── services/
β”‚       β”œβ”€β”€ document_processor.py     # Document extraction orchestrator
β”‚       β”œβ”€β”€ content_understanding_client.py  # Azure Content Understanding
β”‚       β”œβ”€β”€ document_intelligence_client.py  # Azure Document Intelligence
β”‚       β”œβ”€β”€ scoring_agent_v2.py       # Multi-agent scoring system
β”‚       β”œβ”€β”€ comparison_agent.py       # Vendor comparison agent
β”‚       β”œβ”€β”€ processing_queue.py       # Async processing queue
β”‚       └── logging_config.py         # Centralized logging configuration
└── infra/
    β”œβ”€β”€ main.bicep                    # Main infrastructure template
    β”œβ”€β”€ main.parameters.json          # Deployment parameters
    β”œβ”€β”€ resources.bicep               # Azure resource definitions
    β”œβ”€β”€ abbreviations.json            # Resource naming abbreviations
    β”œβ”€β”€ modules/
    β”‚   └── fetch-container-image.bicep
    └── hooks/
        β”œβ”€β”€ postprovision.sh          # Post-deployment script (Linux/macOS)
        └── postprovision.ps1         # Post-deployment script (Windows)

πŸ”§ Configuration

Scoring Guide

Edit app/scoring_guide.md to customize the default evaluation criteria and weights. The scoring agent will use this as a reference when extracting criteria from RFPs that don't explicitly define evaluation metrics.

Document Processing

Choose between extraction services in the application sidebar:

  • Azure Content Understanding: Best for complex documents with mixed content
  • Azure Document Intelligence: Best for structured documents and forms

Model Selection

The application supports multiple Azure OpenAI models:

  • GPT-5.2: Latest model with best performance
  • GPT-4.1: Strong performance, widely available
  • GPT-4.1-mini: Cost-effective for simpler tasks

πŸ“Š Usage Guide

Step 1: Upload Documents

  1. Upload your RFP document (PDF, DOCX, PNG, JPG)
  2. Upload one or more vendor proposal documents
  3. Each document will show a preview and file size

Step 2: Extract Content

  1. Select your preferred extraction service
  2. Click "Extract All Documents"
  3. Wait for processing (progress shown for each document)
  4. Review extracted content in the expandable sections

Step 3: Evaluate & Compare

  1. Click "Start Evaluation" to begin AI analysis
  2. The system will:
    • Extract evaluation criteria from the RFP
    • Score each vendor against the criteria
    • Generate a comparative ranking
  3. Review results in the tabbed interface:
    • Summary: Overall rankings and recommendations
    • Individual Reports: Detailed scores per vendor
    • Comparison Matrix: Side-by-side criterion comparison

Step 4: Export Results

Download results in your preferred format:

  • CSV: For spreadsheet analysis
  • Word: For formal reporting
  • JSON: For integration with other systems

πŸ§ͺ Development

Running Tests

cd app
uv run pytest

Code Quality

# Format code
uv run ruff format .

# Lint code
uv run ruff check .

Local Development with Hot Reload

cd app
uv run streamlit run main.py --server.runOnSave true

πŸ“¦ Dependencies

Core Dependencies

Package Purpose
streamlit Web application framework
agent-framework Microsoft Agent Framework for multi-agent orchestration
azure-identity Azure authentication
azure-ai-documentintelligence Document Intelligence SDK
pydantic Data validation and models
python-docx Word document generation
plotly Interactive charts

πŸ”’ Security

  • Managed Identity: Azure resources use managed identity for secure, keyless authentication
  • No Stored Credentials: Application uses DefaultAzureCredential for flexible authentication
  • Network Security: Container Apps can be configured with private endpoints
  • RBAC: Fine-grained role-based access control for Azure resources

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Built with ❀️ using Azure AI Services

About

An AI-powered application for analyzing Request for Proposals (RFPs) and scoring vendor proposals using Azure AI services and a multi-agent architecture.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors