HxAnalytics is Velaris's native business intelligence layer — a semantic BI surface that lets operations managers, process owners, and executives explore case data in natural language, drill into trends, track SLA performance, and export for external analysis. It replaces the need for a separate BI tool for the majority of operational reporting use cases, and it operates entirely within your access group boundaries.
HxAnalytics is accessible from Studio > HxAnalytics (/hxanalytics) and provides a multi-tab dashboard combining pre-built KPI cards, a natural-language query interface powered by HxNexus, a pivot-table breakdowns view, an SLA performance report, and a data export API. All views are scoped to the authenticated user's access group — an agent-level user sees their group's cases; an administrator with platform-wide access sees aggregate data across all groups.
The analytics engine runs directly against your PostgreSQL 16 database. There is no separate OLAP store — queries execute against the live case_instances, case_event_log, case_instance_variables, and case_sla_instances tables using optimised indexed reads. For heavy historical exports (millions of rows), HxSync pipelines should push data to a dedicated warehouse; HxAnalytics is optimised for interactive operational queries rather than petabyte-scale batch jobs.
The HxAnalytics Studio page (/hxanalytics) is organised into five tabs. Each tab shares a common Date Range selector (default: last 30 days) and Case Type Filter (default: all visible types).
| Tab | Contents | Primary Audience |
|---|---|---|
| Overview | KPI cards: Total Cases, Open Cases, Cases Closed (period), Avg Resolution Time, SLA Breach Rate, Top Case Type by Volume. Sparkline trends under each card. Configurable card order per user. | Managers, Executives |
| Ask HxNexus | Full-page natural language query interface. Type any operational question; HxNexus generates scoped SQL, retrieves data, and returns a prose answer with optional chart or table. Session history persists for the tab lifetime. | Analysts, Managers |
| Breakdowns | Interactive pivot table. Row: Case Type or Stage. Column: Time Period (day/week/month), Assignee Group, or Status. Cell value: Count, Avg Duration, or SLA Breach %. Drill-down by clicking any cell to see the underlying case list. | Operations Analysts |
| SLA Report | Per-stage SLA attainment gauge, breach count, MTTR (mean time to resolve per stage), top breached case types ranked by severity. Time-series chart of daily breach rate. Exportable as PDF. | Process Owners, QA |
| Export | Configure and trigger data exports. Choose format (CSV or JSON), date range, case type filter, and fields. Generates a download link or pushes to a HxSync pipeline. Audit-logged. | Data Engineers, Compliance |
When you type a question in the Ask HxNexus tab, the following pipeline runs:
Query received by case-service (through the gateway on :8200): The question is submitted to the HxNexus query endpoint with the user's JWT, which carries their access group membership and role.
Intent classification: HxNexus classifies the query as an analytics intent (aggregate, trend, SLA, comparison) rather than a case-lookup or graph-query intent, triggering the analytics retrieval path.
Scoped SQL generation: The AI generates a PostgreSQL query parameterised for the user's access group. The generated SQL is never executed directly — it is sanitised, the access-group WHERE clause is injected at the ORM layer, and the result set is capped at a configurable row limit (default 10,000 rows) before being returned to the AI model.
Data summarisation: The retrieved rows are serialised and passed to the AI model as context. The AI generates a prose answer, optional formatted table, and 3 suggested follow-up questions. For queries returning aggregations, the AI may also suggest a chart type (bar, line, pie) — the frontend renders it using the embedded Chart.js library.
Response delivered: The structured response is rendered in the Ask HxNexus tab with the answer, any chart, a collapsible "Sources" section listing the case IDs or aggregate keys used, and follow-up suggestion chips.
HxAnalytics requires no special configuration beyond what Velaris already needs to run. Access group scoping is automatic — it inherits from the authenticated user's JWT claims. The only prerequisites are:
ANTHROPIC_API_KEY set for case-service — required for Ask HxNexus tab. The Overview, Breakdowns, SLA Report, and Export tabs function without it.case_instances, case_event_log, case_instance_variables, case_sla_instances tables present and accessible to the case-service user.ANALYTICS_DB_URL on the case-service to point to it.
| Variable | Default | Description |
|---|---|---|
ANALYTICS_DB_URL |
Falls back to DATABASE_URL |
Point to a PostgreSQL read replica to offload analytics queries from the primary. Same schema required. |
ANALYTICS_ROW_LIMIT |
10000 |
Maximum rows returned by any single analytics query before HxNexus summarises. Increase for data-dense exports; decrease for constrained environments. |
ANALYTICS_EXPORT_MAX_ROWS |
500000 |
Maximum rows for a single CSV/JSON export via the Export tab or API. Larger datasets should use HxSync to push to a warehouse. |
ANALYTICS_CACHE_TTL |
60 |
Seconds to cache repeated identical analytics queries (same user, same question). Reduces DB load for dashboards refreshed on a timer. |
The Export API lets you programmatically pull case data for integration with external BI tools, compliance archives, or data warehouses. All requests require a valid Bearer JWT. Exports are audit-logged.
| Parameter | Type | Required | Description |
|---|---|---|---|
format |
string | Yes | csv or json. CSV uses RFC 4180 encoding with a header row. JSON returns a newline-delimited JSON stream for large datasets. |
from |
ISO 8601 date | Yes | Start of date range (inclusive). Based on cases.created_at. Example: 2026-01-01 |
to |
ISO 8601 date | Yes | End of date range (inclusive). Example: 2026-03-31 |
case_type |
string | No | Filter to a specific case type slug (e.g., mortgage-application). Omit for all visible types. |
fields |
comma-separated | No | Specific case fields to include in addition to standard columns. Example: applicant_name,loan_amount,credit_score |
include_events |
boolean | No | If true, exports the case_events log for each case (significantly increases output size). Default: false |
# Export all Mortgage Application cases for Q1 2026 as CSV curl -s \ -H "Authorization: Bearer <JWT_TOKEN>" \ "http://localhost:8200/api/v1/analytics/export?format=csv&from=2026-01-01&to=2026-03-31&case_type=mortgage-application&fields=applicant_name,loan_amount,credit_score" \ --output mortgage-q1-2026.csv # Export all cases as newline-delimited JSON with full event log curl -s \ -H "Authorization: Bearer <JWT_TOKEN>" \ "http://localhost:8200/api/v1/analytics/export?format=json&from=2026-04-01&to=2026-04-30&include_events=true" \ --output april-cases.ndjson
ANALYTICS_EXPORT_MAX_ROWS, the response is truncated and a X-Export-Truncated: true header is set. Configure a HxSync pipeline to BigQuery or S3 for untruncated bulk exports.