rosswang975 downloadsAI vault agent powered by China-accessible LLM APIs — DeepSeek, GLM, Kimi, Qwen or any OpenAI-compatible endpoint. Agentic read/search/create/edit of notes. No CLI, no proxy, 中文优先.
A China-first Obsidian agent plugin that talks directly to OpenAI-compatible and Anthropic Messages LLM APIs and can autonomously search, read, create and edit your notes. No CLI to install, no overseas account, no environment variables to configure. Configure multiple agents (each with its own provider, key and prompt) and switch between them from the header.
Current version: v0.3.9
The closest equivalent overseas (Claudian) requires the Claude Code CLI and an overseas subscription, which is both hard to set up and hard to pay for from mainland China. Vault Agent turns the same agent experience into paste one API key and go:
| What you want | Pick this preset |
|---|---|
| Your local Magpie gateway (one entry for every subscription, key and routing group) | Magpie 本地网关 (本机), or New from Magpie template |
| DeepSeek | DeepSeek |
| Zhipu GLM / Z.ai | 智谱 GLM / Z.ai |
| Kimi (Moonshot) | Kimi |
| Qwen (DashScope — the models behind Qoder) | 通义 Qwen (DashScope) |
| Doubao/Seed (Volcengine Ark — the models behind Trae) | 火山方舟 Ark (enter your endpoint ID) |
| Doubao-Seed-Code (the Claude Code–compatible Coding Plan) | 火山方舟 Coding Plan (both Anthropic and OpenAI-compatible entries) |
| Tencent Hunyuan (the models behind WorkBuddy) | 腾讯混元 Hunyuan |
| Hermes (Nous Research) | Hermes or OpenRouter |
| Any other OpenAI-compatible service | 自定义 OpenAI 兼容端点 (custom) |
| Any other Anthropic-compatible service | 自定义 Anthropic 兼容端点 (custom) |
Preset names above are the labels shown in the plugin UI (Chinese). Trae / Qoder / WorkBuddy do not expose personal API channels; this plugin talks to the official APIs of the model vendors behind them (Volcengine Ark, DashScope, Tencent Hunyuan), which you can sign up for and pay for in RMB.
search_notes / read_note / list_notes / get_active_note / create_note / edit_note (exact replace) / append_note / read_properties, with multiple steps per turn.requestUrl) when the direct connection fails.http, CONNECT tunnelling for https). Desktop only.web_search tool backed by Tavily — so providers without native search, DeepSeek included, can search too.CN AI Agent/AGENTS.md is read on every turn and injected as long-lived rules above the built-in prompt — edit the file, and the next reply already follows it.max_tokens is derived from the selected model's output ceiling automatically (Magpie reports its own; routing groups use the lowest member limit); turn the auto toggle off to set a fixed value.<tool> → waiting for your approval), so a long turn never looks frozen.history.jsonl (see below).POST /v1/messages) is supported, so Anthropic-compatible endpoints such as Volcengine Ark's Coding Plan work directly./v1/models instead of being typed by hand.CN AI Agent/记忆.md and schedules it on a forgetting curve, so a conversation is searchable, linkable and actually comes back for review.Settings → AI Vault Agent CN → the Agents section manages your agents:
https://ark.cn-beijing.volces.com/api/coding and model doubao-seed-code-preview-latest — just paste the plan's API key.Volcengine Ark Coding Plan: buy a Coding Plan (Lite/Pro) in the Ark console first, then create a plan-specific API key (it is not interchangeable with a general Ark key); the model ID is whatever the console lists. The plan exposes two entries and both have presets:
Preset Protocol Base URL 火山方舟 Coding Plan (Anthropic 协议)Anthropic Messages https://ark.cn-beijing.volces.com/api/coding(POST/v1/messages)火山方舟 Coding Plan (OpenAI 兼容)OpenAI-compatible https://ark.cn-beijing.volces.com/api/coding/v3(POST/chat/completions)The Anthropic entry is the Claude Code path documented by Volcengine, and the template button uses it; if it is not available on your plan, switch to the OpenAI-compatible entry. Coding Plan has no provider-native web search — configure Tavily (below) if you need search.
Switching agents keeps the conversation; the next message goes to the new agent, and the history panel tags each session with the agent that produced it.
Magpie is a local AI gateway (default 127.0.0.1:3425) that turns the subscriptions, vendor API keys and routing groups you configured inside it into one catalog of provider/model ids, and speaks OpenAI Chat and Anthropic Messages itself. To this plugin it is a single provider, not one configuration per vendor.
Settings → AI Vault Agent CN → Agents → New from Magpie template:
http://127.0.0.1:3425/v1 and API key magpie-ai-vault-agent.GET /v1/models from the gateway and picks a model: auto/… (Magpie's own routing) first, then a group/… routing group, then the first enabled model.Boundaries worth knowing:
net::ERR_CONNECTION_REFUSED). When Magpie is off, switch to another agent.magpie-ai-vault-agent only makes Magpie's usage page and routing rules attribute this client to ai-vault-agent. Switching to a real vendor clears it, so it can never be mistaken for a credential.port in Magpie's settings.json, change the base URL to match; Magpie's "share on the local network" address works too.provider/model (or a routing group name) exactly as /v1/models returns them; this plugin ships no fixed list.With Save conversations as vault memory on (the default), every turn updates one memory note:
CN AI Agent/记忆.md
Not one file per conversation — that only piles up files nobody reopens. Every memory lives in this one note, each with its own review schedule, so the note itself says what to review today.
## 今日待复习 section lists them. On start-up the plugin mentions how many are due.<!-- memory:data --> comment is the schedule, and editing it loses review progress.Community plugins: Settings → Community plugins → Browse → search for AI Vault Agent CN → Install, then Enable.
Manual: copy main.js, manifest.json and styles.css into <vault>/.obsidian/plugins/vault-agent/, restart Obsidian and enable the plugin.
Requirements: Obsidian 1.7.2 or newer; works on desktop and mobile (the local proxy is desktop-only).
Settings → AI Vault Agent CN → Local proxy (optional): enter host:port (e.g. http://127.0.0.1:9000, or user:pass@host:port when the proxy needs authentication) and AI requests go through it — handy for inspecting traffic with a local proxy or for relaying on a restricted network. Leave it empty to connect directly. Desktop only; SOCKS is not supported.
A model's training data has a cut-off, and your notes may not cover recent events. Settings → AI Vault Agent CN → Web search has four modes:
| Mode | Behaviour |
|---|---|
| Off | Default. The model uses its own knowledge plus your notes |
| Auto | Provider-native search when the provider has it, otherwise the plugin tool (needs a Tavily key) |
| Provider-native only | GLM / Z.ai / Kimi / Qwen / OpenRouter |
| Plugin tool only | Tavily, so any provider can search — DeepSeek included |
While you chat, every event (user message, assistant reply, reasoning, tool call and tool result) is appended to
.obsidian/plugins/vault-agent/history.jsonl. data.json keeps only the last 40 messages, which is what restores the chat view;
the JSONL is the complete record, with timestamps, session ids and tool calls.
The History button in the sidebar header lists and searches those conversations directly, and clicking a row loads it back into the chat — no command line needed.
Importing the JSONL into SQLite with tools/history_db.py (standard library only) gives you the same thing from a terminal:
python tools/history_db.py import # incremental; safe to re-run
python tools/history_db.py search 同步任务 # full-text search (FTS5 trigram, so Chinese works)
python tools/history_db.py search --tool read_note # filter by tool
python tools/history_db.py sessions # list conversations
python tools/history_db.py show <session prefix> # print one conversation in full
python tools/history_db.py stats
The database lands next to the JSONL (history.db) by default. Import deduplicates on event id, so re-running only adds what is new; the paths can be overridden with --vault <vault root> or --jsonl/--db.
data.json) and is never uploaded.npm install
npm run build # tsc check + esbuild -> main.js
npm test # node end-to-end tests (mock SSE server + agent loop + history recorder)
MIT
Please include your Obsidian version, the plugin version, a description or screenshot of the problem, and what you expected to happen.
中文优先的 Obsidian vault 智能体插件(插件市场名 AI Vault Agent CN)——直连国产大模型 API(OpenAI 兼容协议 + Anthropic Messages 协议),智能体可自主搜索、读取、创建、修改你的笔记。无需安装任何 CLI,无需海外账号,无需配置环境变量。可配置多个 Agent(各自的服务商、Key、提示词),在标题栏一键切换。
当前版本:v0.3.9
海外的同类形态(Claudian)依赖 Claude Code CLI 与海外订阅,国内用户配置门槛高且支付困难。Vault Agent 把同一形态的智能体体验变成填一个 API Key 就能用:
| 你想用 | 选这个预设 |
|---|---|
| 本机 Magpie 网关(一个入口用上所有订阅/Key/路由组) | Magpie 本地网关 (本机),或用 🪄 用 Magpie 模板一键新建 |
| DeepSeek 深度求索 | DeepSeek |
| 智谱 GLM / Z.ai | 智谱 GLM / Z.ai |
| Kimi(月之暗面) | Kimi |
| 通义 Qwen(Qoder 同源模型) | 通义 Qwen (DashScope) |
| 豆包/Seed(Trae 同源模型) | 火山方舟 Ark(填接入点 ID) |
| 豆包编程模型(Claude Code 同源套餐) | 火山方舟 Coding Plan(Anthropic / OpenAI 兼容两个入口) |
| 腾讯混元(WorkBuddy 同源模型) | 腾讯混元 Hunyuan |
| Hermes(Nous Research) | Hermes 或 OpenRouter |
| 其他任意 OpenAI 兼容服务 | 自定义 OpenAI 兼容端点 |
| 其他任意 Anthropic 兼容服务 | 自定义 Anthropic 兼容端点 |
Trae / Qoder / WorkBuddy 本体不对外提供个人 API 通道,本插件支持的是它们背后的模型服务商官方 API(火山方舟、DashScope、腾讯混元),申请即用、人民币计费。
search_notes / read_note / list_notes / get_active_note / create_note / edit_note(精确替换)/ append_note / read_properties,单轮可多步连续操作。http:// 绝对 URI 直转、https:// CONNECT 隧道),仅桌面端。web_search 工具(Tavily)——DeepSeek 这类没有内置联网的服务商也能搜。CN AI Agent/AGENTS.md,作为高于内置默认规则的长期要求注入 system prompt——改完文件,下一条回复立即遵守。max_tokens 按当前模型的输出上限自动解析(Magpie 读网关自身数据,路由组取组内最低上限);关闭开关后可手填固定值。history.jsonl(见下)。POST /v1/messages),可直接接入火山方舟 Coding Plan 等 Anthropic 兼容端点。/v1/models 实时读取,不用手抄模型名。CN AI Agent/记忆.md 这一篇笔记,并按遗忘曲线安排复习——对话因此可搜索、可双链、会被主动想起。设置 → AI Vault Agent CN → 智能体 (Agents) 区域可管理多个 Agent:
https://ark.cn-beijing.volces.com/api/coding 与模型 doubao-seed-code-preview-latest,只需粘贴套餐专属 API Key。火山方舟 Coding Plan:先在火山方舟控制台购买 Coding Plan(Lite/Pro 订阅),再创建套餐专属 API Key(与通用方舟 Key 不互通),模型 ID 以控制台为准。同一套餐有两个入口,插件都提供预设:
预设 协议 Base URL 火山方舟 Coding Plan (Anthropic 协议)Anthropic Messages https://ark.cn-beijing.volces.com/api/coding(POST/v1/messages)火山方舟 Coding Plan (OpenAI 兼容)OpenAI 兼容 https://ark.cn-beijing.volces.com/api/coding/v3(POST/chat/completions)Anthropic 入口是 Claude Code 同款、官方文档记载的接入方式,模板按钮默认用它;若在你的套餐下不可用,改用 OpenAI 兼容入口即可。Coding Plan 不提供「服务商内置联网」,需要联网时请配置 Tavily(见下)。
切换 Agent 时对话上下文保留,下一条消息即由新 Agent 应答;侧栏历史记录里每个会话会标注产生它的 Agent。
Magpie 是本机的一个 AI 网关(默认 127.0.0.1:3425),把你在里面配好的订阅、各家 API Key 和路由组统一成一套 provider/model 模型列表,并同时听懂 OpenAI Chat、Anthropic Messages 等协议。对本插件来说,它等于一个服务商,而不是每家用一套配置。
设置 → AI Vault Agent CN → 智能体 (Agents) → 🪄 用 Magpie 模板一键新建:
http://127.0.0.1:3425/v1,API Key 填 magpie-ai-vault-agent。GET /v1/models 拉取你已启用的模型,自动选中一个(优先 auto/… 自动路由,其次 group/… 路由组,再次列表第一个)。几个要知道的边界:
net::ERR_CONNECTION_REFUSED)。Magpie 关掉时,切回别的 Agent 即可。magpie-ai-vault-agent 只是让 Magpie 的用量统计和路由规则把你这个客户端记成 ai-vault-agent。切到别的服务商时插件会自动清掉它,避免被当成真 Key 误用。settings.json 里改了 port,把 Base URL 一起改掉即可;也支持 Magpie 的「共享到局域网」地址。provider/model(或路由组名),以 /v1/models 返回为准,本插件不内置任何固定列表。开启后(默认开启,设置 → AI Vault Agent CN → 把对话保存为库内记忆),每轮对话结束都会更新同一个记忆文件:
CN AI Agent/记忆.md
不是一篇会话一个文件——那样只会堆出一堆没人再打开的文件。全部记忆都在这一篇里,每条自带复习排期,笔记本身就会告诉你今天该复习什么。
## 今日待复习 一节。
插件启动时若有到期记忆会提示一次。<!-- memory:data --> 注释是排期数据,改了会丢复习进度。社区插件市场:设置 → 第三方插件 → 浏览 → 搜索 AI Vault Agent CN → 安装并启用。
手动安装:把 main.js、manifest.json、styles.css 放进 <vault>/.obsidian/plugins/vault-agent/,重开 Obsidian 后在第三方插件里启用。
系统要求:Obsidian 1.7.2 及以上;桌面端与移动端均可(本地代理仅桌面端)。
设置 → AI Vault Agent CN → 本地代理(可选) 填 host:port(如 http://127.0.0.1:9000;需认证时写 user:pass@host:port),
AI 请求即经该代理转发,便于抓包排查或在受限网络下中转;留空直连。仅桌面端生效,不支持 SOCKS。
模型训练数据有截止日期,库内笔记也未必覆盖最新信息。设置 → AI Vault Agent CN → 联网搜索 有四档:
| 模式 | 行为 |
|---|---|
| 关闭 | 默认。只用模型自身知识与库内笔记 |
| 自动 | 服务商有内置联网就用内置,否则回退到插件工具(需 Tavily Key) |
| 仅服务商内置 | GLM / Z.ai / Kimi / Qwen / OpenRouter |
| 仅插件工具 | 用 Tavily,任何服务商都能联网(含 DeepSeek) |
聊天过程中,插件把每条事件(用户消息、助手回答、思考、工具调用与结果)追加写入
.obsidian/plugins/vault-agent/history.jsonl。data.json 里只留最近 40 条用于恢复界面,
这份 JSONL 才是带时间戳、带会话 id、带工具调用的完整记录。
侧栏标题栏的历史记录按钮可以直接列出并搜索这些会话,点击即载回对话——不需要命令行。
用 tools/history_db.py(仅标准库)导入 SQLite,则可从命令行随时检索:
python tools/history_db.py import # 增量导入,可重复执行
python tools/history_db.py search 同步任务 # 全文检索(FTS5 trigram,支持中文)
python tools/history_db.py search --tool read_note # 按工具过滤
python tools/history_db.py sessions # 列出会话
python tools/history_db.py show <session 前缀> # 打印某个会话的完整对话
python tools/history_db.py stats
数据库默认落在 JSONL 同目录(history.db);导入按事件 id 去重,重复运行只写入新增事件。
路径可用 --vault <vault 根目录> 或 --jsonl/--db 指定。
data.json),不上传。npm install
npm run build # tsc 检查 + esbuild 产出 main.js
npm test # node 端到端单测(mock SSE 服务 + 工具循环 + 历史记录器)
MIT
反馈时请尽量附上:Obsidian 版本、插件版本、问题描述或截图、预期结果。