HxNexus is Velaris's built-in AI assistant — a natural-language interface to live case data, process knowledge, and the HxGraph semantic graph. Powered by a pluggable AI backend with RAG over your case database, HxNexus answers operational questions in seconds that would otherwise require a SQL query, a manager conversation, or a report run.
HxNexus combines three information sources into every response: live case data from PostgreSQL (scoped to the requesting user's access group), process knowledge from HxGraph (the semantic graph of case types, stages, steps, forms, connectors, and their relationships), and conversational context from the current session. When you open HxNexus from within a case, it automatically pre-loads that case's full event history and field values into its context window — no copy-pasting required.
The AI model is configured via the AI_MODEL environment variable and served by case-service through the API gateway on port 8200. Prompt caching is enabled with a 5-minute TTL on repeated queries in the same session, dramatically reducing latency for iterative follow-up questions. Responses are structured: HxNexus returns prose summaries, formatted tables, and actionable recommendations depending on the query type — not raw database dumps.
Open any case and use the Ask tab to question everything on it in one place: case variables, the timeline, worker-customer messages, attached document content, verification results, and sealed session transcripts (only if you hold recording-view permission — otherwise that source is withheld and the answer says so). Answers cite their sources inline, are labelled assistive, and every ask is written to the case audit trail with the sources it used.
HxNexus handles a broad range of question types. The table below shows the primary capability categories with representative example queries.
| Capability | Example Query | Data Source |
|---|---|---|
| Case Lookup | "What's the current status of case CASE-2041?" | case_instances, case_event_log, case_instance_variables |
| Queue Summary | "Summarize the open claims queue — what's the oldest case and the bottleneck stage?" | cases, stages, SLA data |
| Trend Analysis | "How has case volume changed over the past 30 days by case type?" | cases aggregate, case_types |
| Process Guidance | "What steps are required to complete the KYC Review stage in the Loan Application case type?" | HxGraph: stages, steps, forms |
| Graph Query | "What connectors does the Mortgage Origination case type depend on?" | HxGraph: structural edges (contains / depends_on) |
| Anomaly Detection | "Are there any cases that have been in the same stage for more than twice the normal duration?" | cases, SLA engine, statistical baseline |
| Assignment Recommendation | "Which agent in the Compliance team has the lightest current workload?" | cases, users, access_groups |
| Explanation of Events | "Walk me through what happened on case CASE-1887 between Monday and Wednesday." | case_events, audit_logs, users |
HxNexus is embedded throughout the Velaris platform. There are three entry points depending on your role and context:
Every HxNexus query follows this pipeline:
Intent classification: case-service receives the raw query and classifies it into one of the capability categories (case lookup, trend, graph query, etc.) to determine which retrieval strategy to apply.
Retrieval: Relevant case data is fetched from PostgreSQL using access-group-scoped SQL. If the query involves process structure (stages, steps, connectors), HxGraph is queried via /api/v1/graph/query or /api/v1/graph/path. Both results are passed to the context builder.
Context assembly: A structured system prompt is assembled containing: (a) the user's role and access group, (b) the current case context if applicable, (c) the retrieved case data summary, (d) the relevant HxGraph subgraph, and (e) the conversation history for the session.
AI API call: The assembled prompt is sent to the configured AI model via the configured AI backend. For streaming requests, the response is forwarded token-by-token via SSE. Prompt caching headers are set — the system prompt block is cached for 5 minutes, so follow-up questions in the same session skip re-encoding the full context.
Structured response: The raw AI output is parsed into a structured response object (answer, sources, suggestions for follow-up questions) and returned to the frontend.
User Query
│
▼
┌───────────────────────────────────────────────────────────┐
│ case-service via gateway :8200 │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
│ │ Intent │───▶│ Retrieval │───▶│ Context │ │
│ │ Classifier │ │ Layer │ │ Builder │ │
│ └─────────────┘ └──────┬───────┘ └──────┬──────┘ │
│ │ │ │
│ ┌───────┴──────┐ │ │
│ │ │ │ │
│ ┌─────▼──────┐ ┌────▼──────┐ │ │
│ │ case-svc │ │ HxGraph │ │ │
│ │ :8200 │ │ :8200 │ │ │
│ │ SQL query │ │ /query │ │ │
│ └────────────┘ └───────────┘ │ │
│ ▼ │
│ ┌────────────────────────┐ │
│ │ AI Backend │ │
│ │ configured model │ │
│ │ (prompt cache 5m TTL) │ │
│ └────────────┬───────────┘ │
└───────────────────────────────────────────┼──────────────┘
│
Structured response
or SSE token stream
│
▼
Frontend
HxNexus requires two environment variables set for case-service and an optional Studio configuration for advanced settings.
| Variable | Default | Description |
|---|---|---|
ANTHROPIC_API_KEY |
Required | API key for the configured AI provider (e.g. Anthropic). Set in the platform environment. Never commit to source. |
AI_MODEL |
claude-sonnet-4-6 |
The AI model identifier to use for all HxNexus queries. Override to use a different model. For Ollama backends, use the local model name instead. |
AI_MAX_TOKENS |
4096 |
Maximum output tokens per response. Increase for complex trend analysis or multi-step explanations. Streaming responses are unaffected by this limit during generation. |
AI_CACHE_TTL |
300 |
System prompt cache TTL in seconds (AI prompt caching). Repeated queries within the window reuse the cached prompt encoding, reducing latency by ~40%. |
Additional settings are available in Studio under Studio > HxNexus > Settings:
HxNexus responds in the language of the question — no configuration required for most deployments. If an agent asks in Spanish, the response comes back in Spanish. If a customer types in Arabic (including RTL layout handling in the chat widget), the response is in Arabic. This is handled entirely by the AI model's multilingual capability; Velaris does not maintain separate translation pipelines or language models.
HxNexus supports streaming delivery via Server-Sent Events (SSE) on the /api/v1/nexus/stream endpoint. When streaming is active, the chat UI renders tokens progressively as the AI generates them — users see the answer forming word by word rather than waiting for the full response. This is the default mode for the chat drawer in Agent and Manager portals.
Each SSE event carries a data field containing either a partial token chunk (type: "delta"), a sources block (type: "sources"), or a terminal event (type: "done"). The frontend accumulates deltas and replaces the sources block when it arrives.
# Connect to the HxNexus streaming endpoint curl -N -X POST http://localhost:8100/api/v1/nexus/stream \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <JWT_TOKEN>" \ -d '{"question": "Summarize the top 3 SLA-breached cases this week"}' # Sample SSE stream: data: {"type":"delta","text":"Here are the top 3 "} data: {"type":"delta","text":"SLA-breached cases this week:"} data: {"type":"delta","text":"\n\n**1. CASE-2041** — Loan Application,"} data: {"type":"sources","cases":["CASE-2041","CASE-1983","CASE-2015"]} data: {"type":"done"}
All HxNexus endpoints are served by case-service through the gateway on port 8200 under /api/v1/hxnexus/*. All endpoints require a valid Bearer JWT token unless otherwise noted.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/api/v1/nexus/query |
Submit a natural language question. Returns a complete structured JSON response with answer, sources, and suggestions fields. |
Yes |
POST |
/api/v1/nexus/stream |
Same as /query but returns an SSE stream. The connection stays open until the done event. Use text/event-stream content negotiation. |
Yes |
POST |
/api/v1/embed |
Generate a pgvector embedding for arbitrary text. Returns a 1536-dimensional float array. Used internally by HxGraph sync; also available for custom integrations. | Yes |
GET |
/api/v1/similar |
Find semantically similar concepts given a query string. Query params: text (required), limit (default 10), threshold (cosine distance, default 0.3). Returns ranked list of matching graph nodes. |
Yes |
# Request body { "question": "Which claims cases have been open for more than 14 days?", "case_id": "CASE-2041", // optional — pre-loads case context "session_id": "sess_abc123" // optional — maintain conversation history } # Response body { "answer": "There are 7 open Claims cases older than 14 days. The oldest is CASE-1872 (Flood Claim, opened 2026-04-12, currently stalled in 'Assessment Review')...", "sources": [ { "type": "case", "id": "CASE-1872", "label": "Flood Claim" }, { "type": "case", "id": "CASE-1890", "label": "Property Claim" } ], "suggestions": [ "Which of these cases has the nearest SLA breach?", "Reassign the top 3 oldest cases to the senior claims team?", "Why is CASE-1872 stalled in Assessment Review?" ], "model": "claude-sonnet-4-6", "cached": false, "latency_ms": 1240 }
curl -s -X POST http://localhost:8100/api/v1/nexus/query \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <JWT_TOKEN>" \ -d '{ "question": "What is the average resolution time for Loan Application cases in Q1 2026?" }' | python3 -m json.tool
POST /api/v1/graph/sync first.session_id across follow-up questions. Without a session ID, each query is treated as standalone and HxNexus loses prior context — answers to follow-up questions may be less precise.