How wesm/agentsview works
agentsview is a local-first archive and observability product for AI coding-agent sessions. Its main workflow discovers and syncs agent activity into a local SQLite archive, serves it through a daemon API, and presents sessions and reports in a web UI. The product also covers token costs, analytics, activity, semantic recall, project data, and optional archive sharing or database mirrors. README statements establish the high-level runtime flow; source excerpts and the index support the specific frontend, API, sync, and storage links shown. Unsampled subsystems are represented at their directory level.
Main entry points: main.go CLI and daemon entry · App.svelte Web application · db Local archive · sync Session sync engine
Components 21
Capture and Sync
- Source capture
internal/capture - Session sync engine
internal/sync - Agent parsers
internal/parser
Archive and Query
- Local archive
internal/db - Session service
internal/service/service.go - Recall and insights
internal/recall - Embedding search
internal/vector
Daemon and API
- CLI and daemon entry
cmd/agentsview/main.go - HTTP API server
internal/server/huma_routes_sessions.go
Web Experience
- Web application
frontend/src/App.svelte - Frontend API client
frontend/src/lib/api/runtime.ts - Session transcript view
frontend/src/lib/components/content/MessageList.svelte - Activity reports
frontend/src/lib/components/activity/ActivityPage.svelte - Analytics reports
frontend/src/lib/components/analytics/AnalyticsPage.svelte - Usage and costs
frontend/src/lib/components/usage/UsagePage.svelte
Sharing and Mirrors
- Archive exchange
internal/artifact - PostgreSQL backend
internal/postgres - ClickHouse backend
internal/clickhouse - DuckDB mirror
internal/duckdb
Other components
- Local user
- Agent session sources
Connections 27
- Local user → CLI and daemon entry: starts or queries
- Agent session sources → Source capture: provides sessions
- CLI and daemon entry → Session sync engine: runs sync
cmd/agentsview/main.go - Source capture → Session sync engine: supplies sources
- Session sync engine → Agent parsers: parses sessions
internal/sync/engine_sources.go - Session sync engine → Local archive: writes archive
- CLI and daemon entry → HTTP API server: starts daemon
- HTTP API server → Session service: serves session requests
internal/server/huma_routes_sessions.go - Session service → Local archive: reads archive
internal/service/service.go - Local user → Web application: browses archive
- Web application → Frontend API client: requests data
- Frontend API client → HTTP API server: calls API
- Web application → Session transcript view: renders transcripts
frontend/src/App.svelte - Session transcript view → Frontend API client: loads session data
- Web application → Activity reports: shows activity
frontend/src/App.svelte - Web application → Analytics reports: shows analytics
frontend/src/App.svelte - Web application → Usage and costs: shows costs
frontend/src/App.svelte - Local archive → Activity reports: provides archive reports
- Local archive → Analytics reports: provides archive reports
- Local archive → Usage and costs: stores usage data
- Local user → Recall and insights: requests recall
- Recall and insights → Local archive: uses archive
internal/recall/extract/manager.go - HTTP API server → Embedding search: routes embedding operations
- Local user → Archive exchange: chooses sharing
- CLI and daemon entry → PostgreSQL backend: pushes archive
- CLI and daemon entry → ClickHouse backend: pushes archive
- CLI and daemon entry → DuckDB mirror: pushes mirror