The Agent Memory Viewer is a built-in web dashboard for browsing, searching, and managing agent memory visually. It ships as part of the @inosx/agent-memory package — no extra dependencies required.
# Launch the viewer (auto-opens browser on port 3737)
agent-memory viewer
# Or via npx
npx @inosx/agent-memory viewerThe viewer reads from the same .memory/ directory used by the library and CLI.
Related:
- To refresh session checkpoints from
conversations/*.jsonwithout a dashboard timer, runagent-memory sync-checkpoints(see README and user-guide.md). - Cursor / VS Code: after
npm install @inosx/agent-memory, a folder-open task runswatch --wait-for-transcriptsautomatically (see README — Postinstall automation). Runagent-memory processyourself for a one-shot backlog pass. - Entries created by transcript automation appear in the viewer with
autoextract/autohandoffandtranscripttags.
agent-memory [global-options] viewer [viewer-options]| Option | Description | Default |
|---|---|---|
--port <n> |
HTTP server port | 3737 |
--no-open |
Don't auto-open the browser | opens by default |
--dir <path> (global) |
Memory directory path | .memory |
# Default usage
agent-memory viewer
# Custom port
agent-memory viewer --port 4000
# Custom memory directory, headless
agent-memory --dir /path/to/project/.memory viewer --no-open
# With environment variable
AGENT_MEMORY_DIR=/srv/project/.memory agent-memory viewerThe left sidebar lists all agents that have a vault directory under .memory/. Agents are sorted alphabetically and can be filtered using the search box at the top.
Agent names are derived from their directory names by converting kebab-case to Title Case (e.g., bmad-master → BMad Master).
Below the agent list, five vault categories are shown with entry counts:
| Category | Color | Purpose |
|---|---|---|
| decisions | Green | Technical decisions taken during sessions |
| lessons | Yellow | Lessons learned and mistakes to avoid |
| tasks | Orange | Pending or in-progress tasks |
| projects | Purple | Project-level notes and context |
| handoffs | Cyan | Session summaries for continuity |
Click a category to view its entries for the selected agent.
Each entry displays:
- Date — When the entry was created
- Tags — Colored labels (if any)
- Content — The full markdown content
Available actions per entry:
- Edit — Inline editing with save/cancel
- Delete — With confirmation dialog
Use the + New entry button to create entries directly from the UI. New entries support content text and comma-separated tags.
The search bar in the top-right performs full-text BM25 search across all agents and categories. Results show:
- The entry content
- Origin indicator (agent · category) in purple
- Relevance-ranked ordering
Search is debounced (350ms) for a responsive experience.
Click the _project.md button to view the shared project context file in a modal overlay. This is the same file injected into every agent session via buildContext().
Click the Compact button to run a full maintenance cycle:
- Clean expired session checkpoints
- Trim old conversation messages
- Cap vault entries per category
- Rebuild the search index
A toast notification shows the results.
The header bar shows real-time stats:
- Total number of agents with vault data
- Total number of vault entries across all agents
The viewer is a single-file HTTP server with inline HTML, CSS, and JavaScript. No build step, no frontend framework, no extra dependencies.
┌──────────────────────────────────────────┐
│ Browser (SPA) │
│ ├── Vanilla JS + CSS │
│ ├── Fetch API → /api/* │
│ └── Responsive dark-theme UI │
├──────────────────────────────────────────┤
│ Node.js HTTP Server (viewer.ts) │
│ ├── GET / → inline HTML │
│ ├── GET /api/agents → vault.listAgents │
│ ├── GET /api/vault → vault.read │
│ ├── POST /api/vault → vault.append │
│ ├── PUT /api/vault → vault.update │
│ ├── DEL /api/vault → vault.remove │
│ ├── GET /api/counts → getCategoryCounts│
│ ├── GET /api/search → search.search │
│ ├── GET /api/project→ read _project.md │
│ ├── POST /api/compact→ compact.run │
│ └── GET /api/stats → aggregate counts │
├──────────────────────────────────────────┤
│ @inosx/agent-memory (createMemory) │
│ └── .memory/ directory (filesystem) │
└──────────────────────────────────────────┘
All endpoints return JSON. The viewer uses these internally, but they're available for scripting too.
| Method | Endpoint | Parameters | Description |
|---|---|---|---|
| GET | /api/agents |
— | List all agent IDs |
| GET | /api/vault |
agent, category |
Read entries |
| POST | /api/vault |
{ agent, category, content, tags? } |
Create entry |
| PUT | /api/vault |
{ agent, category, id, content } |
Update entry |
| DELETE | /api/vault |
{ agent, category, id } |
Delete entry |
| GET | /api/counts |
agent |
Category counts for agent |
| GET | /api/search |
q, limit? |
BM25 search |
| GET | /api/project |
— | Read _project.md |
| POST | /api/compact |
— | Run compaction |
| GET | /api/stats |
— | Aggregate stats |
# List agents
curl http://localhost:3737/api/agents
# Get decisions for an agent
curl "http://localhost:3737/api/vault?agent=bmad-master&category=decisions"
# Search
curl "http://localhost:3737/api/search?q=authentication&limit=10"
# Add an entry
curl -X POST http://localhost:3737/api/vault \
-H "Content-Type: application/json" \
-d '{"agent":"my-agent","category":"decisions","content":"Use JWT for auth","tags":["auth","security"]}'
# Run compaction
curl -X POST http://localhost:3737/api/compactAdd to your project's package.json:
{
"scripts": {
"memory:viewer": "agent-memory viewer"
}
}Then: npm run memory:viewer
| Key | Action |
|---|---|
Escape |
Close modal overlay |
Error: listen EADDRINUSE: address already in use :::3737
Use a different port: agent-memory viewer --port 4000
Or kill the process using the port:
lsof -ti :3737 | xargs killThe viewer lists directories under .memory/ that contain vault files. If no agents appear:
- Check that
--dirpoints to the correct memory directory - Verify agents have been created:
agent-memory agents - Create a test entry:
agent-memory vault add test-agent decisions --content "test"
The viewer loads JetBrains Mono and Inter from Google Fonts. If running offline, the UI falls back to system monospace and sans-serif fonts gracefully.