Local-first fact memory kernel workspace (v1).
localmemos is a local-first fact memory kernel for personal AI agents. The current repository represents a v1 MVP focused on explicit fact writes, exact retrieval, time-aware history, and thin access adapters rather than a heavy memory operating system.
Deeper design and implementation context lives under docs/superpowers/. This README is the short operational entry point for continuing work on the repository.
Supported in v1:
- Rust
memory-coreas the single source of truth for memory semantics - SQLite-backed fact storage
- explicit fact writes via
upsert_fact - exact recall and structured filtering
- FTS fallback for text recall
- time-aware history and
as_ofrecall - HTTP, Python, Node, and MCP access paths
Out of scope for v1:
- automatic memory extraction
- vector retrieval and vector databases
- graph-native memory and graph reasoning
- cloud sync
- multi-user or multi-tenant support
- reflective, episodic, emotional, or procedural memory systems
v1 is considered complete only when all of the following remain true:
- scope stays within current
v1boundaries (no automatic extraction, vector-first retrieval, graph-native memory, or cloud/multi-tenant expansion) memory-coreremains the single semantic source of truth for write/recall/history behavior- HTTP/Python/Node/MCP adapters remain thin and semantically aligned with core primitives
- required verification commands pass in order:
cargo test --workspace./.venv/bin/pytest python/tests -qcorepack pnpm --dir packages/node testcorepack pnpm --dir packages/mcp test
Use the role path that best matches your current change. If unsure, start with Clean-Run Verifier, then apply Failure Triage Rule.
- Use this path when: editing README commands, setup wording, or workflow guidance without code behavior changes.
- Read first:
Verification Path,When To Re-Validate Commands,Minimum Regression Order,Failure Triage Rule. - Run at minimum:
Minimum Regression Orderafter command-bearing doc edits. - Escalate when: a README command no longer matches repository reality (documentation drift).
- Use this path when: changing
crates/memory-corewrite/recall/history semantics. - Read first:
Current Dev Workflow NotesandRepository Layout(memory-coreremains semantic source of truth). - Run at minimum: full
Minimum Regression Order, keeping command order unchanged. - Escalate when: tests fail with valid commands and stable environment (code regression).
- Use this path when: changing HTTP/Python/Node/MCP adapter layers without redefining
memory-coresemantics. - Read first:
Repository Layout,Verification Path, andFailure Triage Rule. - Run at minimum: full
Minimum Regression Order; adapters must stay aligned with core semantics. - Escalate when: adapter behavior diverges from core semantics or verification fails after environment recovery.
- Use this path when: validating local machine state, onboarding, or recovering from inconsistent setup.
- Read first:
First-Time Setup,Clean-Run Checklist (macOS + Linux),Clean-Run Validation Matrix (macOS + Linux). - Run at minimum:
Verification Pathin listed order from repository root. - Escalate when: matrix recovery cannot restore a clean run, then classify via
Failure Triage Rule.
Pick one row, start from the linked section, then run the minimum command action.
| If your change is... | Use role path | Start here | Minimum command action |
|---|---|---|---|
| README command or workflow wording updates | Docs Maintainer |
When To Re-Validate Commands + Minimum Regression Order |
Run Minimum Regression Order after command-bearing edits |
memory-core write/recall/history semantics |
Core Semantics Maintainer |
Current Dev Workflow Notes + Verification Path |
Run full four-command sequence in listed order |
| HTTP/Python/Node/MCP adapter-layer updates | Adapter Surface Maintainer |
Repository Layout + Verification Path |
Run full four-command sequence in listed order |
| Local setup/onboarding/recovery checks | Clean-Run Verifier |
First-Time Setup + Clean-Run Validation Matrix (macOS + Linux) |
Run Verification Path from repository root |
Minimum command set (same as Verification Path and Minimum Regression Order):
cargo test --workspace
./.venv/bin/pytest python/tests -q
corepack pnpm --dir packages/node test
corepack pnpm --dir packages/mcp testIf role selection or failure classification is unclear, apply Failure Triage Rule.
Use this table to pick first-pass checks from touched areas. Before closing a round, run full Minimum Regression Order.
| If you changed... | First-pass checks | Then |
|---|---|---|
README.md or docs-only workflow wording |
cargo test --workspace |
Run full Minimum Regression Order before closure |
crates/memory-core/** |
cargo test --workspace |
Then run ./.venv/bin/pytest python/tests -q, corepack pnpm --dir packages/node test, corepack pnpm --dir packages/mcp test |
crates/memory-http/** |
cargo test --workspace |
Then run ./.venv/bin/pytest python/tests -q and full Minimum Regression Order |
python/** |
./.venv/bin/pytest python/tests -q |
Then run full Minimum Regression Order |
packages/node/** |
corepack pnpm --dir packages/node test |
Then run corepack pnpm --dir packages/mcp test and full Minimum Regression Order |
packages/mcp/** |
corepack pnpm --dir packages/mcp test |
Then run full Minimum Regression Order |
| mixed or unclear multi-surface changes | run full Minimum Regression Order immediately |
Classify failures with Failure Triage Rule |
If scope is unclear or failure classification is ambiguous at any point, apply Failure Triage Rule and use full Minimum Regression Order.
Use this checklist for each closure round and for final v1 release preparation:
- Run the four required verification commands in order.
- If any step fails, apply
Failure Triage Rulebefore making more changes. - Keep commit sequence explicit:
spec -> plan -> implementation. - Push
mainafter verification and commit checks pass. - Create and push stable tag using
v1.x-docs-stablenaming.
crates/memory-core: core storage, write semantics, recall semantics, and history logiccrates/memory-http: HTTP adapter for local process-external accesscrates/memory-node: native Node binding layerpackages/node: Node SDK wrapper over the native bindingpackages/mcp: MCP adapter built on top of the Node SDKpython: Python binding and SDK surfacetools/locomo: LoCoMo retrieval evaluation scripts and regression gatedocs/superpowers: design, planning, and project workflow documents
You will need:
- Rust toolchain
- Python 3.10+ with virtual environment support
- Node.js
- Corepack
Run this once after cloning:
python3 -m venv .venv
./.venv/bin/python -m pip install -U pip pytest maturin
./.venv/bin/python -m pip install -e python
corepack enable
corepack pnpm --dir packages/node install
corepack pnpm --dir packages/mcp install- Python tests run from
./.venv. - Install the local Python package into the venv before running pytest.
- Node and MCP packages manage dependencies independently.
- Run commands from the repository root (the directory that contains
README.mdandCargo.toml). - Ensure
.venvexists, use explicit./.venv/bin/...calls, and confirm editable install with./.venv/bin/python -m pip install -e python. - Ensure
corepack enablehas been run in your shell. - Ensure dependencies are installed for both
packages/nodeandpackages/mcp. - Run all four verification commands in order.
- All commands in this README assume the repository root as working directory.
- If local state looks inconsistent, rerun First-Time Setup commands before deeper debugging.
Run these checks for a healthy local state:
cargo test --workspace
./.venv/bin/pytest python/tests -q
corepack pnpm --dir packages/node test
corepack pnpm --dir packages/mcp testIf all four commands pass, the Rust core and Python/Node/MCP access surfaces are in sync locally.
Use repository-owned scripts for retrieval-focused V2 tracking:
tools/locomo/baseline.sh 5
tools/locomo/qa-proxy.sh 5
tools/locomo/official-like-eval.sh 5
tools/locomo/run-regression-gate.sh 5
tools/locomo/run-category-gate.sh 5
tools/locomo/run-full-gate.sh 5
tools/locomo/refresh-failure-samples.sh 5 80
./.venv/bin/python tools/locomo/evaluate-single-knob.py- Scripts write artifacts to
/tmpby default (orBASE_DIRwhen provided). run-regression-gate.shdefault threshold ishit@5 >= 0.55(second arg can override).run-category-gate.shalso checks default category floors formulti-hopandopen-domain.run-full-gate.shruns baseline threshold checks, drift checks, and the required 4-command matrix in one command.evaluate-single-knob.pyenforces an auto-stop rule: only recommend a change when bothoverallandmulti-hopimprove; otherwise outputNO-OP.- CI gate workflow
.github/workflows/locomo-full-gate.ymlrunsREBUILD_PYTHON=0 tools/locomo/run-full-gate.sh 5on PRs and pushes tomain(plus manual dispatch), and uploads gate artifacts. - If LoCoMo scores unexpectedly remain old, rebuild local Python binding:
./.venv/bin/python -m pip install -e python
Run Minimum Regression Order at least once after any of the following:
- dependency manifest or lockfile changes (Rust/Python/Node)
- Rust/Python/Node runtime or toolchain updates
- edits to command-bearing sections in this README
- crate or package changes that affect build/test surfaces
This is the minimum default order for command drift checks. Expand it for broader change sets.
cargo test --workspace
./.venv/bin/pytest python/tests -q
corepack pnpm --dir packages/node test
corepack pnpm --dir packages/mcp test- If a README command no longer matches repository reality, treat it as documentation drift and update README.
- If commands are valid but local machine state is inconsistent, treat it as an environment issue and apply matrix recovery.
- If commands are valid and environment is stable but tests fail, treat it as a code regression and escalate.
First-Time Setup remains the source of truth for command order. This matrix is a pass/fail and quick-recovery overlay for each command.
| Command | Expected Result | If Failed | Quick Recovery |
|---|---|---|---|
python3 -m venv .venv |
.venv directory is created with no error output |
.venv not created or Python venv error |
Verify Python 3.10+ is available (python3 --version), then rerun from repository root |
./.venv/bin/python -m pip install -U pip pytest maturin |
pip exits successfully and packages are installed/updated | network or package install error | Retry command; if pip is broken, recreate .venv and rerun First-Time Setup |
./.venv/bin/python -m pip install -e python |
memory-sdk installs successfully in editable mode |
memory_sdk remains unavailable in tests |
Rerun command from repository root and confirm python/pyproject.toml exists |
corepack enable |
command exits successfully with no error | corepack not found or permission error | Ensure Node.js includes Corepack, restart shell, rerun command |
corepack pnpm --dir packages/node install |
Node package dependencies install without error | install fails or lockfile/dependency resolution issue | Rerun from repository root; if still failing, remove package cache artifacts and rerun install |
corepack pnpm --dir packages/mcp install |
MCP package dependencies install without error | install fails or lockfile/dependency resolution issue | Rerun from repository root; if still failing, remove package cache artifacts and rerun install |
cargo test --workspace |
all Rust workspace tests pass | compile/test failure in Rust workspace | Run cargo clean and rerun; confirm Rust toolchain is installed and on PATH |
./.venv/bin/pytest python/tests -q |
pytest reports all tests passed | ModuleNotFoundError or Python test failure |
Rerun ./.venv/bin/python -m pip install -e python, then rerun pytest |
corepack pnpm --dir packages/node test |
vitest reports Node tests passed | native build/test failure in Node package | Rerun corepack pnpm --dir packages/node install, then rerun test |
corepack pnpm --dir packages/mcp test |
vitest reports MCP tests passed | native build/test failure in MCP package | Rerun corepack pnpm --dir packages/mcp install, then rerun test |
| Symptom | Likely Cause | Minimal Fix |
|---|---|---|
ModuleNotFoundError: memory_sdk when running pytest |
Local editable install is missing or stale | Use the matrix row for ./.venv/bin/python -m pip install -e python and then rerun pytest |
pnpm: command not found or Corepack error |
Corepack not enabled in current shell | Use the matrix row for corepack enable, then rerun package install rows |
| Test commands fail with missing files or wrong paths | Commands executed outside repository root | cd <your-localmemos-path> and rerun from the matrix starting at the failed row |
| Tests fail after dependency updates or environment changes | Stale local artifacts in .venv, target, or package build outputs |
Run cargo clean, recreate .venv, then rerun matrix rows from venv creation onward |
| Native build fails with Rust toolchain not found | Rust toolchain is missing or not on PATH |
Install Rust via rustup, confirm cargo --version, then rerun matrix rows for install + test |
- Python SDK: embedded local access from Python agents and tools
- Node SDK: embedded local access from Node tools
- HTTP: process-external local integration path
- MCP: tool-based integration for agent environments
memory-coreis the single semantic source of truth for write, recall, and history behavior.- Thin adapters should follow core semantics rather than redefining them.
- This repository remains intentionally scoped as
v1 MVP. RecallRequest.include_historyis reserved for compatibility inv1and is currently ignored by core recall logic.GET /facts/{id}/historyexpects{id}to be a storedfacts.idrow id returned by write/read APIs, and resolves it to the full logical fact version chain.v1does not include automatic extraction, vector retrieval, vector databases, or graph-native memory features.