CrewAI Dashboard Analyzer

← Back to Admin 💬 Chat with Loan Manager View Dashboard
✗ CrewAI API Unavailable Start the Python service: python crewai_api.py
Analyze Dashboard Data
Analyze Specific File
How to Use
  1. Ensure Python 3.10+ is installed
  2. Install dependencies: pip install -r requirements.txt
  3. Set up your API key in .env file (copy from .env.example)
  4. Start the CrewAI API service: python crewai_api.py
  5. Use this interface to trigger analyses

Note: The analysis may take 30-60 seconds depending on the data size and API response time.

💬 Chat with Loan Projection Manager

The Loan Projection Manager is an AI agent that can help you with loan portfolio management, financial forecasting, and data analysis. It has full read and write access to all JSON files in the data folder.

What the Agent Can Do:
  • Read Data: Access all JSON files in the data folder (loan-graph.json, aging-data.json, dashboard-metrics.json, etc.)
  • Write/Update Data: Modify any JSON file in the data folder with proper structure
  • Calculate Projections: Generate loan projections based on growth rates and time periods
  • Analyze Metrics: Provide insights on ROI, collection rates, and financial performance
  • Provide Recommendations: Suggest strategies to optimize loan portfolio
Example Questions You Can Ask:
Data Analysis:
  • "What are the current loan projections for the next 6 months?"
  • "Analyze the collection rates and identify any concerns"
  • "What is the ROI forecast based on current data?"
  • "Show me insights from the aging analysis"
Fund Distribution & Projection Dashboards:
  • "Distribute $12 million across 14 existing licensees"
  • "Create 5 new licensees and distribute $8 million equally among them"
  • "Distribute $15 million proportionally based on current lending funds"
  • "Create a projection dashboard with $10 million distributed over 10 licensees"
Data Updates:
  • "Update the dashboard metrics with new ROI of 35%"
  • "Increase the available balance in dashboard-metrics.json to $50,000"
  • "Update the loan graph data with new collection amounts"
  • "Modify the aging data for 0-30 days category"
Projections & Calculations:
  • "Calculate projections for $100,000 at 5% growth over 12 months"
  • "What would be the projected income if collection rate improves by 10%?"
  • "Generate a 6-month forecast based on current loan data"
File Operations:
  • "List all available data files"
  • "Read the contents of licensee-income.json"
  • "Update dashboard-metrics.json with new territory data"
  • "Create a backup of the current loan-graph.json structure"
Backend Instructions for the Agent:

Primary Purpose - Projection Dashboard Creation:

This is a Projection Loan Dashboard system. You create views that potential buyers will see. When asked to distribute funds (e.g., "$12 million over 14 licensees"), you should:

  1. Check existing licensees - Read licensee-income.json to see current licensees
  2. Create new licensees if needed - Use create_new_licensees tool if more licensees are required
  3. Distribute funds - Use distribute_funds_to_licensees to create a distribution plan
  4. Apply distribution - Use apply_fund_distribution to update licensee-income.json
  5. Update dashboard metrics - Update dashboard-metrics.json with total investment and recalculated ROI
  6. Update loan graph - Recalculate loan-graph.json based on new fund distribution
  7. Update aging data - Adjust aging-data.json if needed for the projection

Data File Structure:

  • All data files are in the data/ folder
  • Main files: dashboard-metrics.json, loan-graph.json, aging-data.json, licensee-income.json
  • Licensee-specific files: lic-{id}-metrics.json, lic-{id}-loan-graph.json, etc.
  • licensee-income.json contains array of licensees with: licenseeId, licenseeName, transactionalFee, monthlyAmount, licenseeFee, lendingFundsReceived, totalIncome

Fund Distribution Guidelines:

  • Equal distribution: Divide total amount equally among all selected licensees
  • Proportional distribution: Distribute based on current lendingFundsReceived amounts
  • When creating new licensees, assign sequential IDs starting from highest existing ID + 1
  • After distributing funds, recalculate totalIncome for each licensee
  • Update dashboard-metrics.json investment amount to match total distribution

When Writing Data:

  • Always maintain the existing JSON structure
  • Include all required fields (don't remove fields, only update values)
  • Preserve the meta section with updatedAt timestamp in ISO 8601 format
  • Use proper number formatting (no currency symbols in JSON, just numbers)
  • Validate JSON structure before writing

File Permissions:

  • You have FULL WRITE ACCESS to all JSON files in the data folder
  • You can create, read, update, and modify any JSON file
  • You can create new licensees and distribute funds across them
  • Always validate before making major changes