Skip to content

Project: Enterprise Agents - 💰Intelligent AR Collections & Dunning #20

@Lwhieldon

Description

@Lwhieldon

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

@Lwhieldon

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

image

Sample MCP Server Output from chat
image

Sample payment plan email draft sent from copilot
image

Full System Demo - Intelligent AR Collections & Dunning System

image

Detailed Risk Analysis & Payment Promise Module

image

Collections Workflow (Email + Teams Integrated!)

image

Email output from the workflow:
image

Batch Prioritization

image

Primary Programming Language

TypeScript/JavaScript

Key Technologies Used

🏗️ Architecture

Components

  1. Declarative Agent (src/agents/declarativeAgent.json)

    • Configured for M365 Agents Toolkit & Copilot Studio
    • Defines capabilities, actions, and conversation starters
  2. Collections Agent (src/agents/collectionsAgent.ts)

    • Main orchestration logic
    • Coordinates between services and connectors
  3. Services

    • Risk Scoring Service: ML-based risk calculation using Azure OpenAI
    • Dunning Service: GenAI-powered communication generation
    • Payment Plan Service: Automated payment plan creation
  4. 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

  1. Clone the repository:
git clone https://github.com/Lwhieldon/Intelligent-AR-Collections-Dunning.git
cd Intelligent-AR-Collections-Dunning
  1. Install dependencies:
npm install

Configuration

  1. Copy .env.example to .env:
cp .env.example .env
  1. Configure your environment variables in .env

Build and Run

npm run build
npm start

Technical 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

  1. Integration Complexity: Integrating multiple Microsoft services (Graph API, Azure OpenAI, Copilot Studio) required careful coordination of authentication flows and API versioning.

  2. 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.

  3. 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.

  4. ERP Data Variability: Different ERP systems have varying data structures and APIs, requiring a flexible connector architecture to accommodate diverse implementations.

  5. Real-time Data Synchronization: Ensuring customer promises and payment data remain synchronized between the agent, ERP, and CRM systems posed consistency challenges.

Key Learnings

  1. Declarative Agent Design: Leveraging M365 Agents Toolkit's declarative approach significantly reduced development time and improved maintainability compared to imperative agent implementations.

  2. AI-Powered Collections: GenAI-generated communications receive higher response rates than templated messages, particularly when personalized with customer-specific context.

  3. 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.

  4. Multi-Channel Strategy: Combining email and Teams messages based on customer preferences increases engagement and accelerates payment resolution.

  5. Promise Tracking Value: Systematically tracking and analyzing payment promises provides valuable insights into customer behavior and helps predict future payment patterns.

Contact Information

lwhieldon1@gmail.com

Country/Region

United States

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions