Skip to content

AlvaroQ/engram-explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Engram Explorer

See your agent's brain.

A local-first dashboard for Engram β€” explore your AI agent's long-term memory as a live 3D neural map, diagnose sync problems, and fix capture bugs the CLI can't even show you.

Release Downloads License: MIT Go 1.25+


⬇️ Download Β· 🧠 The Brain Β· πŸ“Š What it shows Β· πŸ› οΈ Build from source


Engram Explorer Dashboard overview


⚑ Why this exists

Engram stores your agents' long-term memory in a local SQLite database (~/.engram/engram.db). The official TUI/CLI is great for capture and recall β€” but it can't show you the shape of that memory, nor the operational problems hiding inside it: orphan projects, broken cloud sync, thousands of pending mutations, observations captured without a project.

Engram Explorer reads that database directly β€” read-only by default, so it never blocks the daemon's writes β€” and surfaces all of it across 13 views in Spanish and English, light or dark. It can also apply targeted, user-confirmed fixes (reassign a stray observation, rename a project, prune junk) through a guarded write path you can switch off entirely.

One binary, one SQLite file. No Node.js runtime, no WebView2, no sidecar. Download the binary for your platform, point it at your database, open your browser.


πŸ“₯ Download & run (90 seconds)

You don't need to clone or compile anything. Grab the binary for your OS from the latest release and run it.

Platform Download Run it
🍎 macOS engram-explorer_*_darwin_arm64.tar.gz (Apple Silicon)
engram-explorer_*_darwin_amd64.tar.gz (Intel)
tar -xzf engram-explorer_*.tar.gz
./engram-explorer
🐧 Linux engram-explorer_*_linux_amd64.tar.gz (or arm64) tar -xzf engram-explorer_*.tar.gz
./engram-explorer
πŸͺŸ Windows engram-explorer_*_windows_amd64.zip Unzip β†’ double-click engram-explorer.exe
(or run it from PowerShell)

Then open http://127.0.0.1:8787 in your browser. That's it. πŸŽ‰

🍺 One-liner for macOS / Linux (Homebrew)

If you have Homebrew:

brew install AlvaroQ/tap/engram-explorer
engram-explorer

On Windows? There is no Homebrew step β€” and you don't need one. Homebrew on Windows requires WSL2 and adds friction for zero benefit. Just download the .zip from the table above, unzip it, and run the .exe. A single native binary, exactly like macOS and Linux.

🧩 Do I need Engram installed?

No β€” it's optional. The dashboard starts even with no data source and walks you through setup on first run (see First-run onboarding). But to see your own memory, install Engram:

# macOS / Linux
brew install gentleman-programming/tap/engram
engram serve   # creates ~/.engram/engram.db on first run

The engram serve daemon is not required to run the dashboard β€” it reads the SQLite file directly and degrades gracefully when the daemon is offline. Only the live sync/health panels need it.

πŸ‘€ Just want to look around first? (demo data)

No Engram, no real data needed β€” seed a realistic demo database and explore every view. Requires building from source:

go run ./cmd/seed-demo                       # generates ./demo/engram.db
ENGRAM_DATA_DIR=./demo ./engram-explorer     # run against the demo data

🧠 The Brain β€” your memory as a 3D neural map

The Brain β€” 3D force-directed graph of all observations

This is the centerpiece. The Brain renders every observation in your database as a node in a live, force-directed 3D graph β€” organized by project.

  • 🌐 Each project becomes a lobe. Observations from the same project cluster together in space β€” one vivid colored region per project, dozens of them, each its own part of the brain.
  • πŸ”΅ Each sphere is a single memory. Its size reflects weight (and how many duplicates were deduped into it); its color encodes either the project or the observation type β€” a toggle you control.
  • ⚑ Synapses connect related memories. Edges carry GPU-driven particle flow β€” the brain literally "breathes" β€” with relationship and confidence baked into how each connection looks.
  • πŸ”Ž Hover any neuron to read it. A detail card surfaces the memory's title, tags, project, and date right in the 3D scene; click through for the full markdown and [[wikilinks]].
  • πŸš€ Fast by design. Force layout runs off-main-thread in a Web Worker, rendering uses a single instanced mesh on a demand frameloop, particles are GPU-driven β€” smooth even with hundreds of nodes on screen.

The Brain keeps evolving toward a deeper, drillable neural architecture β€” immersive navigation into the clusters your memory forms as it grows.


πŸ“Š What it surfaces

13 views, all server-rendered, all in EN/ES + light/dark:

View What you get
🏠 Overview At-a-glance counts (projects, sessions, observations, prompts), activity-by-project chart, type distribution, sync health
🧠 Brain The 3D neural map above
πŸ“ Projects Per-project memory, activity, and sync state
πŸ“„ Project detail Full memory and session timeline for a single project
πŸ’­ Observations Every memory, filterable, with full markdown + wikilinks
πŸ•‘ Sessions Session timeline and per-session detail
✍️ Prompts Captured user prompts, searchable
🏷️ Topics Memory grouped by stable topic_key
☁️ Sync Health Cloud enrollment: enrolled / healthy / broken / pending mutations
πŸ”„ Sync project Per-project cloud sync detail and mutation queue
🧹 Orphans Observations captured without a project β€” the capture bugs the CLI can't show
🩺 Diagnostics Orphan projects, broken sync β€” a diagnostic engine across all views
βš™οΈ Settings UI preferences, language, theme, Modules (provider toggles), Accounts (profiles)

πŸ”— Relationship to Engram

Engram Explorer is a community companion β€” a read-only viewer and operational dashboard built on top of Engram. It is not an official plugin, not a fork, and not affiliated with Gentleman Programming.

The official plugin ecosystem talks to the daemon over HTTP at 127.0.0.1:7437. Engram Explorer takes a different approach: it reads the SQLite file directly in WAL read-only mode, so it runs whether or not the daemon is active and never competes with engram serve as the authoritative owner of the database. When the daemon is running, the dashboard respects it β€” it only proxies the daemon's own telemetry endpoints (/health, /sync/status, /stats) and, for user-confirmed cloud operations, shells out to the engram CLI the same way you would from a terminal.

The CLI captures and recalls; this shows you the shape of what your agent has remembered. It complements the official tooling β€” it doesn't replace it.


πŸ› οΈ Build from source

Only needed if you want to contribute, run the demo seeder, or build a custom binary. Most users should just download a release.

Requirements

  • Go 1.25+ β€” matches the go directive in go.mod (minimum required by modernc.org/sqlite and golang.org/x/sync)
  • Node.js 20+ and pnpm 10+ β€” to build the React island bundles (not needed at runtime)
  • templ CLI β€” optional; generated *_templ.go files are committed, so go build ./... works without it

Path A β€” Try it with demo data (no Engram required)

git clone https://github.com/AlvaroQ/engram-explorer.git
cd engram-explorer

make build                                # frontend β†’ embed β†’ go build
go run ./cmd/seed-demo                     # seed a realistic demo DB
ENGRAM_DATA_DIR=./demo ./engram-explorer   # run against demo data
# open http://127.0.0.1:8787

Path B β€” Use your real Engram database

git clone https://github.com/AlvaroQ/engram-explorer.git
cd engram-explorer

make build            # frontend β†’ embed β†’ go build
./engram-explorer     # reads ~/.engram/engram.db by default
# open http://127.0.0.1:8787

Health check: curl http://127.0.0.1:8787/api/health

Run without building the binary (Go installed)

make frontend embed          # frontend must be built first for the Go embed
go run ./cmd/engram-explorer

Build targets

Target What it does
make build Full build: templ generate β†’ vite build (islands) β†’ Tailwind CSS β†’ embed β†’ go build
make frontend Build React island bundles only
make embed Copy apps/frontend/dist/ into internal/web/dist/ for go:embed
make dev Run the Go binary in dev mode
make test Run all Go tests
make clean Remove the binary and the embedded dist copy

πŸ—οΈ Architecture

