Intelligence API
AI-powered insights, anomaly detection, trend prediction, benchmarking, project intelligence, and knowledge management.
Intelligence API
ProBeya’s intelligence layer combines statistical analysis, AI-powered predictions, cross-site benchmarking, and organizational knowledge management. All intelligence features enforce multi-tenant isolation and use pure statistical methods where possible (no external AI API calls required for core analytics).
AI Insights (KPI Analytics)
Statistical anomaly detection and trend prediction for KPI time-series data using z-score analysis, moving averages, and linear regression.
Endpoints
GET /api/v1/intelligence/kpi-anomalies
Run anomaly detection on a single KPI’s historical data. Uses both z-score and moving average methods to flag unusual values.
tRPC: aiInsights.detectKpiAnomalies
Auth: Bearer token required (scope: read:items) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
kpiDefinitionId | string | Yes | The KPI definition to analyze |
windowSize | number | No | Rolling window size for calculations (default: 7, range: 2-90) |
stdDevMultiplier | number | No | Z-score threshold multiplier (default: 2.0, range: 0.5-5.0) |
deviationThreshold | number | No | Moving average deviation threshold (default: 0.3, range: 0.05-1.0) |
Response:
{
"anomalies": [
{
"index": 42,
"date": "2026-03-15",
"value": 98.5,
"expected": 72.3,
"deviation": 36.2,
"method": "zscore",
"severity": "high"
}
],
"totalDataPoints": 90,
"anomalyCount": 3
}
GET /api/v1/intelligence/kpi-trend
Run linear regression trend prediction on a KPI to forecast future values.
tRPC: aiInsights.predictKpiTrend
Auth: Bearer token required (scope: read:items) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
kpiDefinitionId | string | Yes | The KPI definition to analyze |
Response:
{
"slope": 0.42,
"intercept": 65.1,
"rSquared": 0.87,
"trend": "improving",
"predictedValues": [
{ "date": "2026-04-15", "value": 78.2 },
{ "date": "2026-04-22", "value": 78.6 }
]
}
GET /api/v1/intelligence/board-insights
Combined anomalies and trend analysis for all KPIs on a board. Returns a comprehensive AI-generated insight report.
tRPC: aiInsights.getInsights
Auth: Bearer token required (scope: read:items) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
boardId | string | Yes | The board to analyze |
AI Project Intelligence
AI-powered project bootstrap templates and schedule prediction. Templates contain pre-built WBS structures, risk registers, and schedule frameworks for rapid project setup.
Endpoints
POST /api/v1/intelligence/bootstrap-templates
Create an industry-specific project template with pre-built WBS, risks, and schedule phases.
tRPC: aiIntelligence.createBootstrapTemplate
Auth: Bearer token required (scope: write:items) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name (e.g., “Pharma Phase III Clinical Trial”) |
industry | string | No | Target industry (e.g., “pharma”, “automotive”) |
projectType | string | No | Project type (e.g., “clinical_trial”, “process_improvement”) |
wbsTemplate | object | No | Pre-built WBS structure with elements array |
riskTemplate | object | No | Pre-built risk register with risk items |
scheduleTemplate | object | No | Pre-built schedule with phases and milestones |
WBS element structure:
{
"elements": [
{
"code": "1.1.2",
"name": "Protocol Development",
"level": 1,
"durationDays": 60,
"dependencies": ["1.1.1"],
"resources": ["Clinical Lead", "Biostatistician"]
}
]
}
GET /api/v1/intelligence/bootstrap-templates
List bootstrap templates with optional industry and project type filters.
tRPC: aiIntelligence.listBootstrapTemplates
tRPC-Only Intelligence Procedures
| Procedure | Type | Description |
|---|---|---|
aiIntelligence.getBootstrapTemplate | query | Full template detail |
aiIntelligence.updateBootstrapTemplate | mutation | Update template content |
aiIntelligence.deleteBootstrapTemplate | mutation | Remove a template |
aiIntelligence.recordScheduleSnapshot | mutation | Record a schedule health snapshot with AI prediction |
aiIntelligence.getScheduleHistory | query | Time-series of schedule health for a project |
Benchmarking
Cross-site KPI comparison for organizations with multiple sites. Enables executive-level comparisons across all level-1 workspaces (physical sites).
Data flow: workspaces (level=1) → projects → boards → kpiDefinitions → kpiValues
Endpoints
GET /api/v1/benchmarking/site
Compare a specific KPI across all sites using averaged values.
tRPC: benchmarking.getSiteBenchmark
Auth: Bearer token required (scope: read:items) or session cookie
Org context: Required
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
kpiName | string | Yes | KPI name to compare across sites |
category | string | No | SQCDP category filter |
dateFrom | string | No | Start date for value aggregation |
dateTo | string | No | End date for value aggregation |
GET /api/v1/benchmarking/category
SQCDP scorecard per site showing a traffic-light matrix (red/amber/green) based on KPI thresholds.
tRPC: benchmarking.getCategoryBenchmark
GET /api/v1/benchmarking/trend
Time-series overlay of a KPI across all sites for trend comparison.
tRPC: benchmarking.getTrendComparison
GET /api/v1/benchmarking/ranking
Rank all sites by a specific KPI from best to worst.
tRPC: benchmarking.getRanking
Knowledge Forge
Internal knowledge base with articles, a knowledge graph of people/assets/processes, and expertise tracking per user per domain.
tRPC-Only Knowledge Forge Procedures
| Procedure | Type | Description |
|---|---|---|
knowledgeForge.create | mutation | Create a knowledge article (draft/published/archived) |
knowledgeForge.list | query | Paginated list with category, status, and search filters |
knowledgeForge.getById | query | Full article detail |
knowledgeForge.update | mutation | Update article content, category, status, tags |
knowledgeForge.delete | mutation | Remove an article |
knowledgeForge.createNode | mutation | Add a node to the knowledge graph (person, asset, process, etc.) |
knowledgeForge.listNodes | query | Browse graph nodes by type |
knowledgeForge.createEdge | mutation | Create a relationship between nodes |
knowledgeForge.listEdges | query | List edges for a node |
knowledgeForge.deleteEdge | mutation | Remove a relationship |
knowledgeForge.upsertExpertise | mutation | Set or update a user’s expertise score for a domain |
knowledgeForge.getExpertiseMatrix | query | Who-knows-what matrix across users and domains |
Node types: person, asset, product, process, problem, procedure
Edge relations: solved_by, applies_to, requires, supersedes, related_to
Article statuses: draft, published, archived
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid input parameters (e.g., threshold out of range) |
| 401 | Missing or invalid authentication |
| 404 | KPI definition, template, article, or node not found |
| 422 | Insufficient data points for statistical analysis |
Was this page helpful?