A production-ready AI-powered tender recommendation system built on Microsoft Azure, designed to match companies with relevant government tenders using advanced vector search and GPT-4 analysis.
- Sameer Ankalgi - AI Engineer - MSFT
- Hao Zhang - AI Engineer - MSFT
- Naya Giannakopoulou - Lead Architect - MSFT_InnoLabs
The Tender AI application follows a modern, cloud-native architecture pattern leveraging Azure's AI and data services for intelligent tender matching:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Azure Cloud Platform β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββ βββββββββββββββββββ β
β β Azure Container β β Azure OpenAI β β
β β Apps βββββΊβ (GPT-4o + β β
β β (Streamlit) β β text-embed-3) β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββ βββββββββββββββββββ β
β β Azure Cosmos β β EU TED API β β
β β DB (Vector DB) β β (Tender Source) β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β Support Services β β
β β β’ Azure Key Vault (Secrets) β β
β β β’ Azure Container Registry (Images) β β
β β β’ Application Insights (Monitoring) β β
β β β’ Azure Monitor (Logging) β β
β βββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- π Azure Container Apps: Serverless container hosting with auto-scaling
- π§ Azure OpenAI: GPT-4o for intelligent analysis and text-embedding-3-small for vector embeddings
- π Azure Cosmos DB: Vector-enabled NoSQL database for tender and company data with similarity search
- π Azure Key Vault: Secure secrets and API key management
- π¦ Azure Container Registry: Secure container image storage and distribution
- π Application Insights: End-to-end observability and performance monitoring
- π Azure Monitor: Centralized logging, metrics, and alerting
- π EU Tender Discovery: Direct integration with official EU TED API for real-time tender data
- π’ Company Profile Management: Structured company data with vector embeddings in Cosmos DB
- π‘ Intelligent Matching: Vector similarity search powered by Azure OpenAI embeddings
- π Production Monitoring: Real-time metrics, distributed tracing, and performance insights
- π Enterprise Security: Managed identities, RBAC, and Key Vault integration
- β‘ Auto-scaling: Container Apps with automatic resource optimization based on demand
- π Multi-region Support: Deployable across Azure regions with geo-redundancy options
- Azure CLI (
az) version 2.60+ - Azure Developer CLI (
azd) version 1.16+ - Docker (optional - Azure can build images in the cloud)
- Azure subscription with appropriate permissions for:
- Resource group creation
- Azure OpenAI service deployment
- Cosmos DB provisioning
- Container Apps environment setup
git clone https://github.com/heisenberg-alt/tender-engine.git
cd tender-engine
azd initCopy the environment template and fill in your Azure credentials:
cp .env.example .envEdit .env with your Azure configuration:
# Azure Configuration
AZURE_OPENAI_ENDPOINT=https://your-openai-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your_azure_openai_key
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME=text-embedding-3-small
# Cosmos DB Configuration
COSMOS_DB_ENDPOINT=https://your-cosmos-account.documents.azure.com:443/
COSMOS_DB_KEY=your_cosmos_db_key
COSMOS_DB_DATABASE_NAME=tender-recommender
# EU TED API (provided for development)
EU_TED_API_KEY=your_eu_ted_api_key_hereazd upThis command will:
- ποΈ Create all Azure resources using Bicep templates
- π¦ Build and deploy the container image to Azure Container Registry
- βοΈ Configure environment variables and secrets in Key Vault
- π Set up monitoring and logging with Application Insights
- π Deploy the application to Azure Container Apps
During deployment, you'll be prompted for:
- Environment Name: Unique identifier for your deployment (e.g.,
tender-prod) - Azure Region: Choose your preferred region (e.g.,
eastus,westeurope) - Azure Subscription: Select your target subscription
The infrastructure is defined using Bicep templates in the infra/ directory:
infra/
βββ main.bicep # Main orchestration template
βββ resources.bicep # Azure resources definitions
βββ main.parameters.json # Environment-specific parameters
- π Vector Search: Cosmos DB configured with vector indexing for similarity search
- π Security: Managed identities, Key Vault integration, and RBAC permissions
- π Observability: Application Insights with automatic instrumentation and custom metrics
- π Networking: Container Apps with CORS configuration and health checks
- π Scalability: Auto-scaling based on CPU, memory, and HTTP request metrics
- π·οΈ Resource Tagging: Consistent tagging for cost management and governance
tender-engine/
βββ app.py # Streamlit application entrypoint
βββ azure.yaml # Azure Developer CLI configuration
βββ Dockerfile # Container image definition
βββ requirements.txt # Python dependencies (Azure-focused)
βββ .env.example # Environment variables template
βββ agents/
β βββ company_agent.py # Company profile management
β βββ tender_agent.py # EU TED API integration & tender processing
βββ llm/
β βββ azure_recommender_llm.py # Azure OpenAI integration
βββ utils/
β βββ config.py # Configuration management
β βββ tender_crawler.py # EU TED API crawler with Swiss support
βββ vectorstore/
β βββ cosmos_vector_store.py # Azure Cosmos DB vector operations
βββ infra/ # Bicep infrastructure templates
β βββ main.bicep
β βββ resources.bicep
β βββ main.parameters.json
βββ data/
βββ raw_tenders/ # Local tender data storage
- Direct API Integration: Connects to official EU TED API for real-time tender data
- Structured Processing: Extracts and normalizes tender information (title, description, CPV codes, deadlines)
- Vector Embedding: Uses Azure OpenAI text-embedding-3-small to create semantic embeddings
- Cosmos DB Storage: Stores tender data with vector indexes for similarity search
- Profile Creation: Companies input expertise areas, certifications, and capabilities
- Semantic Analysis: Azure OpenAI analyzes company descriptions and generates embeddings
- Vector Storage: Company profiles stored in Cosmos DB with searchable vector representations
# Vector similarity search with Azure OpenAI
embeddings = azure_openai.get_embeddings(company_profile)
similar_tenders = cosmos_db.vector_search(embeddings, similarity_threshold=0.7)
# GPT-4o analysis for detailed recommendations
recommendation = gpt4o.analyze_match(company_profile, tender_data)- Vector Similarity: Fast similarity search using Cosmos DB vector indexes
- AI Analysis: GPT-4o provides detailed match reasoning and recommendations
- Scoring System: Multi-factor scoring based on expertise, location, company size, and past performance
# Build the container
docker build -t tender-engine .
# Run with environment variables
docker run -p 8501:8501 --env-file .env tender-engine# Install dependencies
pip install -r requirements.txt
# Run the Streamlit app
streamlit run app.pyThe application will be available at http://localhost:8501
- π Custom Metrics: Track tender matches, API response times, and user interactions
- π Distributed Tracing: End-to-end request tracking across Azure services
β οΈ Error Monitoring: Automatic error detection and alerting- π Performance Analytics: Real-time performance dashboards
- Tender processing rate
- Company profile creation frequency
- Vector search performance
- OpenAI API usage and costs
- Container resource utilization
- οΏ½ Managed Identity: Passwordless authentication between Azure services
- οΏ½οΈ Key Vault Integration: Secure storage of API keys and connection strings
- π‘οΈ RBAC Permissions: Least-privilege access control
- π Network Security: Private endpoints and secure communication
- π Compliance: GDPR-compliant data handling and retention policies
- Development:
azd env new dev- Single-region, cost-optimized - Staging:
azd env new staging- Production-like with reduced capacity - Production:
azd env new prod- Multi-region, high-availability setup
We welcome contributions! Please:
- 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.
For questions or support:
- π§ Create an issue in this repository
- π Check the ENV_SETUP.md for configuration help
- π Review the EU_TED_INTEGRATION_SUMMARY.md for API details