agentsview
repository·main·Indexed 25 days ago
https://github.com/kenn-io/agentsviewA local-first tool for browsing, searching, and tracking costs across various AI coding agents. It provides a web UI and CLI to analyze session data, token usage, and compute costs without requiring external accounts. It includes an experimental Tauri-based desktop wrapper and supports multiple backends including SQLite, DuckDB, and PostgreSQL.
What's inside agentsview
- AgentsView is a local-first desktop and web application designed for browsing, searching, and analyzing past AI coding sessions. It allows developers to track usage, costs, and time spent across various projects, models, and tools. It automatically discovers sessions from dozens of supported AI agents without requiring manual configuration.
Overview of Recall (Experimental)
mainRecall is an experimental layer for managing durable, provenance-linked knowledge from past agent sessions. Unlike semantic search (which finds passages in transcripts), Recall searches a distilled set of compact facts, procedures, preferences, and warnings.
Key Characteristics:
- Storage: Currently local and SQLite-only. Not available for PostgreSQL or DuckDB stores.
- Retrieval: Supports lexical (default), vector, and hybrid retrieval.
- Provenance: Every entry is linked to a source session with mechanical evidence verification (message ordinals, tool uses, etc.).
- Trust Model: Entries exist in different review states (e.g.,
human_reviewed,unreviewed_auto). Onlyhuman_reviewedentries are considered trusted for trusted-only reads.
!!! warning "Active research" Recall's schema, scoring, and workflows are subject to change. Upgrades may require rebuilding tables. The session archive is the source of truth and must not be deleted or recreated to reset Recall.
Understand Artifact Export Reliability Design
mainThe Artifact Export Reliability design addresses consistency gaps in the publication ledger. It ensures that artifact exports are bounded in memory, validated against the correct origin, and handle deterministic failures without blocking the entire export queue.
Key improvements include:
- Origin Validation: Prevents stale exporters from publishing under incorrect namespaces by verifying the
artifact_origin_idwithin the same transaction as the mutation. - Bounded Session Loading: Prevents memory exhaustion by using a transactional bounded loader that stops reading once specific cardinality or byte budgets are exceeded.
- Durable Rejection State: Allows deterministic failures (like size limit violations) to be recorded as 'rejected' outcomes in the
artifact_export_queue, allowing other successful claims in the same batch to proceed. - Automatic Retries: Content mutations automatically advance the queue generation, which clears previous rejection states and triggers a retry.
- Origin Validation: Prevents stale exporters from publishing under incorrect namespaces by verifying the
Understand Session Intelligence signals
mainAgentsView (v0.23.0+) provides a session-intelligence layer that computes health signals, outcome classifications, and aggregate analytics for agent sessions. These signals are heuristics used for triage and pattern-finding.
Health Score
A penalty-based score out of 100, mapped to grades:
A: 90-100B: 75-89C: 60-74D: 40-59F: 0-39
Outcome Classification
Sessions are classified into one of four outcomes with a confidence level (
high,medium, orlow):completedabandonederroredunknown
Key Signal Categories
- Tool-Health: Tracks tool failures, retries (3+ identical calls), edit churn (3+ edits to a file in a tight window), and consecutive failure streaks.
- Context Signals: Tracks compaction counts, mid-task compactions (interrupting active work), and maximum context pressure.
Understand the Microdollar Money Representation
mainAgentsView uses a fixed-precision integer representation for all monetary values to avoid floating-point errors. All money is represented as signed 64-bit microdollars, where 1 USD = 1,000,000 microdollars.
Key constraints:
- One microdollar is $0.000001 (one ten-thousandth of a cent).
- The range covers approximately ±$9.22 trillion.
- All public machine-readable JSON outputs must use the
Moneyobject format. - Human-facing interfaces (CLI/UI) render these as standard dollar strings (e.g.,
$0.42).
{ "microdollars": 420000 }Understand imported data content and appearance
mainWhen you import conversations, AgentsView processes the following data:
Messages
All conversation turns are imported as sessions, including user messages, assistant responses, thinking/reasoning blocks, and tool usage (e.g., code interpreter, web search, DALL-E).
Images (ChatGPT only)
AgentsView extracts DALL-E generations and uploaded files from the ChatGPT
.zipand stores them in the local data assets directory. Supported formats includePNG,JPG,JPEG,WebP, andGIF. Images are displayed inline in the message viewer.Metadata
Each session includes:
- Conversation title (used as the session display name)
- Created and updated timestamps
- Message and user message counts
- Model information (where available)
Organization and Features
- Grouping: Imported sessions are grouped under the
claude.aiorchatgpt.comproject. You can use the project filter to find them. - Functionality: Imported sessions support all standard AgentsView features, including search, export, publish to Gist, insights, pinned messages, and analytics.
Understand PostgreSQL Semantic Search Replication
mainThe
internal/postgrespackage implements adb.VectorSearcherseam over pgvector, acting as a passive replica of the localvectors.db.Key behaviors:
- No Server-Side Computation: Embeddings are never computed on the PostgreSQL server; they are computed locally and pushed.
- Data Sync: The
pg pushcommand copies the active generation's documents and chunks to the database. - Parity: It reuses fusion machinery (
RRFMerge, unit fusion keys, subordinate penalty, snippet construction) frominternal/dbto ensure semantic/hybrid search parity between local SQLite and remote PostgreSQL backends.
Analyze session costs and analytics in the Web UI
mainThe AgentsView Web UI provides several dashboards for monitoring agent activity and expenses:
- Token usage and cost dashboard: View per-session and per-model cost breakdowns, along with daily spend charts.
- Analytics dashboard: Access activity heatmaps, tool usage metrics, velocity metrics, and project breakdowns.
- Recent Edits feed: Track files changed by agents across all sessions, grouped by project and path. Each entry links directly to the message that triggered the change.
- Live updates: The UI uses Server-Sent Events (SSE) to provide real-time updates as active sessions receive new messages.
Understand the Semantic Search storage layout
mainSemantic search data is stored in a separate SQLite database named
vectors.db, located alongside the mainsessions.dbarchive.Key characteristics:
- Resilience:
vectors.dbis not affected by a parser-change resync ofsessions.db. A resync rebuildssessions.dbatomically, and the next mirror refresh re-derives identities, ensuring unchanged documents keep their vectors. - Self-contained: The mirror copies message content into
vectors.dbso it can serve queries without needing the main archive open. - Disposable:
vectors.dbcan be deleted and rebuilt usingembeddings build --full-rebuildwithout impactingsessions.db.
- Resilience:
Quickstart: Semantic Search with Ollama
mainTo use Ollama for semantic search, pull an embedding model and point
agentsviewto Ollama's OpenAI-compatible/v1endpoint.- Pull the model:
ollama pull nomic-embed-text- Configure
~/.agentsview/config.toml:
[vector] enabled = true [vector.embeddings] model = "nomic-embed-text" dimension = 768 [vector.embeddings.servers.local] endpoint = "http://localhost:11434/v1"Quickstart: Ollama Embeddings
mainOllama provides an OpenAI-compatible endpoint for embeddings at
/v1.- Pull an embedding model in Ollama.
- Ollama serves the endpoint at
/v1with no API key required. - The
agentsview/v1/embeddingsroute passes thedimensionsfield through to Ollama, allowing for Matryoshka reduction if supported.
Push Embeddings to PostgreSQL
mainIf using PostgreSQL as a backend,
agentsview pg pushcopies the active generation from the localvectors.dbmirror into PostgreSQL usinghalfvecchunk tables.- Incremental Push: By default, only the active generation and sessions with changed document sets are pushed.
- Full Push: Use
pg push --fullto bypass change detection and re-send all session vectors. - Disable Vector Push: To skip the vector phase during a push, use
--no-vectorsor setpush_vectors = falsein the[pg]config section.
Note: A machine with
[vector]enabled will attempt to push embeddings automatically during the push phase.