Documentation Index
Fetch the complete documentation index at: https://tonic-ai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Analytics feature provides comprehensive portfolio analytics, dashboard insights, and reporting capabilities for monitoring credit portfolio performance, risk metrics, and operational statistics. Code Reference:app/api/routes.py (analytics endpoints), client/src/components/Dashboard.tsx
Key Features
Portfolio Analytics
- Portfolio Overview: Complete portfolio statistics
- Risk Metrics: Credit risk metrics and indicators
- Performance Tracking: Track portfolio performance over time
- Trend Analysis: Analyze trends and patterns
app/api/routes.py (get_portfolio_analytics endpoint)
Dashboard Analytics
- Dashboard Statistics: Key metrics for dashboard display
- Activity Summary: User activity and system usage
- Document Statistics: Document processing statistics
- Policy Statistics: Policy decision statistics
app/api/routes.py (get_dashboard_analytics endpoint)
Reporting
- Custom Reports: Generate custom analytics reports
- Export Functionality: Export analytics data
- Visualization: Data visualization and charts
- Scheduled Reports: Schedule automatic report generation
Analytics Metrics
Portfolio Metrics
- Total Portfolio Value: Sum of all loan commitments
- Active Loans: Number of active loans
- Default Rate: Percentage of loans in default
- Average Interest Rate: Average interest rate across portfolio
- Geographic Distribution: Loan distribution by geography
Risk Metrics
- Credit Risk Score: Overall portfolio credit risk
- Concentration Risk: Sector and geographic concentration
- Policy Violations: Number of policy violations
- Breach Count: Number of compliance breaches
- Recovery Rate: Loan recovery success rate
Operational Metrics
- Document Processing: Documents processed per period
- Extraction Accuracy: Extraction accuracy metrics
- Policy Decisions: Policy decision statistics
- User Activity: User activity and engagement
Agent Workflow Metrics
- LangAlpha Analyses: Number of quantitative analyses performed
- DeepResearch Queries: Number of research queries executed
- PeopleHub Profiles: Number of business intelligence profiles generated
- Workflow Success Rate: Percentage of successful workflow completions
- Average Processing Time: Average time to complete workflows
- Tool Usage Statistics: Usage statistics for agent tools (market data, web search, Python REPL, etc.)
app/services/quantitative_analysis_service.py, app/services/deep_research_service.py, app/services/digitizer_chatbot_service.py
API Endpoints
Get Portfolio Analytics
Get comprehensive portfolio analytics. Response: Portfolio statistics, risk metrics, and performance data Code Reference:app/api/routes.py (get_portfolio_analytics endpoint)
Get Dashboard Analytics
Get dashboard statistics and key metrics. Response: Dashboard statistics including activity, documents, and policy decisions Code Reference:app/api/routes.py (get_dashboard_analytics endpoint)
User Interface
Dashboard
Location:client/src/components/Dashboard.tsx
Features:
- Portfolio Overview: Key portfolio metrics
- Activity Summary: Recent activity summary
- Document Statistics: Document processing stats
- Policy Statistics: Policy decision summary
- Quick Actions: Quick access to common actions
Best Practices
- Regular Monitoring: Monitor analytics regularly
- Trend Analysis: Analyze trends over time
- Risk Assessment: Use analytics for risk assessment
- Performance Tracking: Track portfolio performance
- Report Generation: Generate regular reports
Agent Workflow Integration
Agent Dashboard Analytics
The Agent Dashboard provides comprehensive analytics for all agent workflows:- Unified Statistics: Overview of all agent results (LangAlpha, DeepResearch, PeopleHub)
- Usage Analytics: Track agent usage by type, user, and time period
- Performance Metrics: Average processing time, success rates, error rates
- Result Statistics: Number of analyses, research queries, and profiles generated
client/src/apps/agent-dashboard/AgentDashboard.tsx
Agent Results in Analytics
Agent workflow results are automatically integrated into analytics:- Deal Analytics: Agent results linked to deals appear in deal analytics
- Portfolio Analytics: Quantitative analyses contribute to portfolio risk metrics
- Research Analytics: DeepResearch queries tracked in research analytics
- Business Intelligence: PeopleHub profiles included in credit risk assessments
Report Generation
Agent workflows automatically generate reports that are:- Included in Analytics: Report statistics tracked in analytics dashboards
- Exportable: Reports can be exported and included in analytics exports
- Auditable: All agent operations logged for audit compliance
app/services/agent_report_service.py, app/services/report_formatter.py
Additional Resources
- Agent Workflows Feature - Complete agent workflow documentation
- Agent Dashboard - Unified dashboard for agent results
- Audit Reports Feature - Audit report generation
- Configuration Guide - Analytics configuration
Last Updated: 2025-01-14
Code Reference:
app/api/routes.py, client/src/components/Dashboard.tsx, client/src/apps/agent-dashboard/AgentDashboard.tsx