waypath
Local-first external brain for Claude Code, Codex, and any MCP client. Stores decisions, entities, and session artifacts in one SQLite file and exposes MCP tools for recall, page, promote, review, graph-query, and source-status.
README
<p align="right"> <strong>English</strong> · <a href="./README.ko.md">한국어</a> · <a href="./README.zh.md">中文</a> </p>
<p align="center"> <img src="https://raw.githubusercontent.com/TheStack-ai/waypath/main/docs/media/waypath-banner.png" alt="Waypath — local-first external brain for coding agents" width="760" /> </p>
<p align="center"> <strong>Local-first external brain for coding agents.</strong><br/> A SQLite-backed CLI that gives Claude Code, Codex, and any MCP client persistent context, graph-aware recall, and governed memory — with <em>zero cloud dependencies</em>. </p>
<p align="center"> <a href="https://www.npmjs.com/package/waypath"><img src="https://img.shields.io/npm/v/waypath.svg?color=blue&label=npm" alt="npm version" /></a> <a href="./LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a> <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen.svg" alt="Node.js" /></a> <img src="https://img.shields.io/badge/tests-131%20passing-brightgreen.svg" alt="Tests" /> <a href="https://www.npmjs.com/package/waypath"><img src="https://img.shields.io/npm/dm/waypath.svg?color=blue&label=downloads" alt="npm downloads" /></a> <a href="https://github.com/TheStack-ai/waypath/stargazers"><img src="https://img.shields.io/github/stars/TheStack-ai/waypath?style=flat&color=yellow" alt="GitHub stars" /></a> </p>
[!TIP] New here? The Quick start gets you from
npm installto your first persistent agent session in about 60 seconds.
What is Waypath?
Waypath is a local-first knowledge engine for coding agents and solo developers. It stores your project decisions, entity relationships, and session artifacts in a single SQLite file, then serves graph-aware, truth-first context to any agent host — Claude Code, Codex, or an MCP client — through a thin CLI.
Unlike cloud memory services, Waypath:
- runs entirely on your machine,
- owns a canonical truth schema instead of a vector blob,
- treats every memory as first-class with explicit promotion + review gates,
- ships a 77 kB npm package with no required runtime services.
Why Waypath?
| Problem | Waypath's answer |
|---|---|
| Agents forget across sessions | Persistent SQLite truth kernel |
| RAG returns irrelevant chunks | FTS5 + RRF hybrid ranking with graph expansion |
| Memory services hallucinate silently | Explicit page → promote → review governance |
| Cloud lock-in, data exfiltration | Everything is one local .db file you own |
| Tool per host (Claude, Codex, Cursor) | Single facade, thin host shims, native MCP server |
Install
[!IMPORTANT] Requires Node.js ≥ 22. Node 22.5+ unlocks the native
node:sqlitedriver; earlier 22.x versions auto-fall back tobetter-sqlite3.
npm install -g waypath
Verify:
waypath --help
waypath source-status --json
Quick start
1. Bootstrap a session (Codex example):
waypath codex --json \
--project my-project \
--objective "ship v2 of the retrieval pipeline" \
--task "refactor hybrid ranker" \
--store-path ~/.waypath/my-project.db
2. Recall relevant context:
waypath recall --query "hybrid ranker decisions" --json
3. Capture a distilled insight and promote it through review:
waypath page --subject "hybrid ranker v2 design"
waypath promote --subject "hybrid ranker v2 design"
waypath review-queue --json
4. Run as an MCP server (for Claude Code, Cursor, any MCP client):
waypath mcp-server --store-path ~/.waypath/my-project.db
See it in action
$ waypath codex --json --project auth-service \
--objective "migrate to passkeys" --task "design flow"
{
"host": "codex",
"session_id": "auth-service:passkey-flow",
"context_pack": {
"truth_highlights": {
"decisions": [
"Use WebAuthn level 2 with user verification required",
"Argon2id for password fallback hashing"
],
"entities": ["UserSession", "AuthGateway", "RefreshToken"],
"contradictions": []
},
"recent_pages": [
"Session storage design — promoted 2026-04-12"
]
}
}
Command surface
| Area | Commands |
|---|---|
| Session bootstrap | codex, claude-code, mcp-server |
| Recall | recall, explain, graph-query, history |
| Pages (distilled knowledge) | page, promote, refresh-page, inspect-page |
| Review governance | review, review-queue, inspect-candidate, resolve-contradiction |
| Import / scan | import-seed, import-local, scan |
| Health | source-status, health, db-stats, rebuild-fts |
| Maintenance | backup, benchmark, export |
Full help: waypath --help.
Architecture
Waypath is built from four independent kernels behind a thin facade:
flowchart TD
subgraph HOST[" Host Shims "]
direction LR
CX["codex"]
CC["claude-code"]
MC["mcp-server"]
end
Facade["<b>Facade</b><br/><code>createFacade()</code>"]
TK["<b>Truth Kernel</b><br/>decisions · entities · preferences<br/>temporal validity · supersede"]
AK["<b>Archive Kernel</b><br/>evidence · content-hash dedup<br/>FTS5 index"]
ON["<b>Ontology</b><br/>graph traversal<br/>pattern expansion"]
PR["<b>Promotion Engine</b><br/>candidate review<br/>contradiction detection"]
HOST --> Facade
Facade --> TK
Facade --> AK
Facade --> ON
Facade --> PR
classDef kernel fill:#21262d,color:#c9d1d9,stroke:#30363d,stroke-width:1px
classDef facade fill:#1f6feb,color:#ffffff,stroke:#58a6ff,stroke-width:2px
classDef host fill:#161b22,color:#c9d1d9,stroke:#30363d,stroke-width:1px
class TK,AK,ON,PR kernel
class Facade facade
class CX,CC,MC host
- Truth kernel — canonical decisions, entities, preferences, temporal validity (schema v3 with supersede + history).
- Archive kernel — raw evidence store with content-hash dedup and FTS5 full-text index.
- Ontology layer — graph traversal for entity/decision context expansion (patterns:
project_context,person_context,system_reasoning,contradiction_lookup). - Promotion engine — candidate review, contradiction detection, supersede flows.
A single createFacade() exposes 14 verbs. Host shims adapt it to each agent's bootstrap protocol.
Configuration
Waypath is zero-config by default. To tune retrieval weights, adapter toggles, or review thresholds, drop a config.toml in your working directory (or point WAYPATH_CONFIG_PATH at one):
[source_adapters]
jarvis-memory-db = true
jarvis-brain-db = false
[retrieval.source_system_weights]
truth-kernel = 1.2
[retrieval.source_kind_weights]
decision = 0.9
memory = 0.5
[review_queue]
limit = 12
Override anything via env vars:
export WAYPATH_RECALL_WEIGHT_SOURCE_SYSTEM_TRUTH_KERNEL=1.8
export WAYPATH_REVIEW_QUEUE_LIMIT=8
Priority: env override > config.toml > built-in defaults.
MCP server
Waypath ships a native MCP (Model Context Protocol) server as a second binary:
waypath-mcp-server
Or via the main CLI:
waypath mcp-server --store-path ~/.waypath/project.db
Tools exposed via MCP: recall, page, promote, review, graph-query, source-status.
Requirements
- Node.js ≥ 22.0 (required)
- Node.js ≥ 22.5 recommended — unlocks native
node:sqlite better-sqlite3is an optional fallback auto-used on 22.0–22.4 or where native sqlite is unavailable
Status
- Version: 0.1.0 — first public release
- Tests: 131 passing (unit + integration + benchmark)
- Stable surface: CLI (26 commands), MCP server, facade API
- Deferred: hosted deployment, multi-user sync, adaptive ranking feedback
Compared to alternatives
| Waypath | Cloud memory (mem0, zep) | Vector-only RAG | |
|---|---|---|---|
| Local-first | ✓ | ✗ | depends |
| Canonical truth schema | ✓ | ✗ | ✗ |
| Graph-aware recall | ✓ | partial | ✗ |
| Explicit review gate | ✓ | ✗ | ✗ |
| MCP server built-in | ✓ | ✗ | ✗ |
| One-file install | ✓ | needs service | varies |
Contributing
Waypath welcomes host shims, source adapters, and bug fixes. Good first issues are labeled accordingly.
Read CONTRIBUTING.md for dev setup, code style, and PR flow.
Before submitting a PR:
npm run build
npm test
License
MIT © TheStack.ai — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。