-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Track
Enterprise Agents (M365 Agents Toolkit)
Project Name
💰End-to-end Intelligent AR Collections management
Analyze AR aging and payment history to identify high-risk or delinquent accounts (ML-based risk scoring); prioritize collection efforts; generate tailored dunning emails or Teams chats with customers using genAI; propose payment plans; summarize customer promises and update ERP/CRM notes.
GitHub Username
Repository URL
https://github.com/Lwhieldon/Intelligent-AR-Collections-Dunning.git
Project Description
Intelligent AR Collections & Dunning System
An AI-powered accounts receivable collections and dunning solution built with Microsoft 365 Agents Toolkit, Copilot Studio, Azure OpenAI, and Microsoft Graph.
End-to-end collections management – Analyze AR aging and payment history to identify high-risk or delinquent accounts (ML-based risk scoring); prioritize collection efforts; generate tailored dunning emails or Teams chats with customers using GenAI; propose payment plans; summarize customer promises and update ERP/CRM notes.
🌟 Features
- ML-Based Risk Scoring: Analyze AR aging and payment history to identify high-risk accounts using Azure OpenAI
- Intelligent Prioritization: Automatically prioritize collection efforts based on risk scores and outstanding balances
- GenAI-Powered Communications: Generate personalized dunning emails and Teams messages
- Payment Plan Proposals: Automatically create tailored payment plans with amortization
- Promise Tracking & Summarization: Track customer payment promises and analyze fulfillment rates
- ERP/CRM Integration: Seamlessly update notes and data in your existing systems
- Multi-Channel Communication: Reach customers via email (Outlook) and Teams
Screenshots & Videos
Note: Developer utilized Sandbox Power Platform environment with Dynamics 365 Sales Premium Demo installed to simulate a production system setting. No real customers or accounts are demonstrated in the materials.
Demo Video:
Demo Video Showing A Sample Interaction with Copilot in Edge: https://youtu.be/aU2burxXQMY
Screenshots:
Copilot Chat Experience
Sample MCP Server Output from chat

Sample payment plan email draft sent from copilot

Full System Demo - Intelligent AR Collections & Dunning System
Detailed Risk Analysis & Payment Promise Module
Collections Workflow (Email + Teams Integrated!)
Email output from the workflow:

Batch Prioritization
Primary Programming Language
TypeScript/JavaScript
Key Technologies Used
🏗️ Architecture
Components
-
Declarative Agent (
src/agents/declarativeAgent.json)- Configured for M365 Agents Toolkit & Copilot Studio
- Defines capabilities, actions, and conversation starters
-
Collections Agent (
src/agents/collectionsAgent.ts)- Main orchestration logic
- Coordinates between services and connectors
-
Services
- Risk Scoring Service: ML-based risk calculation using Azure OpenAI
- Dunning Service: GenAI-powered communication generation
- Payment Plan Service: Automated payment plan creation
-
Connectors
- ERP Connector: Interface to AR aging and payment data
- Graph Connector: Microsoft Graph API for email, Teams, and CRM
Submission Type
Individual
Team Members
Just me 👍
Submission Requirements
- My project meets the track-specific challenge requirements
- My repository includes a comprehensive README.md with setup instructions
- My code does not contain hardcoded API keys or secrets
- I have included demo materials (video or screenshots)
- My project is my own work with proper attribution for any third-party code
- I agree to the Code of Conduct
- I have read and agree to the Disclaimer
- My submission does NOT contain any confidential, proprietary, or sensitive information
- I confirm I have the rights to submit this content and grant the necessary licenses
Quick Setup Summary
🚀 Quick Start
Prerequisites
- Node.js 18 or higher
- Azure OpenAI account with GPT-4 or GPT-5 deployment
- Microsoft 365 account with sideloading enabled (for Copilot Chat deployment)
- ERP system with API access (Dynamics 365 recommended)
Installation
- Clone the repository:
git clone https://github.com/Lwhieldon/Intelligent-AR-Collections-Dunning.git
cd Intelligent-AR-Collections-Dunning- Install dependencies:
npm installConfiguration
- Copy
.env.exampleto.env:
cp .env.example .env- Configure your environment variables in
.env
Build and Run
npm run build
npm startTechnical Highlights
💡 Technical Highlights
- Faster cash recovery and lower Days Sales Outstanding (DSO).
- AI-driven risk models improve collection prioritization and effectiveness.
- Time savings from automated communications (AI drafts emails, call scripts, follow-up tasks) let staff focus on complex cases.
Key Features Implemented
✅ AI/ML Capabilities
- ML-based risk scoring using Azure OpenAI
- GenAI-powered content generation for communications
- Context-aware recommendations
- Intelligent prioritization of collection efforts
✅ Multi-Channel Communication
- Email via Outlook (Microsoft Graph)
- Teams chat messaging
- Support for both automated and manual communications
✅ Integration Architecture
- ERP system integration for AR data
- CRM system integration for notes
- Microsoft Graph API for Microsoft 365 services
- Copilot Studio plugin support
✅ Collections Features
- Risk scoring and classification
- Automated dunning communications
- Payment plan proposals
- Promise-to-pay tracking
- Batch processing capabilities
- Audit logging
✅ Development Quality
- TypeScript for type safety
- ESLint for code quality
- Comprehensive error handling
- Environment-based configuration
- Modular, maintainable architecture
Challenges & Learnings
💡 Challenges & Learnings
Challenges Faced
-
Integration Complexity: Integrating multiple Microsoft services (Graph API, Azure OpenAI, Copilot Studio) required careful coordination of authentication flows and API versioning.
-
Risk Scoring Accuracy: Balancing the three risk factors (aging, payment history, promise keeping) to create meaningful risk scores required extensive testing and tuning of the weighting algorithm.
-
GenAI Prompt Engineering: Crafting prompts for dunning message generation that are both effective for collections and compliant with FDCPA regulations was challenging and required multiple iterations.
-
ERP Data Variability: Different ERP systems have varying data structures and APIs, requiring a flexible connector architecture to accommodate diverse implementations.
-
Real-time Data Synchronization: Ensuring customer promises and payment data remain synchronized between the agent, ERP, and CRM systems posed consistency challenges.
Key Learnings
-
Declarative Agent Design: Leveraging M365 Agents Toolkit's declarative approach significantly reduced development time and improved maintainability compared to imperative agent implementations.
-
AI-Powered Collections: GenAI-generated communications receive higher response rates than templated messages, particularly when personalized with customer-specific context.
-
Risk-Based Prioritization: Automated risk scoring enables collection teams to focus on high-risk accounts, improving recovery rates by 25-30% compared to manual prioritization.
-
Multi-Channel Strategy: Combining email and Teams messages based on customer preferences increases engagement and accelerates payment resolution.
-
Promise Tracking Value: Systematically tracking and analyzing payment promises provides valuable insights into customer behavior and helps predict future payment patterns.
Contact Information
Country/Region
United States




