Insights

Lexia's Insights module provides analytics, metrics, and usage visibility across all agents, helping teams measure performance, cost, and engagement.

Placeholder Image: Dashboard visualization showing Lexia analytics cards — usage, cost, and agent performance charts


1. Overview

The Insights Layer transforms raw data from Tracing and Guardrail into actionable dashboards.
It provides real-time and historical visibility into how agents perform and how resources are consumed.

Use cases:

  • Monitor agent adoption and load
  • Track token or cost consumption
  • Evaluate user satisfaction
  • Detect anomalies or degraded performance

2. Usage Metrics

Metrics are aggregated per workspace and per agent.

MetricDescription
Total InteractionsNumber of chat messages or API calls
Active UsersUnique users over time
Avg Response TimeMean processing latency
Guardrail Pass Rate% of safe messages
Error Rate% of failed executions
Token ConsumptionTotal tokens processed

Example (Python SDK):

data = lexia.insights.get_metrics(period="24h")
print(data["avg_response_time"])

3. Agent Analytics

Each agent includes detailed analytics in Dashboard → Insights → Agents:

  • Session duration
  • Average messages per conversation
  • Guardrail triggers
  • Vector queries per chat
  • Function call frequency

Image: Agent analytics chart showing engagement and Guardrail triggers per day


4. Cost Monitoring

Lexia tracks cost metrics to help optimize LLM and infrastructure usage.

MetricDescription
Model Token CostEstimated cost of processed tokens
Storage UsageTotal file size in storage buckets
Vector Index SizeTotal embeddings stored
Database QueriesRead/write volume
Memory UtilizationAverage Redis usage

Example CLI:

lexia insights cost --since 7d

Image: Bar chart showing cost breakdown by resource type (LLM, DB, Storage, Vector)


5. Event Reports

Generate downloadable reports on activity and safety metrics.

CLI Example:

lexia insights report --period 30d --output report.pdf

SDK Example:

lexia.insights.export_report(period="30d", format="pdf")

Reports include:

  • Agent performance summary
  • Guardrail incidents
  • Usage & cost charts
  • Custom KPIs defined in the dashboard

6. Workspace Summaries

The workspace overview aggregates data from all agents:

  • Combined usage & cost graph
  • Top active agents
  • Peak traffic periods
  • Safety incident trends

Displayed in: Dashboard → Insights → Workspace

Image: Workspace summary dashboard with combined metrics cards


7. Integration with Other Layers

  • Tracing: feeds raw message and latency data
  • Guardrail: provides safety incident metrics
  • Observability: offers deeper logs and alerts

Together, they form Lexia's full observability and analytics stack.