Production-ready RAG system for Adobe Commerce documentation with IMS authentication, user tier management, and automated deployment.
Local MCP Server → Azure Functions → Azure OpenAI + Azure AI Search
- Azure OpenAI: Embeddings (text-embedding-ada-002) + GPT-4o (index selection & re-ranking)
- Azure AI Search: 3 vector indexes with 1536-dim vectors
- Azure Functions: 3 endpoints (
/api/query,/api/load,/api/sync)/api/query- Search documentation (active)/api/load- Upload documents (active)/api/sync- Daily document sync (disabled - requires Azure Blob Storage setup)
azure-commerce-documentation-agent/
├── src/
│ ├── azure/
│ │ ├── upload-embeddings.js # Embed documents to Azure AI Search
│ │ ├── query-embeddings.js # Query with LLM selection & re-ranking
│ │ └── scripts/
│ │ ├── create-indexes.js # Create 3 AI Search indexes
│ │ ├── embed-azure.js # Embed all documents
│ │ └── query-azure.js # Test query functionality
│ └── loaders/ # Symlink to ../commerce-documentation-service/src/loaders
├── azure-functions/
│ ├── query/ # Query HTTP endpoint
│ │ ├── function.json
│ │ └── index.js
│ └── load/ # Load HTTP endpoint
│ ├── function.json
│ └── index.js
├── scripts/
│ └── azure-setup.sh # Automated Azure infrastructure setup
├── .env.example # Environment template
├── package.json # Dependencies and scripts
└── README.md # This file
# Login to Azure
az login
# Run setup script
chmod +x scripts/azure-setup.sh
./scripts/azure-setup.sh# Copy generated environment file
cp .env.azure .env
# Install dependencies
npm installnpm run create-indexes# Load documents (uses loaders from commerce-documentation-service)
npm run load-docs
# Embed to Azure AI Search (takes 45-90 minutes)
npm run embed-docsTwo query methods available:
# Fast, simple, ~2-3 second response
npm run quick-test "How to create an event?" "commerce-extensibility-docs"
# Test different indexes
npm run quick-test "How to install Adobe Commerce?" "commerce-core-docs"
npm run quick-test "App Builder runtime" "app-builder-docs"# Automatic index selection + LLM re-ranking, ~10-15 second response
npm run query "How to create an event?"Performance Comparison:
- quick-test: 2-3s, $0.001/query, manual index selection
- query: 10-15s, $0.011/query, automatic index selection + re-ranking
See PERFORMANCE_NOTES.md for detailed comparison.
npm run deploycd ../commerce-extensibility-tools
export AZURE_FUNCTIONS_URL=https://commerce-docs-api.azurewebsites.net
npm start| Feature | Status | Description |
|---|---|---|
| IMS Authentication | ✅ Complete | Adobe SSO with user tier management |
| Token Tracking | ✅ Complete | Per-user token usage and monthly quotas |
| Rate Limiting | ✅ Complete | Tier-based limits (1000/100/10 req/min) |
| Infrastructure as Code | ✅ Complete | Bicep templates with automated deployment |
| CI/CD Pipeline | ✅ Complete | GitHub Actions for automated deployment |
| Monitoring | ✅ Complete | Application Insights integration |
| Document Indexing | ⏳ Pending | Awaiting Azure OpenAI approval |
The /api/sync timer function is currently disabled as it requires documents to be stored in Azure Blob Storage.
- Manual document embedding via
npm run embed-docs - Re-run embedding when documentation changes
To enable automatic daily sync:
- Upload documents to Azure Blob Storage
- Update sync function paths to read from Blob Storage
- Uncomment the sync function code in
azure-functions/sync/index.js - Redeploy Azure Functions
See ARCHITECTURE.md for detailed implementation plan.
# Delete all Azure resources
az group delete --name commerce-ai-docs-rg --yes