Engram Explorer is a single Go binary (cmd/engram-explorer) serving all views on one port (default 127.0.0.1:8787). It opens the Engram SQLite database with two modernc.org/sqlite handles (pure-Go, no CGo): a read-only pool (mode=ro + query_only) that serves every view and coexists safely with the live WAL written by the daemon, and a single-connection read-write pool that powers a small set of explicit, user-confirmed mutations. API routes (/api/*) run on an internal/httpapi mux built on Go's standard net/http. The backend proxies the daemon's telemetry endpoints (/health, /sync/status, /stats) and β€” when the user explicitly confirms a cloud enroll/sync β€” shells out to the engram CLI. Set ENGRAM_DASH_READONLY=true to disable the write path entirely.

The primary UI is server-rendered using templ and HTMX in internal/ui. Go handlers load data via the services layer β†’ render templ templates (full-page on navigation, partial fragment on HTMX requests via the HX-Request header). Interactivity (filters, pagination, drawers) is driven by hx-get/hx-post/hx-swap. Long lists use server-side cursor-based pagination with hx-trigger="revealed" β€” no client-side virtualization.

React islands handle the two surfaces not portable to HTMX: the 3D brain graph (React Three Fiber + Three.js + a Web Worker for force layout) and the activity/type charts (Recharts). Islands live in apps/frontend/src/islands/, each exporting a mount(el, props) function, built by Vite (multi-entry) to stable paths (/islands/<name>.js) and embedded via go:embed in internal/web/.

i18n is server-side: a Go loader over internal/ui/locales/{en,es}.json with T(lang, key, args...); language resolved from the lang cookie β†’ Accept-Language header β†’ "en". Theme is applied via a theme cookie read at render time.

Tech stack

Layer Stack
Backend Go Β· net/http Β· modernc.org/sqlite (read-only, pure-Go, no CGo) Β· log/slog
UI (primary) templ + HTMX Β· server-rendered Β· cursor pagination Β· i18n (en/es) Β· Tailwind v3
React islands React 19 Β· Vite multi-entry Β· each island exports mount(el,props)
Brain island React Three Fiber Β· Three.js Β· drei Β· Web Worker force layout Β· GPU particle synapses
Charts island Recharts Β· activity-by-project, project-activity, type-breakdown
Distribution Single binary Β· go:embed Β· GoReleaser Β· Homebrew tap

🚦 First-run onboarding

When you start Engram Explorer for the first time β€” or any time no data source is active β€” the dashboard shows an onboarding screen instead of an error. It does not exit and does not require Engram to be installed.

It lists the auto-detected Tier-1 providers (Engram database, Claude Code projects directory), offers a manual path field for any not detected, and activates the first provider you configure β€” transitioning straight to the overview, no restart required.


🧩 Modules

Modules are the data-source providers Engram Explorer can connect to. Manage them in Settings β†’ Modules.

Provider ID What it reads Default auto-detect path
Engram engram SQLite database written by the Engram daemon ~/.engram/engram.db (or $ENGRAM_DATA_DIR)
Claude Code Sessions cc-sessions JSONL session transcripts written by Claude Code ~/.claude/projects (or $CLAUDE_PROJECTS_DIR)

Both are Tier-1: if not found at their default paths the UI keeps them visible with a path entry field, so you can point the dashboard at a non-default location without restarting. Tier-2 providers (planned) are silent auto-detect only; none ship in the current release.

Provider states: enabled (open and serving) Β· detected (found, not yet activated) Β· disabled (toggled off) Β· errored (failed to open β€” check the path) Β· registered (known, detection not attempted).

To activate a Tier-1 provider manually: Settings β†’ Modules β†’ find the detected/registered row β†’ enter the path β†’ Validate & Activate. On success it becomes enabled and its sidebar section appears immediately; the path is persisted to ~/.engram/config.json.


πŸ‘€ Accounts

Accounts are named configuration profiles. Each stores a discrete set of provider paths and activation states, so you can keep separate setups for (say) a personal Engram database and a work one. Manage them in Settings β†’ Accounts.

  • Create: Settings β†’ Accounts β†’ name it β†’ Create β†’ configure providers in Settings β†’ Modules.
  • Switch: click Switch next to the profile (or use the sidebar account switcher when β‰₯2 profiles exist). Switches are hot-swap β€” no restart; in-flight requests complete against the previous profile first.
  • Default profile: created automatically on first run, seeded from env vars and the legacy ~/.engram/explorer-settings.json if present, so existing users see no change after upgrading.
  • Persistence: active profile name and all settings live in ~/.engram/config.json and are restored on restart.

If a profile references a path that no longer exists, that provider is marked unavailable with an inline warning; other providers still load normally.


βš™οΈ Configuration

Environment variables

Env var Default Purpose
ENGRAM_DATA_DIR ~/.engram Directory containing engram.db; also the location of config.json
CLAUDE_PROJECTS_DIR ~/.claude/projects Directory where Claude Code stores session transcripts
DASHBOARD_HOST 127.0.0.1 HTTP bind address
DASHBOARD_PORT 8787 HTTP listen port
ENGRAM_PORT 7437 Port of the local engram serve daemon (used when ENGRAM_DAEMON_URL is not set)
ENGRAM_DAEMON_URL http://127.0.0.1:7437 Full base URL of the Engram daemon (overrides ENGRAM_PORT)
ENGRAM_DAEMON_TIMEOUT_MS 1500 HTTP timeout for daemon proxy calls (milliseconds)
LOG_LEVEL info / debug in dev Logging verbosity: debug, info, warn, error
ENGRAM_DASH_ENV production Set to development to expose internal error details in API responses
ENGRAM_DASH_READONLY false Set to true to disable all mutating routes (returns 503)

config.json (persistent settings)

Provider paths and account profiles are stored at $ENGRAM_DATA_DIR/config.json (default ~/.engram/config.json), written atomically on every change. You don't need to edit it manually β€” the Settings UI writes it for you.

Precedence (highest wins): 1. environment variable β†’ 2. config.json active profile β†’ 3. legacy explorer-settings.json (read once on first run to seed the default) β†’ 4. built-in default. Existing users relying on env vars see no change.


✏️ Editing your memory

Engram Explorer is read-first: every view works against the read-only pool and never touches your data. On top of that it offers a few explicit, user-confirmed edits so you can fix the problems it surfaces without dropping to the CLI:

  • Edit an observation β€” fix its title, type, topic_key, or content.
  • Reassign project β€” move a stray observation/session/prompt to the right project.
  • Delete β€” soft-delete an observation, or remove an empty session/prompt.
  • Rename / merge a project β€” re-tag every row from one project name to another.
  • Import / export β€” download a SQLite snapshot, or merge another Engram DB in (a safety backup is written next to your DB first).

Every mutation is confirmed in the UI, goes through a guarded write path, and runs inside a transaction. Because engram serve is the authoritative owner:

The read path is always safe alongside a running daemon. For destructive or bulk edits (project rename/merge, DB import) prefer stopping the daemon first, and keep a backup.

For a strict viewer with no write capability, start with ENGRAM_DASH_READONLY=true β€” the read-write pool is never opened and every mutating endpoint returns 503. See SECURITY.md for the full concurrency contract.


🩹 Troubleshooting

No data sources detected on first run

The dashboard shows the onboarding screen instead of crashing. From there you can activate Engram or Claude Code Sessions. If you have Engram but it isn't auto-detected: go to Settings β†’ Modules and enter the path to engram.db, or set ENGRAM_DATA_DIR=/path/to/dir before starting.

To get a real DB: brew install gentleman-programming/tap/engram && engram serve. To try demo data: go run ./cmd/seed-demo, then ENGRAM_DATA_DIR=./demo ./engram-explorer.

Dashboard shows "daemon offline"

The local engram serve daemon isn't reachable. The dashboard degrades gracefully β€” all read views stay functional against the SQLite file. Start the daemon with engram serve to recover the live /health, /sync/status, and /stats panels. (/api/sync/issues showing DAEMON_DOWN HIGH is the same root cause.)

Port already in use (address already in use)

Another process is bound to port 8787.

  • macOS / Linux: lsof -ti :8787 | xargs kill -9
  • Windows: netstat -ano | findstr :8787, then taskkill /F /PID <id>

Or use a different port: DASHBOARD_PORT=9090 ./engram-explorer.

Sync diagnostics (SYNC_BROKEN HIGH, empty project name)

SYNC_BROKEN HIGH β€” lifecycle='pending' with last_acked_seq=0 while last_enqueued_seq>0: mutations queued but never acknowledged. Common causes: cloud token not set, network partition, cloud-side rejection. Check last_error / reason_message on /sync/<project>.

Project with empty name ("") β€” observations captured without a project context. This is an upstream capture bug in the agent or MCP that emitted them; the dashboard can't fix it. Inspect the session_id of the affected rows and patch the captor.

Cloud mutations (CLI_NOT_FOUND, 429)

CLI_NOT_FOUND β€” engram is not on $PATH for the user running the dashboard. Install it system-wide or run the dashboard from a shell where engram --version resolves.

429 Rate limit exceeded β€” cloud mutation endpoints are rate-limited; the Retry-After header tells you how long to wait.


πŸ“¦ Releases & changelog

Versioned binaries and per-release changelogs are published on GitHub Releases. Built with GoReleaser from v* tags β€” macOS, Linux, and Windows artifacts plus a Homebrew tap.


πŸ“‚ Project layout

Expand the full directory tree
engram-explorer/
β”œβ”€β”€ Makefile                        # Build targets: build, dev, test, clean
β”œβ”€β”€ go.mod                          # module github.com/AlvaroQ/engram-explorer
β”œβ”€β”€ cmd/
β”‚   β”œβ”€β”€ engram-explorer/            # Binary entry point β€” config β†’ container β†’ serve
β”‚   └── seed-demo/                  # Demo database seeder (generates ./demo/engram.db)
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ config/                     # Env-var config, ProfileStore, EnsureConfig
β”‚   β”œβ”€β”€ httpapi/                    # net/http mux, routes, middleware, container (/api/*)
β”‚   β”œβ”€β”€ providers/                  # Provider port + Registry (state-machine, hot-swap)
β”‚   β”‚   β”œβ”€β”€ engram/                 # Engram provider adapter (SQLite, daemon proxy, health)
β”‚   β”‚   β”œβ”€β”€ ccsessions/             # Claude Code Sessions provider adapter (JSONL reader)
β”‚   β”‚   └── providertest/           # FakeProvider + test helpers
β”‚   β”œβ”€β”€ ui/                         # templ+HTMX server-rendered UI (all pages)
β”‚   β”‚   β”œβ”€β”€ locales/                # en.json, es.json
β”‚   β”‚   └── static/                 # app.css (Tailwind), styles.css, htmx.min.js
β”‚   β”œβ”€β”€ doctor/                     # Diagnostic module: /doctor/sync, /doctor/orphans
β”‚   β”œβ”€β”€ services/                   # SQL service layer (observations, sessions, sync, …)
β”‚   β”œβ”€β”€ sqlite/                     # Read-only + read-write connection pools
β”‚   β”œβ”€β”€ daemon/                     # HTTP client for the engram serve daemon
β”‚   β”œβ”€β”€ cursor/                     # Opaque cursor-based pagination
β”‚   β”œβ”€β”€ fts/                        # FTS5 query sanitizer
β”‚   β”œβ”€β”€ logging/                    # log/slog setup
β”‚   └── web/                        # go:embed of built islands+assets
β”œβ”€β”€ apps/
β”‚   └── frontend/                   # React islands via Vite multi-entry (build-time only)
β”‚       └── src/
β”‚           β”œβ”€β”€ islands/            # brain.tsx, *-chart.tsx (each exports mount(el,props))
β”‚           β”œβ”€β”€ components/brain/   # R3F 3D neural graph
β”‚           β”œβ”€β”€ components/charts/  # recharts wrappers
β”‚           └── loader.ts           # mounts islands from <div data-island data-props>
└── testdata/
    └── schema/engram-schema.sql    # Reference schema for Go integration tests

πŸ“„ License

MIT β€” see LICENSE.

About

Single-binary dashboard for Engram persistent memory: Go backend serving an embedded React frontend with a 3D knowledge graph. One binary, one SQLite file.

Topics

Resources

License

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors