Skip to main content

Statistics API

Endpoints for querying agent activity analytics, growth metrics, daily work journals, and AI-generated daily summaries.

Daily Journal

Retrieve a consolidated view of all agent activity for a specific day.

Parameters

Response

Data Sources

The journal aggregates data from 6 existing sources without any additional storage:

Error Responses

Daily Wrap (AI Summary)

Get an AI-generated natural-language summary of a day’s activity, including keywords and next-day suggestions. Results are cached in SQLite to minimize LLM costs.

Parameters

Response

Regenerate

Force a fresh AI summary, bypassing the cache:
Returns the same response structure as the GET endpoint with cached: false.

Requirements

  • A Lite Model must be configured in Settings (used for low-cost summary generation)
  • If no activity exists for the date, returns reason: "no_activity" with summary: null
  • If no Lite Model is configured, returns reason: "lite_model_not_configured" with summary: null

How It Works

  1. Aggregates data from the same 6 sources as Daily Journal (sessions, tokens, approvals, cron runs, kanban events, cost)
  2. Builds a structured prompt and sends it to the configured Lite Model
  3. Parses the LLM response (supports JSON and plain-text fallback)
  4. Caches the result in a dedicated daily_wrap_cache SQLite table (one row per date)

Per-Agent Usage Analytics

Break down token consumption and cost by individual agent — see which agents consume the most resources, with 7-day trend sparklines.

Parameters

Response

Key Features

  • Results sorted by total USD cost (highest first)
  • Percentage breakdown shows each agent’s share of total consumption
  • Sparkline data enables 7-day SVG trend visualization in the UI
  • Automatically resolves agent names and avatars from the Agent registry
  • The AgentUsageCard component auto-hides when there is only 1 agent (no comparison value)

Session Execution Trace

Retrieve the complete execution trace for a session — tool calls, LLM invocations, errors, human feedback events, and memory operations — structured for timeline replay.

Response

Key Features

  • Zero-storage replay: Traces are reconstructed on-demand from the append-only event log — no extra database or video files needed
  • Seven event types: tool_start, tool_end, llm_call, human_feedback, memory, error, message
  • Frontend Session Replay Player: The WebUI provides a three-pane interactive player (Chat View / Mind View / Inspector) with scrubber, playback speed control, keyboard navigation, and jump-to-error
  • Dataset export: Traces can be batch-exported to ShareGPT/Alpaca/OpenAI JSONL format for fine-tuning via the dataset_export pipeline

Growth Statistics

Growth dashboard metrics are available through the unified Learning Journey page (/journey, former /growth auto-redirects) and provide:
  • Skill KPI summary (total, success rate, evolution count)
  • Smart savings summary (cost reduction through caching and routing)
  • 84-day activity heatmaps and multi-dimensional health radar charts
  • Weekly trend analysis and AI-powered daily wrap summaries
  • Evolution timeline with skill lifecycle events
  • Knowledge Graph — interactive Claim/Evidence 2D force-directed visualization with namespace filtering
  • Skill Usage Efficiency Trends — per-skill success rate, average duration, and call frequency over time (daily granularity)

Harness Observability Metrics (Prometheus)

The Myrm Engine exposes underlying Prometheus telemetry metrics for deep DevOps & SRE monitoring. These metrics run on the /metrics endpoint and incur zero operational overhead.

Advanced Agent Metrics

  • myrm_time_to_first_action_seconds (Histogram): Captures the precise Time-To-First-Action (TTFA), calculating the exact time from receiving a user’s instruction until the agent invokes its first tool.
  • myrm_policy_denial_total (Counter): Tracks the number of times agent actions were blocked, redacted, or denied by the Security Guardrails and Path Policies.
  • myrm_tool_execution_total & myrm_tool_execution_failed_total (Counters): Monitors execution results for all individual skills, providing real-time data for calculating the overall “Tool Effectiveness Ratio” on Grafana dashboards.

Production Alerting Rules (Cloud Deployment)

For cloud-hosted deployments, Myrm ships with 12 production-grade Prometheus alerting rules covering sandbox health and reliability: Each alert includes a runbook_url linking to the Enterprise Runbook for remediation steps.

Grafana Dashboard

A ready-to-import Grafana dashboard (grafana-dashboard-sandbox.json) provides real-time visualization of container pool status, hit rates, health check success rates, creation latency, and hot pool availability. Import via Grafana UI or provisioning directory mount.

Smart Enable/Disable

Metrics collection is automatically enabled or disabled based on deployment mode — local and desktop deployments run with zero overhead, while cloud deployments expose the full /metrics endpoint for Prometheus scraping.

Agent Liveness SSOT

A single aggregated endpoint that tells you whether your agent is busy, idle, or degraded — no need to poll multiple APIs.

Response

State Logic

Use Cases

  • Frontend tray / pet indicator: Poll this endpoint to show a tri-state icon (spinning = busy, green = idle, amber = degraded)
  • Cloud monitoring: curl /api/v1/health/liveness | jq .state integrates with Prometheus/Grafana alerting
  • Multi-pane workspace: Show agent availability across browser tabs without opening settings

Key Properties

  • Pure read-only aggregation: Zero I/O, zero database queries — all data comes from in-memory gateway state
  • Sub-millisecond response time: Suitable for frequent polling (every 2-5 seconds)
  • Works across all deployment modes: Local WebUI, Tauri desktop, and cloud-hosted