Skip to main content
Glama
蓝汐 · 潮汐认知图谱

蓝汐 · 潮汐认知图谱

by A16Nights

蓝汐 · 潮汐认知图谱(Lanxi Memory)

简体中文 | English

Local-first, zero-dependency cognitive graph memory plugin for Antigravity — 5-layer Markdown vault + CJK FTS5 + Tidal forgetting curves + Optional AI semantic enhancement + Tidal Starfield UI.

蓝汐(Lanxi) 是一款专为 Google Antigravity 打造的纯本地长期记忆与认知图谱插件。它把「人类可读的纯 Markdown 真源文档」与「幂律/指数潮汐遗忘曲线」融合在一起:重要约定永久锚定不衰减,日常情景随时间退潮、被频繁检索则涨潮强化,绝不静默丢弃任何记忆文件。


✨ 核心特性

  • 零外部依赖 · 开箱即用:仅依赖 Node.js(>= 22.0.0)内置的 node:sqlite(WAL + FTS5)与原生 fetch,无需安装 Python、Docker 或外置向量库。

  • 五层认知结构 + 防误锁硬保护机制:

    • anchor(永久锚点)、self(自我认知)、goals(长期目标):定海锚点,永久保留(retention = 1.0),防意外降层。

    • structural(架构规律)、knowledge(通用知识):importance >= 0.7 可开启硬保护,归档或降级需显式确认 override: true;支持可选 writeGate(防 AI 自评重要度未确认前擅自锁死)。

    • episodic(情景事件,默认落层):未指定层级时默认进入情景层,避免草稿污染长期知识库;遵循潮汐遗忘曲线衰减,召回或强化后自动涨潮,并在维护台支持晋升与批量确认重要度。

    • unresolved(待解决问题):持续追踪未决疑点。

  • 磁盘即真源检测(dataStale):自动感知外部编辑器对 vault/*.md 的修改与文件增减,在概览与潮汐星海顶栏提示一键重建索引。

  • 项目优先召回 & 降噪钩子:按当前工作区自动标记与加权 project 记忆;SessionStart(开场锚点唤醒,默认开启)与 PreInvocation(每轮前置召回,默认关闭,改为按需主动检索)拥有独立 UI 开关,并提供 strict / balanced / loose 三档实词覆盖率防噪门槛,彻底杜绝无关旧记录刷屏与额外 Token 消耗。

  • 原创「潮汐星海」工作台(Sidecar + 浏览器全屏双形态):

    • 同心轨道潮汐星图 Canvas(支持拖拽、缩放、悬停查看与点击建边)、潮汐水位分布条、记忆流、锚点目标页与维护台。

  • 可选 AI 增强(默认关闭,完全自愿):

    • 接入任意 OpenAI 兼容接口后,额外解锁 混合语义向量检索(FTS5 + Cosine) 与 AI 智能凝结(自动提炼多条零散情景为高密度知识节点)。不配 API Key 照样 100% 离线完整运行。


Related MCP server: openmemkit

🚀 快速安装(3 步)

前置要求:Node.js >= 22.0.0(内置 node:sqlite)。

  1. 克隆仓库到 Antigravity 全局插件目录:

    # macOS / Linux
    git clone https://github.com/A16Nights/antigravity-lanxi-memory.git ~/.gemini/config/plugins/lanxi-memory
    
    # Windows PowerShell
    git clone https://github.com/A16Nights/antigravity-lanxi-memory.git "$env:USERPROFILE\.gemini\config\plugins\lanxi-memory"
  2. 重启 Antigravity(彻底退出托盘后重新打开)。

  3. 在客户端 Customizations 页面确认 蓝汐 · 潮汐认知图谱 已启用,或在对话中直接点击 [蓝汐 · 潮汐星海](sidecar://lanxi-memory/starfield/) 打开工作台。


🧰 MCP 工具一览(12 个)

工具名

作用

cg_write

写入记忆节点(默认落 episodic,支持 project、importanceSource、rejection_reason)

cg_recall

潮汐加权 + 项目优先召回(启用 Embedding 时自动执行 FTS5 + 语义混合排序)

cg_read

按节点 ID 读取全文、保留度、出入边与磁盘同步状态

cg_update

更新节点内容、层级、别名或重要度(带硬保护与防降层拦截)

cg_forget

显式归档到 vault/archive/(绝不静默删文件)

cg_link

在节点之间建立有向语义边(同步写入 frontmatter)

cg_graph

获取全局或局部子图数据

cg_goal

列出或创建/更新长期目标(goals 层)

cg_reflect

记录元认知反思或未决问题(self / unresolved)

cg_maintain

维护队列、晋升、强化、批量重要度确认(set_importance)、手动/AI 凝结、向量补全、索引重建

cg_stats

获取运行概览、潮汐水位分布、dataStale 新鲜度检测与脱敏配置

cg_import_vault

严格只读导入外部 Markdown / Obsidian Vault / DSH mdcg


✨ 可选 AI 增强配置

所有 AI 能力均默认关闭。你可以直接在工作台的 「⚙ 潮汐维护 → 可选 AI 增强接口」 中填写,或通过环境变量注入:

  • LANXI_LLM_API_KEY:用于 AI 智能凝结(OpenAI 兼容 /chat/completions)

  • LANXI_EMBEDDING_API_KEY:用于语义向量混合检索(OpenAI 兼容 /embeddings)

密钥仅保存在本机 ~/.gemini/lanxi-memory/config.json,接口和界面绝不会回显明文。


🔒 隐私与数据安全

  • 100% 本地运行:真源 Markdown 存储在 ~/.gemini/lanxi-memory/vault/,检索索引存储在 ~/.gemini/lanxi-memory/index.sqlite。

  • 除非你主动填写并开启可选 AI 接口,否则插件不发起任何外网请求。

  • 自检命令:npm test(使用隔离临时目录与模拟服务端进行全链路测试)。


💡 灵感致谢

本项目为基于 Antigravity 插件协议独立设计与编写的原生实现,设计理念受以下优秀开源项目启发,特此致谢:

  • dsh-memory(灵枢) —— 五层 Markdown 认知图谱、硬保护防失忆与确定性规则理念

  • CortexGraph —— 类人幂律遗忘曲线与访问强化机制

MIT License © 2026 A16Nights

Available Tools

12 tools
cg_forgetA

显式遗忘/归档记忆节点(绝不静默物理删除,仅移入 vault/archive/;硬保护节点需传 override: true)。

Inputs: id (required), reason, override.

cg_goalB

列出或创建/更新长期目标与待办(存储在 goals 层,默认硬保护)。

Inputs: id, op, title, status, +3 more.

cg_graphB

获取记忆关系子图(以某节点为中心或按层级返回关联度最高的节点和边)。

Inputs: limit, layers, centerId.

cg_import_vaultB

以严格只读方式从外部 Markdown 目录(兼容标准 Frontmatter、Obsidian Vault 与 DSH mdcg)导入历史笔记到蓝汐认知图谱。

Inputs: sourceDir (required).

cg_maintainC

潮汐维护:查看维护队列(queue),晋升情景(promote),强化访问(touch),批量修改/确认重要度(set_importance),手动或 AI 智能凝结(consolidate / ai_consolidate),补全向量(backfill_embeddings),或重建索引(rebuild)。

Inputs: id, op, ids, limit, +10 more.

cg_readA

按节点 ID 读取完整记忆详情、潮汐保留度、出入边关系与磁盘文件路径。

Inputs: id (required).

cg_recallB

按关键词、分层、项目与潮汐加权检索记忆(若已配置 Embedding API 则自动执行 FTS5 + 向量语义混合召回),并强化命中节点。

Inputs: query (required), limit, layers, project, +2 more.

cg_reflectB

记录元认知反思或待解决问题(写入 self 或 unresolved 层,并关联 derived_from 依据节点)。

Inputs: content (required), tags, layer, title, +2 more.

cg_statsA

获取蓝汐(Lanxi)认知图谱运行概览、潮汐水位分布、各层节点统计、磁盘真源新鲜度检测(dataStale)与配置(密钥已脱敏)。

Inputs: no named parameters.

cg_updateB

更新记忆节点内容、层级、标签、别名或重要度(若节点受硬保护,降低重要度、从受保护层迁出或解除保护需传 override: true)。

Inputs: id (required), tags, layer, title, +9 more.

cg_writeB

写入长期记忆节点到 Markdown 认知图(默认落 episodic 情景层;重要长期结论请显式指定 knowledge/structural;importance >= 0.7 或 anchor/self 层可开启硬保护)。

Inputs: content (required), tags, layer, title, +8 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    Core operations are clearly separated: cg_read/cg_write/cg_update/cg_recall/cg_link/cg_graph each target a distinct action on the memory graph. The main soft spot is the cluster of node-creation tools (cg_write, cg_goal, cg_reflect, cg_import_vault), which all produce nodes and are distinguished mainly by which layer they default to rather than by a fundamentally different operation. cg_stats vs cg_maintain(queue) also border on overlapping, though the descriptions clarify the read-only overview versus maintenance-queue split.

    Naming Consistency4/5

    Every tool uses the same cg_ prefix and snake_case, giving a predictable family identity. However the stems mix verbs (cg_read, cg_write, cg_forget, cg_link, cg_recall, cg_reflect, cg_maintain) with bare nouns (cg_stats, cg_graph, cg_goal), and cg_import_vault is the lone two-word stem. Readable and mostly predictable, but not a single uniform convention.

    Tool Count5/5

    Twelve tools is well within the comfortable range for a memory-graph server and each tool maps to a recognizable lifecycle operation. The maintain tool bundles eight sub-actions into one entry point, which keeps the surface lean rather than bloating it with near-duplicate maintenance verbs.

    Completeness4/5

    The lifecycle is largely covered: create, read, update, recall/search, link, subgraph traversal, goals, reflection, stats, import, and maintenance. Notable gaps include no way to remove or retype an existing edge (cg_link exists but there is no unlink/relink), and no explicit bulk list/enumerate-nodes or export path outside recall. These are workable gaps rather than dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides persistent long-term memory for AI assistants with tag-based retrieval, wiki-style linking, and source references, storing memories as markdown files with SQLite index.
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to maintain a persistent, queryable memory stored as user-owned Markdown files, with dual-channel retrieval (FTS5 and optional semantic search) and an audited write pipeline.
      11
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents like Codex, Grok Build, and Antigravity to share persistent local memory, preferences, project context, tasks, and handoffs using Markdown and SQLite.
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Gives AI agents a durable, locally hosted temporal memory built from a markdown vault you own, exposing hybrid semantic/lexical/entity search over events, threads, transcripts, entity relationships with validity dates, and patterns with confidence decay. Writes are approval-gated, so agents can draft, commit, and sync new memories while keeping every index rebuildable and nothing leaving your machine.
      MIT