A local semantic memory system for LLM applications on macOS
π macOS-only | π€ MCP-driven | π Local embeddings and PostgreSQL storage
The MCP connection should use the least-privilege ltm_mcp database role. The role can read, add, and update memories but cannot delete, truncate, or change the schema. See SECURITY.md for the security model, verification commands, and the limits of the SQL guards.
- π Web Dashboard: Apple-inspired Liquid Glass UI at
localhost:5555 - πΈοΈ Knowledge Graph: Interactive 2D/3D visualization with D3.js and Three.js
- π§ Semantic Search: Local AI-powered embeddings using Ollama + nomic-embed-text (LM Studio fallback)
- π Browser Extension: Capture web content with context menu and memory badges
- π¦ Archive System: Browse and manage archived memories with full search
- π€ MCP Integration: Native Model Context Protocol server for Claude Desktop and other compatible frameworks.
- π Privacy-First: Embeddings are generated locally without external API calls, and memory data stays in the PostgreSQL instance you configure
Light and dark themes with automatic system detection
Visualize memory patterns and discover connections
Find memories by meaning, not just keywords
Interactive visualization with Three.js
Force-directed layout with D3.js and focus highlighting
Capture web content with the Liquid Glass popup
The dashboard features a modern UI inspired by Apple's design language:
- Solid dark cards with subtle borders and Apple system colors
- Unified navigation across all views (Browse, Timeline, Insights, Archive, Graph)
- Bento grid layouts with 3-column responsive design
- Apple Blue accents (#0A84FF) throughout the interface
- Command palette (βK) for keyboard-first navigation
| View | Description |
|---|---|
| Browse | Card-based memory grid with filters, search, and importance indicators |
| Timeline | Visual activity chart with day/week/month granularity |
| Insights | Automated pattern discovery, focus areas, and tag correlations |
| Archive | Browse archived memories with search and pagination |
| Graph | Interactive knowledge graph with 2D/3D modes |
- 3D Mode: Three.js with Fibonacci sphere layout, auto-rotate, orbit controls
- 2D Mode: D3.js force-directed simulation with draggable nodes
- Features: Local view (hop distance), path finding, time animation, node search
- Right-Click Menu: View entity memories in dashboard, start path finding
- Smooth Navigation: Animated camera transitions when focusing nodes
- Color coding: Purple (people), Blue (projects), Green (tech), Orange (websites)
cd dashboard
python3 app.py
# Opens at http://localhost:5555curl -fsSL https://raw.githubusercontent.com/MyronKoch/longterm-memory-macos/main/install.sh | bashThe installer prompts for confirmation. For an explicitly confirmed non-interactive install:
curl -fsSL https://raw.githubusercontent.com/MyronKoch/longterm-memory-macos/main/install.sh | LONGTERM_MEMORY_ASSUME_YES=1 bash- PostgreSQL 17 with pgvector 0.8.0 extension
- Ollama with nomic-embed-text model (768-dimensional embeddings)
- Database schema with entities, observations, and archive tables
- Background services via macOS LaunchAgents
- Browser extension files (manual Chrome setup required)
git clone https://github.com/MyronKoch/longterm-memory-macos.git
cd longterm-memory-macos
chmod +x install.sh
./install.shUsing Cursor, Windsurf, Claude Code, or another AI coding agent? Just paste this prompt:
Clone https://github.com/MyronKoch/longterm-memory-macos and follow the
AGENT.md file to install the complete system. Execute each step, verify
it succeeds, then proceed to the next. Run the health check at the end.
The AGENT.md file contains step-by-step instructions optimized for AI agents with verification checks after each step.
flowchart TB
subgraph Inputs[Data Sources]
Claude[Claude Desktop]
Browser[Chrome Extension]
end
subgraph Core[Core System]
MCP[MCP Server<br/>postgres-mcp]
NH[Native Host<br/>Python]
DB[(PostgreSQL 17<br/>+ pgvector)]
Dash[Dashboard<br/>:5555]
end
subgraph Services[Background Services]
Ollama[Ollama<br/>nomic-embed]
BG[LaunchAgents]
end
Claude <--> MCP
MCP <--> DB
Browser <--> NH
NH <--> DB
Dash <--> DB
Browser -.->|badge queries| Dash
BG --> DB
Ollama <--> BG
This system is single-machine by design right now. To use one memory store from several machines, point every installation at one PostgreSQL instance by setting LONGTERM_MEMORY_HOST and LONGTERM_MEMORY_PORT instead of replicating database dumps.
Backups created by scripts/backup_longterm_memory.sh remain per-machine and are unaffected. A previous whole-database dump-replacement feature was removed because it could silently overwrite newer memories with an older snapshot.
| Component | Technology | Description |
|---|---|---|
| Web Dashboard | Flask + Vue 3 | Liquid Glass UI with reactive components |
| Knowledge Graph | Three.js + D3.js | Dual-mode 2D/3D visualization |
| Design System | Custom CSS | Apple-inspired Liquid Glass components |
| Browser Extension | Chrome APIs | Content capture with native messaging |
| MCP Server | postgres-mcp | Claude Desktop integration |
| Embedding Pipeline | Ollama + LM Studio | Local vector generation (768-dim) with fallback |
Capture web content directly from any Chromium browser:
- π§ Context Menu: Right-click β "Longterm Memory Database" submenu
- Save Selection
- Save Selection + Context
- Save Entire Page
- Open Dashboard
- π Memory Badge: Shows count of memories from current site
- π‘ Auto-Suggestions: Prompts to save frequently visited pages
- βοΈ Settings: Toggle badge and suggestions on/off
- Open
chrome://extensions/and enable Developer Mode - Click "Load unpacked" and select
browser-extension/chrome-extension/ - Run
./browser-extension/install_extension.shfor native host setup - Copy your extension ID and update the native messaging manifest
π See browser-extension/README.md for detailed setup.
Connect to any MCP-compatible AI assistant:
Config Location: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"longterm-memory": {
"command": "uvx",
"args": ["postgres-mcp"],
"env": {
"POSTGRES_CONNECTION_STRING": "postgresql://ltm_mcp@localhost:5432/longterm_memory",
"SYSTEM_CONTEXT": "PostgreSQL memory for user-specific data. Query at conversation start for context."
}
}
}
}The server uses the Model Context Protocol. Client setup varies, so consult your client's MCP configuration documentation.
π See docs/MULTI_APP_SETUP.md for Claude Code and Cursor configuration.
# Start dashboard
cd dashboard && python3 app.py
# Access views
open http://localhost:5555 # Browse (default)
open http://localhost:5555/?view=timeline # Timeline
open http://localhost:5555/?view=insights # Insights
open http://localhost:5555/?view=archive # Archive
open http://localhost:5555/graph # Knowledge Graph# Health check
./scripts/health_check.sh
# Generate embeddings for new observations
python3 scripts/ollama_embeddings.py
# View logs
tail -f ~/Documents/GitHub/longterm-memory-macos/logs/*.logThe system uses macOS LaunchAgents for scheduled embedding and backup tasks.
| Job | Schedule | Purpose |
|---|---|---|
| Embeddings | 4:00 AM daily | Generate vectors for new observations |
| Backup | 3:00 AM daily | Local database backup with 7-day retention |
Located in ~/Library/LaunchAgents/:
| File | Description |
|---|---|
com.longtermmemory.embeddings.plist |
Ollama embedding generation |
com.longtermmemory.backup.plist |
Database backup |
# View all longterm-memory services
launchctl list | grep longterm-- Recent observations
SELECT * FROM observations ORDER BY created_at DESC LIMIT 10;
-- Semantic search (requires embedding)
SELECT *, embedding <=> '[query_vector]' as distance
FROM observations
WHERE embedding IS NOT NULL
ORDER BY distance LIMIT 10;
-- Query both active and archived
SELECT * FROM all_observations;
-- Entity relationship counts
SELECT e.name, COUNT(o.id) as obs_count
FROM entities e
LEFT JOIN observations o ON e.id = o.entity_id
GROUP BY e.id ORDER BY obs_count DESC;The Liquid Glass design system provides consistent styling across the application:
| File | Purpose |
|---|---|
liquid-glass.css |
Core variables, colors, typography |
liquid-glass-components.css |
Buttons, cards, tabs, modals |
--brand-primary: #0A84FF; /* Apple Blue */
--bg-base: #000000; /* True black background */
--glass-bg: rgba(28, 28, 30, 0.8); /* Card backgrounds */
--text-primary: rgba(255, 255, 255, 0.95);# Check Python dependencies
pip3 install flask psycopg2-binary --break-system-packages
# Check PostgreSQL is running
brew services restart postgresql@17# Verify native host
python3 browser-extension/native-host/longterm_memory_host.py
# Check extension ID in manifest matches loaded extension# Verify Ollama is running
ollama list
# Pull the embedding model
ollama pull nomic-embed-text
# If Ollama unavailable, LM Studio fallback is automatic
# Just ensure LM Studio is running with nomic-embed-text-v1.5 loaded
# Manual embedding generation
python3 scripts/ollama_embeddings.py- Browser extension Liquid Glass redesign
- Mobile-responsive dashboard
- Export/import functionality
- Bulk operations UI
- Memory clustering visualization
- Natural language query interface
MIT License - see LICENSE for details.
Made in Louisville, KY, with β€οΈ for the AI-native workflow
Stack: PostgreSQL 17 β’ pgvector β’ Ollama β’ Flask β’ Vue 3 β’ Three.js β’ D3.js









