Finance Assistant
AI-powered financial analysis assistant providing natural language queries, expense insights, cash flow predictions, and anomaly detection.
Features
- Financial Analysis - AI-driven analysis of financial data and trends
- Expense Insights - Intelligent categorization and analysis of expenses
- Cash Flow Predictions - Predictive modeling for cash flow management
- Anomaly Detection - Automatic detection of unusual transactions or patterns
- Natural Language Queries - Query financial data using conversational language
Requirements
| Requirement | Details |
|---|---|
| Dependencies | AICore |
| PHP Version | 8.2+ |
| AI Provider | At least one AI provider configured in AI Core |
| Recommended | AccountingCore, Expense modules for full functionality |
Installation
- Ensure AI Core module is installed and enabled
- Enable the Finance Assistant module in Settings > Modules
- Configure data access and anomaly detection thresholds
Configuration
Navigate to Settings > AI Core > Finance Assistant to configure:
- Data Access - Configure which financial data the assistant can access
- Anomaly Sensitivity - Set sensitivity levels for anomaly detection
- Prediction Models - Configure cash flow prediction parameters
- Alert Recipients - Set up alerts for detected anomalies
Usage
Natural Language Queries
Ask questions in plain language:
- "What were our top expenses last month?"
- "Compare Q3 revenue to Q2"
- "Show me unusual transactions this week"
- "What's our projected cash position in 30 days?"
Programmatic Access
use Modules\FinanceAssistant\Services\FinanceAssistantService;
$assistant = app(FinanceAssistantService::class);
// Natural language query
$response = $assistant->query([
'question' => 'What were our top 5 expense categories last quarter?',
]);
// Expense analysis
$analysis = $assistant->analyzeExpenses([
'period' => 'last_month',
'group_by' => 'category',
'include_trends' => true,
]);
// Cash flow prediction
$prediction = $assistant->predictCashFlow([
'horizon' => '90_days',
'include_scenarios' => true,
]);
Anomaly Detection
$anomalies = $assistant->detectAnomalies([
'period' => 'last_30_days',
'sensitivity' => 'medium',
'categories' => ['expenses', 'revenue'],
]);
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/finance-assistant/query | Natural language query |
| POST | /api/v1/finance-assistant/analyze | Analyze financial data |
| POST | /api/v1/finance-assistant/predict | Cash flow prediction |
| GET | /api/v1/finance-assistant/anomalies | Get detected anomalies |
Analysis Capabilities
| Capability | Description |
|---|---|
| Expense Breakdown | Categorize and analyze spending patterns |
| Revenue Analysis | Identify revenue trends and anomalies |
| Cash Flow Modeling | Predict future cash positions |
| Budget Variance | Analyze actual vs. budgeted amounts |
| Vendor Analysis | Insights on vendor spending patterns |
Notes
- All financial queries respect user permissions
- Anomaly alerts can be sent via email or notification
- Predictions include confidence intervals
- Historical data improves prediction accuracy
- Supports multiple currencies and fiscal calendars