mirror of
https://github.com/smart-memory/smart-memory-viewer.git
synced 2026-08-21 15:43:32 +00:00
Find a file
Code
Clone this repository
sanctuary.smartmemory.ai was serving the Clerk dev publishable key. Two independent causes, both fixed here. .env.sanctuary pinned only the two Discord Activity flags, so every other VITE_* value fell through to the building machine's generic .env — localhost API URL and pk_test_*. The PLAT-CLERK-PROD-1 rotation to pk_live_* reached the five UIs that deploy through GitHub Actions and missed this one, which deploys by local rsync. svc-api stopped accepting the dev issuer in Phase D, so the non-embedded fallback branch in main.jsx could not authenticate at all. Pinning the production values was not sufficient: Vite ranks the process environment above every .env file, and the local docker-compose flow exports VITE_CLERK_PUBLISHABLE_KEY into the shell, silently outranking the file. build:sanctuary now runs vite under `env -u` for each pinned variable. The deploy also gains a pre-rsync bundle check that refuses a pk_test_ key, the foreign ScaleMate PostHog token, or any pinned value that failed to reach the bundle. That last check is what catches an environment leak — "localhost" cannot be blacklisted, since the Discord SDK and posthog-js both contain it.
713b28d182
·
2026-08-13 23:50:20 +08:00
67 commits
SmartMemory Graph Viewer
Version: 0.1.0
Standalone knowledge graph viewer for SmartMemory. Thin auth shell that delegates all graph visualization to @smartmemory/graph.
Features
- Graph visualization — Cytoscape.js canvas with 5 layout algorithms (force-directed, hierarchical, circle, concentric, grid)
- Type filtering — Toggle memory types and entity types with color-coded checkboxes
- Search — Fuzzy search across node labels with keyboard shortcut (Cmd/Ctrl+K)
- Detail panel — Click any node to see content, metadata, confidence, and timestamps
- Entity corrections — Rename entities, retype, ground to Wikipedia
- Path finder — Select two nodes and find the shortest path between them
- Real-time streaming — WebSocket events with drip-feed animation
- Export — Download graph as PNG (2x resolution) or SVG
- PWA — Installable with offline caching via Workbox
Quick Start
# Prerequisites: Node.js 20.19+
npm install
npm run dev
Opens at http://localhost:5178.
Environment
Copy .env.example to .env and configure:
VITE_API_URL=http://localhost:9001 # SmartMemory API
VITE_WS_URL=ws://localhost:9003/events # Insights WebSocket for streaming
Production defaults to https://api.smartmemory.ai and wss://api.insights.smartmemory.ai/events.
Scripts
| Command | Description |
|---|---|
npm run dev |
Dev server on port 5178 |
npm run build |
Production build to dist/ |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
Architecture
src/
├── App.jsx # Auth flow + GraphExplorer with adapter
├── main.jsx # React entry
└── index.css # TailwindCSS v4
All graph visualization code lives in @smartmemory/graph (see ../smart-memory-graph/). The viewer creates a fetchAdapter with auth credentials and passes it to <GraphExplorer>.
Dependencies
- @smartmemory/graph — Shared graph package (linked via
file:../smart-memory-graph) - cytoscape — Graph rendering engine (also in graph package, deduped)
- tailwindcss v4 — Utility CSS
- vite-plugin-pwa — Service worker + manifest
Related
- Graph Package README
- VIS-GRAPH-4 Design
- SmartMemory Roadmap
- Knowledge Graph API
- Graph Colors Contract
Documentation
Full SmartMemory documentation: https://docs.smartmemory.ai