Graph Viewer Setup
Requirements
Section titled “Requirements”- Node.js 20+
- npm 10+
- A running AutoMem API instance with a valid API token
Quick Start
Section titled “Quick Start”git clone https://github.com/verygoodplugins/automem-graph-viewer.gitcd automem-graph-viewernpm cinpm run devThe dev server starts at http://localhost:5173 (Vite default) with hot module replacement.
For a production build:
npm run buildnpm run startThe production server (server.mjs) serves the built static files on http://localhost:3000.
Environment Variables
Section titled “Environment Variables”Copy .env.example to .env and configure:
| Variable | Default | Description |
|---|---|---|
VITE_API_TARGET | http://localhost:8001 | AutoMem API URL for the Vite dev proxy. In production, the viewer uses relative URLs or localStorage config. |
VITE_BASE_PATH | / | Base path prefix when hosting under a subpath (e.g. /viewer/) |
VITE_ENABLE_HAND_CONTROLS | false | Enable experimental webcam hand tracking controls |
Connecting to AutoMem
Section titled “Connecting to AutoMem”The graph viewer needs an API token to authenticate with your AutoMem instance. Tokens can be provided in several ways (checked in priority order):
- URL query parameter —
?token=your-token - URL hash —
#token=your-token(stays client-side, never sent to server) - localStorage — The viewer stores the token in
automem_tokenafter first entry via the TokenPrompt UI
Embedded Mode
Section titled “Embedded Mode”When the viewer is served from AutoMem’s /viewer path (same origin), it detects embedded mode automatically and uses relative API URLs. The token can be passed via the URL hash: /viewer/#token=xxx.
Standalone Mode
Section titled “Standalone Mode”When running the viewer separately from AutoMem, configure the API server:
- Dev: Set
VITE_API_TARGETin.envto your AutoMem URL. Vite proxies API requests. - Production: The viewer checks
localStorageforautomem_server. Set it via the UI settings or manually:localStorage.setItem('automem_server', 'https://your-automem.example.com'). - URL override: Append
?server=https://your-automem.example.comto any page URL.
API Endpoints Used
Section titled “API Endpoints Used”The viewer consumes these AutoMem API endpoints:
| Endpoint | Purpose |
|---|---|
GET /graph/snapshot | Full graph data (nodes + edges) |
GET /graph/neighbors/:id | Neighbors of a specific node |
GET /graph/stats | Graph statistics (counts, types) |
GET /health | Service health check |
All requests (except /health) require the X-API-Key: <token> header.
Additional endpoints supported:
| Endpoint | Purpose |
|---|---|
PATCH /memory/:id | Update memory fields |
DELETE /memory/:id | Delete a memory |