An AI-powered application for analyzing Request for Proposals (RFPs) and scoring vendor proposals using Azure AI services and a multi-agent architecture.
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.
- Automated Document Processing: Extract content from PDFs and Word documents using Azure AI; text files (TXT, MD) are read directly
- Document Protection Detection: Encrypted and IRM-protected PDFs and DOCX files are detected before processing with clear, actionable error messages
- Intelligent Criteria Extraction: Automatically identify evaluation criteria and weights from RFP documents with confidence scoring
- Confidence-Driven Re-Reasoning: Low-confidence criteria and scores are automatically re-analyzed for improved accuracy
- Multi-Vendor Comparison: Evaluate and rank multiple vendor proposals simultaneously
- Large Document Support: Token-aware chunking with map-reduce for documents exceeding model context windows
- Comprehensive Reporting: Generate detailed reports in Word, CSV, and JSON formats
- Resilient AI Pipeline: Automatic retry with exponential backoff and AI refusal detection
-
π€ Upload Documents
- Upload your RFP document (PDF, DOCX, TXT, or MD)
- Upload multiple vendor proposals for comparison
- AI-extracted formats (PDF, DOCX) use Azure AI services; text files (TXT, MD) are read instantly
- Protected (encrypted/IRM) documents are detected automatically with a clear message
-
βοΈ Extract Content
- Choose extraction service (Azure Content Understanding or Document Intelligence)
- Extract structured content from all documents
-
π Review Criteria
- AI-extracted evaluation criteria with weights and confidence scores
- Confidence badges per criterion (π’ High / π‘ Medium / π΄ Low)
- Automatic re-reasoning for low-confidence criteria
- Review and confirm before scoring
-
π€ AI-Powered Evaluation
- Score each proposal against identified criteria with confidence scoring
- Automatic re-reasoning on low-confidence scores for deeper analysis
- Generate comparative rankings and recommendations
| 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 |
The evaluation system uses specialized AI agents:
| Agent | Responsibility |
|---|---|
| Criteria Extraction Agent | Analyzes RFP to identify scoring criteria, weights, confidence scores, and evaluation guidance. Auto re-reasons on low-confidence criteria |
| Proposal Scoring Agent | Evaluates each vendor proposal against extracted criteria with confidence scoring. Re-reasons on low-confidence scores |
| Comparison Agent | Compares vendors, generates rankings, and provides recommendations |
| Feature | Description |
|---|---|
| Document Protection Detection | Encrypted and IRM-protected PDFs/DOCX detected before API calls using pypdf and msoffcrypto-tool |
| AI Refusal Detection | Automatic retry when models refuse to answer (7 refusal patterns detected) |
| Exponential Backoff | Retry with backoff on transient API failures |
| Large Document Chunking | Token-aware map-reduce splitting for documents exceeding context window |
| Non-Proposal Filtering | Detects and excludes non-proposal documents from scoring |
| Corrupt File Handling | DOCX files that are corrupt or renamed .doc files produce clear error messages |
- π 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)
See docs/ARCHITECTURE.md for detailed diagrams and component descriptions.
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
| 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 |
- Python 3.13+ - Download
- UV Package Manager - Install UV
- Azure CLI - Install Azure CLI
- Azure Developer CLI (azd) - Install azd
- Docker (optional) - For containerized deployment
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
-
Clone the repository
git clone https://github.com/amgdy/rfp-analyzer.git cd rfp-analyzer -
Install dependencies
cd app uv sync -
Configure environment
cp .env.example .env # Edit .env with your Azure credentials -
Authenticate with Azure
az login
-
Run the application
uv run streamlit run main.py
-
Open your browser at
http://localhost:8501
The easiest way to deploy is using Azure Developer CLI (azd):
-
Initialize the environment
azd init
-
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
-
Access your application
After deployment,
azdwill output the application URL.
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
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 (e.g., gpt-5.2) |
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 |
OTEL_LOGGING_ENABLED |
Enable OpenTelemetry logging |
OTEL_TRACING_ENABLED |
Enable distributed tracing |
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-5.2
# 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: Confidence threshold for re-reasoning (default: 0.7)
# CONFIDENCE_THRESHOLD=0.7
# Optional: Enable OpenTelemetry logging
# OTEL_LOGGING_ENABLED=truecd 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 -dcd 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-5.2 \
-e AZURE_TENANT_ID=your-tenant-id \
-e AZURE_CLIENT_ID=your-client-id \
-e AZURE_CLIENT_SECRET=your-client-secret \
rfp-analyzerAccess the application at http://localhost:8501
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
β βββ entrypoint.py # Startup with diagnostics server injection
β βββ 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/
β β βββ core/ # Foundation layer
β β β βββ logging_config.py # Centralized logging (console/file/OTLP)
β β β βββ telemetry.py # OpenTelemetry tracing
β β β βββ token_utils.py # LLM token counting
β β β βββ retry_utils.py # Exponential backoff
β β β βββ utils.py # Shared utilities
β β βββ storage/ # Persistence layer
β β β βββ blob_storage_client.py # Azure Blob Storage CRUD
β β β βββ session_state_manager.py # Workflow state persistence
β β βββ extraction/ # Document processing
β β β βββ document_processor.py # Extraction orchestrator
β β β βββ processing_queue.py # Queue status tracking
β β β βββ resilience.py # Circuit breaker, auto-fallback
β β β βββ extractors/ # Pluggable extraction backends
β β β βββ base.py # DocumentExtractor interface
β β β βββ content_understanding.py
β β β βββ document_intelligence.py
β β βββ agents/ # AI agents
β β β βββ scoring_agent.py # Criteria extraction + proposal scoring
β β β βββ comparison_agent.py # Multi-vendor comparison
β β β βββ pipelines.py # High-level async pipeline functions
β β βββ jobs/ # Background job tracking
β β β βββ job_registry.py # In-process registry
β β β βββ job_store.py # Blob-backed persistence
β β β βββ diagnostics_server.py # /diag/* endpoints + dashboard
β β βββ reporting/ # Output generation
β β βββ report_generator.py # Word/CSV/JSON reports
β βββ tests/ # Unit tests (323 tests)
β βββ ui/
β βββ step1_upload.py # Upload with file type awareness
β βββ step2_extract.py # Extraction with file categorization
β βββ step3_criteria.py # Criteria review with confidence display
β βββ step4_score.py # Scoring with confidence and re-reasoning progress
βββ 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)
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.
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
The application supports multiple Azure OpenAI models:
- GPT-5.2: Latest model with best performance (default)
- GPT-4.1: Strong performance, widely available
- GPT-4.1-mini: Cost-effective for simpler tasks
- Upload your RFP document (PDF, DOCX, TXT, or MD)
- Upload one or more vendor proposal documents
- Each document will show a preview and file size
- File format info shows which files use AI extraction vs direct reading
- Protected (encrypted/IRM) documents are detected early with a clear error message
- Select your preferred extraction service
- Click "Extract All Documents"
- Wait for processing (progress shown for each document)
- Review extracted content in the expandable sections
- Click "Extract Criteria" to analyze the RFP
- The AI will identify evaluation criteria and assign weights with confidence scores
- Low-confidence criteria are automatically re-analyzed for improved accuracy
- Review the extracted criteria, weights, and confidence levels
- Confirm or adjust before proceeding to scoring
- Click "Score Proposals" to begin AI evaluation
- The system will:
- Score each vendor against the criteria with confidence scoring
- Automatically re-reason on low-confidence scores
- Generate a comparative ranking
- Review results in the tabbed interface:
- Summary: Overall rankings and recommendations
- Individual Reports: Detailed scores per vendor
- Comparison Matrix: Side-by-side criterion comparison
Download results in your preferred format:
- CSV: For spreadsheet analysis
- Word: For formal reporting
- JSON: For integration with other systems
cd app
uv run pytest# Format code
uv run ruff format .
# Lint code
uv run ruff check .cd app
uv run streamlit run main.py --server.runOnSave true| 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 and DOCX extraction |
plotly |
Interactive charts |
pypdf |
PDF protection/encryption detection |
msoffcrypto-tool |
DOCX encryption and IRM protection detection |
opentelemetry-* |
Distributed tracing and observability |
azure-monitor-opentelemetry |
Azure Monitor integration |
- Managed Identity: Azure resources use managed identity for secure, keyless authentication
- No Stored Credentials: Application uses
DefaultAzureCredentialfor flexible authentication - Network Security: Container Apps can be configured with private endpoints
- RBAC: Fine-grained role-based access control for Azure resources
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Azure AI Services for powerful AI capabilities
- Streamlit for the intuitive web framework
- Microsoft Agent Framework for multi-agent orchestration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: docs/
Built with β€οΈ using Azure AI Services