stellar-memory
The scan tool reads a local repository's git history/logs to ingest commits and related context as memories.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@stellar-memory what did we decide about the database schema last session?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Stellar Memory
Persistent AI memory powered by celestial mechanics.
Important memories orbit close to the Sun. Forgotten ones drift to the Oort Cloud.
Stellar Memory is a local-first, persistent memory system for AI assistants. It uses orbital mechanics as a cognitive model -- memories with high importance orbit close to the Sun for instant recall, while stale knowledge naturally drifts outward through exponential decay. No cloud services, no API keys, no data leaving your machine.
Key Features
Orbital Importance Model -- 4-factor scoring (recency, frequency, impact, relevance) maps each memory to an orbital distance from 0.1 to 100 AU
Hybrid Search -- FTS5 keyword search + sqlite-vec KNN vector search, merged via Reciprocal Rank Fusion
Local Embeddings -- all-MiniLM-L6-v2 (384d) runs entirely in-process via
@xenova/transformersCorona Cache -- in-memory tier of up to 200 core memories for sub-millisecond recall
MCP Native -- 16 tools + 1 resource, works with Claude Code, Codex, Claude Desktop, and other MCP clients
REST API -- Hono server on port 21547 with 13 route groups
3D Dashboard -- React + Three.js solar system visualization with D3 orbital overlay
Multi-Project -- isolated memory spaces (galaxies) with cross-project universal memories
Knowledge Graph -- constellation of typed relationships between memories
Temporal Awareness -- time-bounded memories, evolution chains, point-in-time queries
Conflict Detection -- automatic detection of contradicting memories with resolution workflow
Quality Scoring -- specificity, actionability, uniqueness, freshness metrics per memory
Procedural Memories -- auto-discovered behavioral patterns that decay 3.3x slower
Background Daemon -- scheduled orbit recalculation, decay, and consolidation
Zero Dependencies on Cloud -- everything runs locally with
node:sqliteand local embeddings
Related MCP server: Simple Memory MCP
How It Works
importance = 0.30 x recency
+ 0.20 x frequency
+ 0.30 x impact
+ 0.20 x relevance
distance = 0.1 + (1 - importance)^2 x 99.9
. * . . * . . * .
. * . . . .
. CORE (0.1-1 AU) .
. . instant recall . *
* . . . . . . . . . .
. NEAR (1-5 AU) . .
. recently used . * .
. . . . . . . . . . . *
. ACTIVE (5-15 AU) . .
in-context memories . . .
. . . . . . . . . . . . . * .
ARCHIVE (15-40 AU) . .
older knowledge . . .
. . . . . . . . . . . . . . . *
FADING (40-70 AU) . .
losing relevance . . .
. . . . . . . . . . . . . . . . . .
FORGOTTEN (70-100 AU) .
the Oort Cloud -- soft deleted .When you recall a memory, it gets pulled closer to the Sun. When you stop using it, exponential decay pushes it outward. The half-life is 72 hours by default.
Quick Start
Prerequisites
Node.js 22+ (required for built-in
node:sqlite)npm 9+
Install
git clone https://github.com/your-username/stellar-memory.git
cd stellar-memory
npm install
npm run buildUse with Claude Code (MCP)
Add to your Claude Code MCP settings (~/.claude/settings.json or project .claude/settings.json):
{
"mcpServers": {
"stellar-memory": {
"command": "node",
"args": ["/absolute/path/to/stellar-memory/dist/index.js"],
"env": {
"STELLAR_PROJECT": "my-project"
}
}
}
}Then in Claude Code, Stellar Memory automatically:
Reads
stellar://sunto restore working context at session startRecalls relevant memories when topics change
Stores decisions, errors, and milestones as they happen
Commits session state before the conversation ends
Use with Codex
Add this block to ~/.codex/config.toml:
[mcp_servers."stellar-memory"]
command = "node"
args = ["/absolute/path/to/stellar-memory/dist/index.js"]Or use the setup helper:
npx stellar-memory init --codexThat command also installs a Stellar Memory workflow section into the project AGENTS.md so Codex restores context, recalls before guessing, and commits before ending work.
Codex does not support Claude-style session hooks. In Codex, the MCP server still works normally, and the first Stellar tool response can restore saved sun context.
Use with Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"stellar-memory": {
"command": "node",
"args": ["/absolute/path/to/stellar-memory/dist/index.js"],
"env": {
"STELLAR_PROJECT": "my-project"
}
}
}
}Run the Dashboard
# Start the API server
npm run api
# In another terminal, start the web dashboard
cd web && npm run devOpen http://localhost:5175 to see your memories orbiting in 3D.
Run the Background Daemon
npm run daemonThe daemon runs scheduled tasks:
Task | Interval |
Orbit recalculation | 1 hour |
Memory decay | 6 hours |
Consolidation check | 24 hours |
System Requirements
Requirement | Minimum |
Node.js | 22.0.0+ (for |
npm | 9.0.0+ |
Disk | ~100 MB (embedding model) + DB |
RAM | ~200 MB (model + corona cache) |
OS | Windows, macOS, Linux |
The embedding model (~90 MB) downloads automatically on first use and is cached in ~/.cache/huggingface.
Configuration
All configuration is via environment variables:
Variable | Default | Description |
|
| SQLite database file location |
|
| Active project name |
|
| REST API port |
|
| Max tokens for sun context resource |
|
| Hours for 50% recency decay |
|
| Weight for recency in importance formula |
|
| Weight for access frequency |
|
| Weight for memory type impact |
|
| Weight for contextual relevance |
Architecture
Project Structure
src/
engine/ Core: orbit, gravity, corona, embedding, quality, analytics
storage/ database.ts, queries.ts, vec.ts (sqlite-vec)
mcp/ MCP server + tools (memory-tools, ingestion-tools, daemon-tool)
api/ Hono REST server + 12 route modules
scanner/ Filesystem + git log scanners with file parsers
service/ Background daemon + scheduler
utils/ Config, logger, tokenizer, time helpers
web/src/
components/ SolarSystem (Three.js), Layout, SearchBar, MemoryDetail, etc.
api/client.ts REST API client
i18n/ EN/KO internationalization (React Context)
tests/ 15 test files, 252 tests (Vitest)
electron/ Desktop app (Electron 40)Database
SQLite via Node.js built-in node:sqlite with three search layers:
memories table -- structured storage with 20+ columns
memories_fts -- FTS5 virtual table for keyword search
memory_vec -- sqlite-vec virtual table for 384-dimension KNN search
Search Pipeline
Query
|
+---> FTS5 keyword search ----+
| |---> Reciprocal Rank Fusion ---> Re-ranked results
+---> sqlite-vec KNN search --+The hybrid approach handles both exact matches ("JWT authentication error") and semantic matches ("login token expired").
Corona Cache
An in-memory tier holding up to 200 core + near zone memories with a token index for O(1) keyword lookup. The corona mirrors how human System 1 thinking works -- your most important knowledge is always instantly available.
MCP Tools Reference
Tool | Description |
| View memory system state, grouped by orbital zone |
| Hybrid search -- finds memories and pulls them closer |
| Store a new memory with type, impact, and tags |
| Push a memory to the Oort Cloud or permanently delete it |
| Save session state to the Sun (working context) |
| Force recalculation of all orbital positions |
| Ingest a local directory into memories (idempotent) |
| Start/stop/status of the background scheduler |
| Explore the knowledge graph between memories |
| Multi-project management (switch, list, universal memories) |
| System insights: health, topics, survival curves, movements |
| Auto-extract memories from conversation text |
| Find and merge duplicate/similar memories |
| View and resolve contradicting memories |
| Point-in-time queries and memory evolution chains |
| Backup memories as JSON or Markdown |
Resource
URI | Description |
| Current working context (core + near memories within token budget) |
REST API
The API server runs on port 21547 (default) and exposes:
GET /api/health Health check
GET /api/memories List memories (with filters)
POST /api/memories Create a memory
GET /api/memories/:id Get a single memory
PATCH /api/memories/:id Update a memory
DELETE /api/memories/:id Delete a memory
GET /api/sun Get sun state
POST /api/sun/commit Commit session state
POST /api/orbit/recalculate Trigger orbit recalculation
GET /api/constellation/:id Get knowledge graph
GET /api/projects List projects
POST /api/projects Create a project
GET /api/analytics/:report Get analytics report
GET /api/temporal/at Point-in-time query
GET /api/conflicts List conflicts
POST /api/scan Scan a directory
GET /api/sources List data sources
POST /api/observations Submit conversation for observation
POST /api/consolidation Run consolidationDevelopment
# Run MCP server in dev mode (stdio, watch)
npm run dev
# Run API server in dev mode (watch)
npm run api
# Run web dashboard (proxies /api to :21547)
cd web && npm run dev
# Run all tests
npm run test
# Run tests in watch mode
npm run test:watch
# Build everything
npm run build:all
# Build Electron desktop app
npm run electron:packTroubleshooting
"Cannot find module 'node:sqlite'"
You need Node.js 22 or later. The node:sqlite module is a built-in that was added in Node.js 22.
node --version # Must be >= 22.0.0Embedding model download hangs
The all-MiniLM-L6-v2 model (~90 MB) downloads from Hugging Face on first use. If it hangs:
Check your internet connection
Try setting a proxy:
export HTTPS_PROXY=http://your-proxy:portThe model caches to
~/.cache/huggingface-- delete that directory to force re-download
sqlite-vec load failure
The sqlite-vec extension uses a native binary. If it fails to load:
Ensure you ran
npm install(the binary is fetched during install)On some platforms, you may need to build from source -- see sqlite-vec docs
Stellar Memory works without sqlite-vec (falls back to keyword-only search)
"SQLITE_ERROR: database is locked"
Only one process should write to the database at a time. If you're running both the MCP server and API server, they share the same database file and SQLite handles locking. If you see this error:
Check for zombie processes:
ps aux | grep stellarEnsure you're not running multiple MCP server instances
Web dashboard shows no memories
Confirm the API server is running:
curl http://localhost:21547/api/healthConfirm the web dev server proxies correctly (check
web/vite.config.ts)Check browser console for CORS errors
Testing
# Run the full test suite (252 tests)
npm run test
# Run with coverage
npx vitest run --coverage
# Run specific test file
npx vitest run tests/orbit.test.ts
# Web component tests
cd web && npm run testThe test suite uses a virtual module plugin in vitest.config.ts to bridge node:sqlite for Vite's module resolver. This is required because Vite does not natively recognize Node.js built-in modules with the node: prefix.
License
MIT
Available Tools
6 toolscommitC
Save session state (work, decisions, next steps, errors) to the Sun.
Inputs: current_work (required), errors, context, project, +2 more.
forgetC
Push a memory further from the Sun or soft-delete it.
Inputs: id (required), mode.
recallC
Search memories. Matching results are pulled closer to the Sun.
Inputs: query (required), at, type, limit, +3 more.
rememberC
Store a new memory. Auto-placed by type and impact.
Inputs: content (required), tags, type, impact, +2 more.
statusB
View memories grouped by orbital zone.
Inputs: show, zone, limit.
updateA
Edit an existing memory's content, summary, type, tags, or impact. ID and history are preserved.
Inputs: id (required), tags, type, impact, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
The tools mostly have distinct roles: remember stores, recall searches, update edits, forget soft-deletes, status views grouped memories, and commit saves session state. There is slight overlap between commit and remember since both store memories, but the session-state specialization makes the boundary clear enough.
Five of six tools use simple verb names (commit, recall, remember, forget, update), which is consistent and readable. The noun 'status' is a minor deviation from the verb pattern.
Six tools are well scoped for a memory-management server, covering storage, search, update, deletion, viewing, and session commits. Each tool has a clear place without bloating the surface.
The core memory lifecycle is well covered: create, search/read, update, soft-delete, view, and session commit. There is no permanent delete or explicit get-by-ID operation, but these are minor gaps for the stated purpose.
Maintenance
Related MCP Connectors
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI assistants: store, search, and connect knowledge across conversations.
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Persistent memory for AI agents. Semantic search, memory graph, W3C DID identity.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.3-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to store and retrieve persistent memories with a web management interface. Supports creating, searching, and managing memories through natural language commands or a visual web dashboard.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with persistent memory across sessions using local SQLite and keyword search, allowing storage and retrieval of user preferences, project context, and decisions.13 npm10MIT
- FlicenseNot gradedqualityBmaintenanceProvides AI agents with persistent, searchable local memory using hybrid search, temporal knowledge graphs, GraphRAG, and automatic compression and classification so assistants can recall project context across sessions while reducing token usage.18-