An AI-powered financial dispute resolution system built on Azure, demonstrating Retrieval-Augmented Generation (RAG) and Agentic AI workflows for enterprise compliance use cases.
Sample Dispute Docs (12 policy documents)
↓
Azure Blob Storage (document store)
↓
Chunking + Embedding (Python + text-embedding-3-small)
↓
Azure AI Search (vector index, 52 chunks)
↓
Azure OpenAI GPT-4o (chat completions)
↓
Agentic Workflow (classify → retrieve → validate → respond/escalate)
↓
Streamlit Frontend (demo UI with audit trail)
- Document Chunking: Splits 12 compliance documents into ~500-token overlapping segments
- Vector Embeddings: Azure OpenAI
text-embedding-3-small(1,536 dimensions) - Hybrid Search: Azure AI Search with vector similarity + semantic ranking
- Grounded Responses: GPT-4o generates answers citing specific policy sections
Multi-step AI workflow mimicking a real dispute analyst:
| Step | Agent | Purpose |
|---|---|---|
| 1 | Classify | Categorize dispute type (BILLING, FRAUD, UNAUTH, MERCHANT) and applicable regulation |
| 2 | Retrieve | Pull targeted policy sections based on classification |
| 3 | Validate | Check compliance, PII safety, completeness, and confidence |
| 4 | Respond/Escalate | Generate resolution guidance OR escalate to human review |
Cases are automatically escalated when:
- Classification confidence < 70%
- Compliance validation fails
- Dispute amount exceeds $5,000
- Validation confidence score < 70%
Escalated cases include the full audit trail for human review, maintaining accountability and compliance.
12 internal policy documents covering:
| Document | Content |
|---|---|
| Dispute Resolution Policy | Master policy — categories, regulations, intake, investigation |
| Regulation E Compliance Guide | Debit/EFT disputes — timelines, provisional credit, liability |
| Regulation Z Compliance Guide | Credit card billing errors — chargeback codes, protections |
| Chargeback Processing Procedures | Chargeback lifecycle — reason codes, representment, arbitration |
| Fraud Investigation Procedures | Fraud tiers, indicators, card blocking, SAR filing |
| Billing Dispute Handling Guide | Duplicate charges, wrong amounts, not received, cancelled recurring |
| Merchant Dispute Guidelines | Category-specific rules, high-risk merchants |
| Customer Communication Templates | Acknowledgment, provisional credit, resolution letters |
| Escalation Matrix & SLA Guide | 4-tier escalation, SLA targets, breach consequences |
| Provisional Credit Policy | Eligibility, calculation, reversal rules |
| Evidence Collection Standards | Evidence requirements by dispute type |
| Quality Assurance Checklist | 100-point scoring, regulatory compliance checks |
| Component | Service |
|---|---|
| LLM | Azure OpenAI GPT-4o |
| Embeddings | Azure OpenAI text-embedding-3-small |
| Vector Search | Azure AI Search (free tier) |
| Document Storage | Azure Blob Storage |
| Frontend | Streamlit |
| Language | Python 3.10+ |
- Azure subscription with Azure OpenAI access
- Python 3.10+
- Azure CLI
git clone https://github.com/YOUR_USERNAME/disputeai.git
cd disputeaipython3 -m venv venv
source venv/bin/activate # Mac/Linux
# venv\Scripts\activate # Windows
pip install -r requirements.txt# Create resource group
az group create --name rg-disputeai --location eastus2
# Create storage account
az storage account create --name stadisputeai --resource-group rg-disputeai --location eastus2 --sku Standard_LRS
az storage container create --name dispute-documents --account-name stadisputeai
# Create AI Search (free tier)
az search service create --name search-disputeai --resource-group rg-disputeai --location eastus2 --sku free
# Create OpenAI resource
az cognitiveservices account create --name openai-disputeai --resource-group rg-disputeai --location eastus2 --kind AIServices --sku S0
# Deploy models
az cognitiveservices account deployment create --name openai-disputeai --resource-group rg-disputeai --deployment-name embedding-small --model-name text-embedding-3-small --model-version "1" --model-format OpenAI --sku-name GlobalStandard --sku-capacity 10
az cognitiveservices account deployment create --name openai-disputeai --resource-group rg-disputeai --deployment-name gpt-4o --model-name gpt-4o --model-version "2024-11-20" --model-format OpenAI --sku-name GlobalStandard --sku-capacity 10Create a .env file:
AZURE_OPENAI_ENDPOINT=https://openai-disputeai.cognitiveservices.azure.com/
AZURE_OPENAI_API_KEY=your-key-here
AZURE_OPENAI_EMBEDDING_DEPLOYMENT=embedding-small
AZURE_OPENAI_CHAT_DEPLOYMENT=gpt-4o
AZURE_OPENAI_API_VERSION=2024-10-21
AZURE_SEARCH_ENDPOINT=https://search-disputeai.search.windows.net
AZURE_SEARCH_API_KEY=your-key-here
AZURE_SEARCH_INDEX_NAME=dispute-knowledge-base
AZURE_STORAGE_CONNECTION_STRING=your-connection-string-here
AZURE_STORAGE_CONTAINER=dispute-documents
python3 index_documents.py --source localpython3 test_search.pystreamlit run app.pyTry these in the chat interface:
- "Customer says they were charged twice for the same Netflix subscription of $15.99"
- "Customer's debit card was stolen. They see 3 unauthorized transactions totaling $2,300"
- "Customer cancelled gym membership 2 months ago but is still being charged $49.99 monthly"
- "Customer ordered a laptop for $1,299 — tracking shows delivered but they never received it"
- "Customer's credit card was used for a $15,000 wire transfer they don't recognize" (triggers escalation)
disputeai/
├── documents/ # 12 policy documents (knowledge base)
├── index_documents.py # Document chunking, embedding, indexing pipeline
├── test_search.py # Search index verification
├── rag_engine.py # RAG query engine + agentic workflow
├── app.py # Streamlit demo UI
├── requirements.txt # Python dependencies
├── .env # Azure credentials (not in repo)
└── .gitignore
Raj Kumar Manala
This project is for educational and demonstration purposes.