Enterprise-grade semantic memory system for LLM applications on macOS
π macOS-only | π€ MCP-driven | π 100% Local & Private | βοΈ iCloud Sync Between Your Macs
- π 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
- π Cross-Mac Sync: Bidirectional sync between multiple macOS systems via iCloud
- β‘ Real-time Updates: PostgreSQL WAL monitoring for instant sync triggering
- π€ MCP Integration: Native Model Context Protocol server for Claude Desktop and other compatible frameworks.
- π Privacy-First: All embeddings generated locally, no external API calls
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 | 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)
Total install time: ~5 minutes
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
flowchart LR
subgraph Mac1[Mac #1]
DB1[(PostgreSQL)]
D1[Dashboard]
DB1 --- D1
end
subgraph Mac2[Mac #2]
DB2[(PostgreSQL)]
D2[Dashboard]
DB2 --- D2
end
subgraph Sync[iCloud Drive]
T[Transport]
end
DB1 <--> T
T <--> DB2
| 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 |
| Sync Engine | PostgreSQL | Bidirectional cross-Mac sync |
| 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://YOUR_USERNAME@localhost:5432/longterm_memory",
"SYSTEM_CONTEXT": "PostgreSQL memory for user-specific data. Query at conversation start for context."
}
}
}
}Supported Clients: Claude Desktop, Claude Code, Cursor, Continue.dev, Windsurf, Cline, Roo-Cline, Google Gemini CLI
π 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
# Manual sync between Macs
./scripts/sync_databases.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 tasks and sleepwatcher for wake-triggered sync.
| Job | Schedule | Purpose |
|---|---|---|
| Embeddings | 4:00 AM, 4:00 PM | Generate vectors for new observations |
| Backup | 4:20 AM, 4:20 PM | Local database backup with 7-day retention |
| Database Sync | 8 AM, 12 PM, 6 PM, 11 PM | Bidirectional M1βM3 sync via iCloud |
| Wake Sync | On wake from sleep | Sync database when Mac wakes |
Located in ~/Library/LaunchAgents/:
| File | Description |
|---|---|
com.longtermmemory.embeddings.plist |
Ollama embedding generation |
com.longtermmemory.backup.plist |
Database backup |
com.longtermmemory.dbsync.plist |
Cross-device database sync |
homebrew.mxcl.sleepwatcher |
Wake/sleep event handler |
Uses sleepwatcher to trigger database sync when your Mac wakes:
# Install sleepwatcher (one-time)
brew install sleepwatcher
brew services start sleepwatcher
# Wake/sleep scripts (created automatically by installer)
~/.wakeup # Runs sync_databases.sh on wake
~/.sleep # Logs sleep events# View all longterm-memory services
launchctl list | grep longterm
# Reload a service after editing its plist
launchctl unload ~/Library/LaunchAgents/com.longtermmemory.dbsync.plist
launchctl load ~/Library/LaunchAgents/com.longtermmemory.dbsync.plist
# Check sleepwatcher status
brew services info sleepwatcher
# View sync logs
tail -f ~/Documents/GitHub/longterm-memory-macos/logs/db_sync.log
tail -f ~/Documents/GitHub/longterm-memory-macos/logs/wake_sync.logOn macOS Tahoe (15.x), the sync script uses Finder via osascript to write to iCloud Drive, bypassing TCC (Transparency, Consent, and Control) restrictions.
First run: macOS will prompt for Finder automation permission. Click Allow to enable automatic sync.
Why osascript/Finder? Direct cp commands to iCloud fail under TCC when run from launchd. Finder has native iCloud access and bypasses these restrictions.
Troubleshooting: If you still see "Operation not permitted" errors:
- Check System Settings β Privacy & Security β Automation β Ensure your terminal has Finder access
- Optionally move the script to
~/.local/bin/(outside the Documents folder)
-- 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| Metric | Value |
|---|---|
| Semantic Search | ~50ms per query |
| Dashboard Load | <500ms |
| Graph Render (3D) | ~2s for 500 nodes |
| Graph Render (2D) | ~1s for 500 nodes |
| Cross-Mac Sync | ~10s end-to-end |
| Memory Usage | ~200MB |
- 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









