waypath
[!TIP] 新手?快速入门指南可让你在约 60 秒内从
npm install到完成首次持久化代理会话。
什么是 Waypath?
Waypath 是一个面向编码代理和独立开发者的本地优先知识引擎。它将你的项目决策、实体关系和会话工件存储在一个 SQLite 文件中,然后通过一个轻量级 CLI 为任何代理宿主(Claude Code、Codex 或 MCP 客户端)提供图感知、真理优先的上下文。
与云内存服务不同,Waypath:
完全在你的机器上运行,
拥有规范的真理模式而非向量块,
将每一条记忆视为一等公民,并具备显式的提升 + 审查门控,
提供一个 77 kB 的 npm 包,无需任何运行时服务。
Related MCP server: wadachi
为什么选择 Waypath?
问题 | Waypath 的解决方案 |
代理在会话间遗忘 | 持久化 SQLite 真理内核 |
RAG 返回不相关的块 | FTS5 + RRF 混合排名与图扩展 |
内存服务产生静默幻觉 | 显式的 |
云锁定、数据泄露 | 一切都是你拥有的本地 |
每个宿主一个工具 (Claude, Codex, Cursor) | 单一外观、轻量宿主垫片、原生 MCP 服务器 |
安装
[!IMPORTANT] 需要 Node.js ≥ 22。Node 22.5+ 启用了原生的
node:sqlite驱动;较早的 22.x 版本会自动回退到better-sqlite3。
npm install -g waypath验证:
waypath --help
waypath source-status --json快速入门
1. 引导会话 (Codex 示例):
waypath codex --json \
--project my-project \
--objective "ship v2 of the retrieval pipeline" \
--task "refactor hybrid ranker" \
--store-path ~/.waypath/my-project.db2. 召回相关上下文:
waypath recall --query "hybrid ranker decisions" --json3. 捕获提炼出的见解并通过审查进行提升:
waypath page --subject "hybrid ranker v2 design"
waypath promote --subject "hybrid ranker v2 design"
waypath review-queue --json4. 作为 MCP 服务器运行 (适用于 Claude Code、Cursor、任何 MCP 客户端):
waypath mcp-server --store-path ~/.waypath/my-project.db查看实际操作
$ 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"
]
}
}命令界面
区域 | 命令 |
会话引导 |
|
召回 |
|
页面 (提炼的知识) |
|
审查治理 |
|
导入 / 扫描 |
|
健康状况 |
|
维护 |
|
完整帮助:waypath --help。
架构
Waypath 由轻量级外观后的四个独立内核构建而成:
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真理内核 — 规范决策、实体、偏好、时间有效性(模式 v3,支持取代 + 历史记录)。
归档内核 — 带有内容哈希去重和 FTS5 全文索引的原始证据存储。
本体层 — 用于实体/决策上下文扩展的图遍历(模式:
project_context,person_context,system_reasoning,contradiction_lookup)。提升引擎 — 候选审查、矛盾检测、取代流程。
单个 createFacade() 公开了 14 个动词。宿主垫片将其适配到每个代理的引导协议中。
配置
Waypath 默认零配置。要调整检索权重、适配器开关或审查阈值,请在工作目录中放入一个 config.toml(或将 WAYPATH_CONFIG_PATH 指向它):
[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通过环境变量覆盖任何内容:
export WAYPATH_RECALL_WEIGHT_SOURCE_SYSTEM_TRUTH_KERNEL=1.8
export WAYPATH_REVIEW_QUEUE_LIMIT=8优先级: 环境变量覆盖 > config.toml > 内置默认值。
MCP 服务器
Waypath 将原生 MCP (Model Context Protocol) 服务器作为第二个二进制文件发布:
waypath-mcp-server或者通过主 CLI:
waypath mcp-server --store-path ~/.waypath/project.db通过 MCP 公开的工具:recall, page, promote, review, graph-query, source-status。
要求
Node.js ≥ 22.0 (必需)
推荐 Node.js ≥ 22.5 — 启用原生
node:sqlitebetter-sqlite3是一个可选的回退方案,在 22.0–22.4 或无法使用原生 sqlite 的情况下自动使用
状态
版本: 0.1.0 — 首次公开发布
测试: 131 个通过(单元 + 集成 + 基准测试)
稳定界面: CLI (26 个命令), MCP 服务器, 外观 API
延期: 托管部署、多用户同步、自适应排名反馈
与替代方案对比
Waypath | 云内存 (mem0, zep) | 仅向量 RAG | |
本地优先 | ✓ | ✗ | 取决于实现 |
规范真理模式 | ✓ | ✗ | ✗ |
图感知召回 | ✓ | 部分 | ✗ |
显式审查门控 | ✓ | ✗ | ✗ |
内置 MCP 服务器 | ✓ | ✗ | ✗ |
单文件安装 | ✓ | 需要服务 | 不一 |
贡献
Waypath 欢迎宿主垫片、源适配器和错误修复。好的首个议题已相应标记。
阅读 CONTRIBUTING.md 以了解开发设置、代码风格和 PR 流程。
在提交 PR 之前:
npm run build
npm test许可证
MIT © TheStack.ai — 参见 LICENSE。
Available Tools
11 toolswaypath_graph_queryA
Read-only traversal of the Waypath knowledge graph from a specific entity id. Returns neighbors, edges, and related facts using one of four traversal patterns. Use this when you already have a resolved entity id (from waypath_recall results or from prior context); for free-text lookup use waypath_recall instead. Does not write to the database.
Inputs: entityId (required), pattern.
waypath_healthA
Read-only end-to-end health check: SQLite connectivity and migration version, FTS5 index sync status, source adapter probe results, and truth-kernel row counts. Safe to call any time and from any context. Use as a single diagnostic entrypoint before opening a support issue; for adapter-specific detail call waypath_source_status. Takes no parameters.
Inputs: no named parameters.
waypath_pageA
Synthesize a human-readable knowledge page about a subject by aggregating and summarizing matching truth-kernel and archive entries. Returns a structured page object plus a markdown summary. The synthesis is deterministic for a given store state and does not call out to any LLM or network service. Read-only with respect to promoted memory; may cache synthesis artifacts in the local store. Use for briefings or handoffs when a recall result would be too fragmented; for targeted lookup use waypath_recall instead.
Inputs: subject (required).
waypath_promoteA
WRITE: submit a candidate for promotion into the Waypath truth-kernel. Creates a new candidate row in the local SQLite review queue — it does NOT promote immediately. A human (or agent with explicit authority) must call waypath_review to accept or reject the candidate before it becomes queryable by waypath_recall. Use when you want to persist a decision, preference, or fact; use waypath_review_queue to list pending candidates and waypath_review to act on them.
Inputs: subject (required).
waypath_recallA
Read-only hybrid search over the local Waypath SQLite memory store. Runs FTS5 lexical search fused with graph-aware Reciprocal Rank Fusion (RRF) across truth-kernel and archive tables and returns ranked entries with source, score, and snippet. Use before answering any question that may depend on prior decisions, preferences, or project facts; call this instead of waypath_graph_query when you have a free-text query rather than a known entity id. Does not write to the database and does not hit the network.
Inputs: query (required).
waypath_refresh_pageA
WRITE: rebuild an existing knowledge page against the current store state and update its cached summary/markdown. Use on pages flagged "stale" by waypath_review_queue, or after a large batch of promotions that should be reflected in a briefing page. Idempotent — calling twice with no intervening writes produces the same output. Does not call any external service.
Inputs: pageId (required).
waypath_resolve_contradictionA
WRITE: resolve a detected contradiction between two or more preferences sharing the same key by keeping exactly one preference and marking the others as superseded. Intended for user-scoped or project-scoped preference collisions surfaced by waypath_review_queue. Use waypath_review_queue first to see active contradictions and their preference ids. This call persists to the local store and is the destructive side of contradiction handling — the non-kept preferences are no longer returned by waypath_recall.
Inputs: key (required), keepPreferenceId (required), scopeRef, notes.
waypath_reviewA
WRITE: decide the fate of a pending promotion candidate. Setting status to "accepted" promotes the candidate into the truth-kernel so it becomes visible to waypath_recall; "rejected" discards it; "superseded" marks it as replaced by a newer candidate; the other states are non-terminal holding states. This call is the governance gate between waypath_promote and durable memory — do not accept without evidence. Call waypath_review_queue first to list candidates and their ids.
Inputs: candidateId (required), status (required), notes.
waypath_review_queueA
Read-only snapshot of everything awaiting human attention: pending promotion candidates, stale knowledge pages past their refresh threshold, and detected preference contradictions. Use at the start of a review or maintenance session to see outstanding work; then call waypath_review, waypath_refresh_page, or waypath_resolve_contradiction as appropriate. Takes no parameters.
Inputs: no named parameters.
waypath_session_startA
Read-only context pack builder for the beginning of a coding or planning session. Assembles a prioritized brief from recent decisions, active preferences, seed entities, and related graph context. Does not write to the database. Call once per session before substantive work; for mid-session lookups use waypath_recall or waypath_graph_query instead. All parameters are optional — pass what is known; omitted fields fall back to project defaults.
Inputs: project, objective, activeTask, seedEntities.
waypath_source_statusA
Read-only probe of the local source adapters Waypath can ingest from (filesystem snapshots, git repos, JCP live reader, etc.). Returns each adapter's availability, last-scan timestamp, and any configuration errors. Use to diagnose "why is my recall empty" or before running a large ingest. Does not write and does not hit the network. Takes no parameters.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose. For example, waypath_recall is for free-text search while waypath_graph_query is for entity-based traversal; waypath_promote, waypath_review, and waypath_review_queue form a distinct workflow. Descriptions clearly differentiate overlapping tools.
All tools start with 'waypath_' and use snake_case. Most follow a verb_noun pattern (e.g., refresh_page, resolve_contradiction), but a few like session_start and source_status are noun_verb or noun_noun. Overall consistent enough for predictable navigation.
With 11 tools, the set is well-scoped for a knowledge management system. It covers query, search, page generation, promotion workflow, health checks, and session context without being bloated or too sparse.
Major workflows are covered: submit candidates (waypath_promote), review (waypath_review, waypath_review_queue), retrieve (waypath_recall, waypath_graph_query), and page synthesis (waypath_page, waypath_refresh_page). Minor gaps include no explicit delete tool, but rejection and superseding serve similar purposes.
Maintenance
Related MCP Connectors
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Persistent memory layer for AI tools. Save and recall notes across Claude and other MCP clients.
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal-first knowledge base that ingests activity from Slack, GitHub, agent sessions, and CLI, stores provenance in SQLite, and exposes the brain via MCP, CLI, Slack, and dashboard for recall and skill proposals.MIT
- AlicenseBqualityCmaintenancePersistent memory for AI agents built on the LLM Wiki pattern: a plain-Markdown brain (also a valid Obsidian vault) with SQLite metadata, local semantic search via fastembed (no API keys), one-call session context with project auto-detection, and a decision log with rationale. Works with Claude Code, Claude Desktop, Cursor, and any MCP client.31MIT
- AlicenseAqualityBmaintenanceGives every AI agent on a machine a shared, local-first long-term memory: 16 tools to save, search, edit and organize structured notes in one SQLite file, with attribution per client. Runs over stdio or localhost HTTP, so Claude Code, omp and any other MCP client recall the same facts, decisions and entities.162MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code, Codex and other MCP agents to share one bounded, persistent memory across sessions, so a session starts from what earlier sessions learned instead of re-reading the repository. Storage and retrieval run locally on SQLite full-text search with per-client tokens and scopes, and optional local model enrichment, without any paid model in the path.1MIT