sigma li39 downloadsBring your own LLM: chat and an agent that works with your vault, AI editing with diff preview, inline completion, custom prompts, semantic search and MCP tools.
English | 简体中文
Bring your own large language model to Obsidian: sidebar chat, a vault-aware agent, AI editing with diff preview, inline completion, local semantic search and MCP tools in one plugin.
Works with any OpenAI-compatible API (OpenAI, DeepSeek, Qwen, Zhipu GLM, Moonshot / Kimi, Doubao, MiniMax, SiliconFlow, and local servers such as Ollama and LM Studio) and any Anthropic-compatible API (Anthropic Claude and services that offer an Anthropic endpoint). All settings, chat history and indexes stay in your vault.
/models when it connects.data.json. Logs and error messages are redacted.[[links]], collapsible reasoning with thinking time, session history (new, rename, delete, restore) and export to a note.Ctrl/Cmd + Z undoes them.AI Prompts), with template variables and an optional model. Each prompt becomes an Obsidian command you can bind to a hotkey.semantic_search. Off by default.1.8.7 or later.1.11.4 or later, so API keys are stored in SecretStorage.main.js, manifest.json and styles.css from the latest release.<your vault>/.obsidian/plugins/note-agent/ (create the folder if needed).git clone https://github.com/sigmalos/Note-Agent.git
cd Note-Agent
npm install
npm run build
Copy the generated main.js together with manifest.json and styles.css to <your vault>/.obsidian/plugins/note-agent/ and enable Note Agent in the community plugin settings.
Open Settings → Note Agent → Add provider, choose OpenAI 兼容 (OpenAI compatible) or Anthropic 兼容 (Anthropic compatible) and fill in two fields:
| Field | Description and examples |
|---|---|
| API endpoint | Base URL. A bare domain gets /v1 appended. OpenAI compatible:• DeepSeek: https://api.deepseek.com• Qwen: https://dashscope.aliyuncs.com/compatible-mode/v1• Zhipu GLM: https://open.bigmodel.cn/api/paas/v4• Ollama (local): http://localhost:11434/v1Anthropic compatible (requests go to {Base URL}/v1/messages):• Anthropic: https://api.anthropic.com• DeepSeek: https://api.deepseek.com/anthropic |
| API key | The provider's key (for example sk-…). Leave empty for local servers such as Ollama or LM Studio. |
Click Connect and detect models (saving does this too): the plugin calls /models to check the connection and fetch the model list. You then pick the model below the chat input.
/models: type the model ID directly in the chat's model picker.[!TIP] Network and proxies: on desktop the plugin uses Node's network stack by default (no CORS limits, native streaming). To go through the system proxy, switch Advanced → Request method to "Browser fetch".
[!NOTE] The plugin's interface is currently in Chinese.
Click the 🤖 ribbon icon or run Open AI Chat from the command palette.
× to remove an added note, and hover for a token estimate.↑ / ↓).The controls under the input, from left to right. Each opens a list upwards: ↑ / ↓ to move, Enter to choose, Esc to close. Choices apply to the current session and carry over to new sessions.
| Control | What it does |
|---|---|
| + | Attach any note from the vault to the conversation. |
| Provider | Switch between configured providers (the global default is marked). |
| Model | Recently used models first, then all detected models. Search (for example qwen, glm 4.5), type a custom model ID or refresh the list. |
| Effort | Low (default) / Medium / High / Max, sent as reasoning_effort (Max maps to xhigh). If the API rejects it, the plugin falls back or omits it and remembers this per model. |
| Mode | Manual (default) / Accept / Auto permission modes, as in Claude Code (see Agent). |
| Send / ✨ | Send the message, or open quick prompts with ✨ (summarize the note, extract key points, outline, explain the selection, …). |
| Key | Action |
|---|---|
Enter |
Send |
Shift + Enter |
New line |
↑ (empty input) |
Recall your last message |
Esc (while generating) |
Stop |
With Settings → Advanced options → Agent → Enable vault tools on (the default), the model can call tools to search, read and edit your notes during a chat.
| Mode | Search and read | Create / edit / move | Delete, external (MCP) tools | Good for |
|---|---|---|---|---|
| Manual (default) | Yes | Each write shows a diff and asks first | Asks | Everyday work with a check on every change |
| Accept | Yes | Written directly (undoable) | Asks | Editing tasks you trust the model with |
| Auto | Yes | A safety classifier reviews each action: allowed ones run, suspicious ones ask you | Same | Larger tasks with a safety net |
The Auto classifier sees only your own messages and the actions requested, never note contents, so instructions hidden in notes cannot get an action approved. It uses the chat's provider and model unless you pick another one under Settings → Advanced options → Agent → Auto mode safety classifier. Sessions from 0.2.x are migrated: Ask and Accept become Manual, Auto becomes Accept.
[[note name]].AI/Overview.md." The plan appears above the answer, and each tool call can be expanded to see its arguments, result and the notes it used.Ctrl/Cmd + Z works too.Enter.Ctrl/Cmd + Enter: accept and write it to the noteEsc: reject[!NOTE] Every built-in edit action is also a separate command, so you can bind hotkeys to them in Settings → Hotkeys (search for
AI).
Inline completion is off by default. Turn it on in Settings → Inline completion (pick a fast model), with the "Completion" toggle in the status bar, or with the command Toggle AI inline completion.
After a short pause in typing, a grey suggestion appears at the cursor:
| Key | Action |
|---|---|
Tab |
Accept the suggestion |
Ctrl/Cmd + → |
Accept the next word |
Esc |
Dismiss |
Prompts are Markdown notes in the prompt folder (default AI Prompts). Create a note there, or use New prompt in the ✨ list or the settings.
---
name: Weekly report
description: Turn the selected notes into a weekly report
scope: edit # chat | edit | both | system (default persona for chat)
mode: replace # how AI editing writes: replace | insert-after | insert-at-cursor
context: auto # context sent in chat: auto | current-file | selection | none
provider: deepseek # optional
model: deepseek-chat # optional
---
Turn the following into a clear, formal weekly report:
{{selection}}
Extra requirements: {{user_instruction}}
| Variable | Meaning |
|---|---|
{{selection}} |
The selected text |
{{current_file}} |
The current note |
{{cursor_context}} |
Text around the cursor |
{{vault_context}} |
Related notes from the vault |
{{user_instruction}} |
Extra instructions asked for when the prompt runs |
{{date}} |
Today's date |
{{title}} |
The current note's title |
{{language}} |
The configured target language |
Prompts show up in the ✨ list and under "My prompts" in the AI edit panel, and each one is registered as the command Prompt: <name>, which you can bind to a hotkey.
Semantic search is off by default. To use it:
text-embedding-3-small or GLM-Embedding-3).Notes are split by headings and paragraphs; the index is stored in the plugin folder and updated incrementally when notes change. When keywords are unclear, the agent calls semantic_search.
Go to Settings → MCP servers → Add to give the agent extra tools:
npx -y @modelcontextprotocol/server-everything) and environment variables. Desktop only.Manual and Accept; in Auto the safety classifier decides.The interface is in Chinese; command names are given in English here.
| Command | Description |
|---|---|
| Open AI Chat / New AI chat | Open the chat view or start a new session |
| AI summarize current note / AI explain selection | Ask in the chat with that context attached |
| AI edit (selection or cursor) | Open the AI edit panel |
| AI rewrite / polish / expand / shorten / summarize / translate / fix grammar / change tone / explain / outline / to table / tidy formatting / extract keywords / continue writing | Run that edit action directly |
| Prompt: <name> | Run a custom prompt (in chat or as an AI edit) |
| Toggle / request now / accept / dismiss AI inline completion | Inline completion |
| Update / rebuild semantic index | Update the index incrementally or rebuild it |
| Stop AI generation | Stop all running generations and agent tasks |
Everything stays in your vault; nothing goes through a third-party relay:
| Data | Location | Notes |
|---|---|---|
| Settings | .obsidian/plugins/note-agent/data.json |
No API keys |
| Chat history | .obsidian/plugins/note-agent/data/sessions/*.json |
Local JSON |
| Semantic index | .obsidian/plugins/note-agent/data/rag-index.json |
Local vector index |
| Credentials | Obsidian SecretStorage (1.11.4+) | Provider API keys, MCP environment variables and headers |
<context> delimiters, and the system prompt tells the model to treat it as data, not instructions.getMarkdownFiles) to let you pick notes to attach, for the agent's search and file tools, and to build the semantic index. Excluded folders are filtered out before anything is read or sent.npm install # install dependencies
npm run dev # esbuild in watch mode
npm run build # type check + production build (main.js)
npm run typecheck # type check only
npm run lint # the Obsidian community directory's lint rules
npm test # unit tests (Vitest)
npm run test:watch # unit tests in watch mode
npm run test:live # integration tests against a real API (reads .env; LIVE_MODELS=a,b,c picks models)
seed and deploy build the plugin, copy it into a test vault and hot-reload it (requires the Obsidian CLI):
cp .env.example .env # set MODEL_BASE_URL / MODEL_API_KEY; optional MODEL_ID, MODEL_IDS, OBSIDIAN_VAULT
npm run seed # first time: build, deploy, write the provider from .env and detect its models
npm run deploy # afterwards: build, deploy and reload the plugin
seed creates or merges a provider named after the endpoint's domain and fetches its /models list.MODEL_ID optionally preselects a model; a comma-separated MODEL_IDS is added to "Recently used", for example MODEL_IDS=GLM-4.5-Flash,Qwen3.6-Flash,Kimi-K2.7 npm run seed.seed are moved into SecretStorage.Pushing a version tag (for example 0.2.2) runs the release workflow, which builds the plugin, attaches main.js, manifest.json and styles.css to a GitHub release and publishes artifact attestations for them. You can verify a downloaded file with:
gh attestation verify main.js --repo sigmalos/Note-Agent
src/
├── main.ts # plugin entry: lifecycle, settings, commands, views, network transport
├── providers/ # model adapters (OpenAI compatible: SSE, reasoning, tool calls, embeddings; Anthropic Messages: streaming, thinking, tool calls)
├── core/ # pure logic: HTTP/SSE, routing, context budget, tokens, prompts
├── agent/ # agent: tools and schema validation, path rules, search, loop, changes and undo
├── chat/ # sessions and storage, chat controller, options, model catalog, note edits
├── editor/ # diff, edit targeting and conflict checks, edit sessions, inline completion (CodeMirror 6)
├── prompts/ # custom prompts: parsing, rendering, commands
├── rag/ # semantic index: chunking, incremental sync, cosine search
├── mcp/ # MCP client (stdio / Streamable HTTP) and server management
├── context/ # current note, selection, links and backlinks
├── settings/ # settings model, SecretStorage, settings tab
├── ui/ # chat view, agent steps, edit panel, diff preview, popovers
└── utils/ # logging, redaction, JSON and URL helpers
tests/ # unit tests (in-memory vault, MCP test server); tests/live: real API tests
The plugin follows the requirements in docs/Obsidian-Agent-SRS.md (in Chinese). The MVP (§15) and the main V1.1–V2.0 items are done:
| SRS | Feature | Status |
|---|---|---|
| §15 MVP / §17 | Providers, chat, context, AI editing, diff preview, local storage | ✅ Done |
| V1.1 | Task routing (chat / editing / completion / embeddings), custom prompts (Markdown, variables, commands) | ✅ Done |
| V1.2 | Vault search (name, path, headings, tags, properties, body, folders), links and related notes | ✅ Done |
| V1.3 | Tool calling: registry, validation, permissions, state machine, limits, cancellation | ✅ Done |
| V1.4 | Multi-file edits, plan view, per-step or per-task approval, changed files and undo | ✅ Done |
| V1.5 | Inline completion (ghost text, Tab / Esc / word by word) |
✅ Done |
| V2.0 | Local semantic search (RAG), MCP (stdio / Streamable HTTP) | ✅ Done |
| §4.9.3 | Preview a whole batch of changes before running it | ⚠️ Partly (per-change approval or "Allow for this task") |
| §10.4 | Mobile | ⚠️ Not fully tested (local stdio MCP servers are desktop only) |
| §7.3 | Native Anthropic / Gemini adapters | Anthropic ✅ · Gemini ⏳ planned (its OpenAI-compatible endpoint works) |
| V2.0 | Custom skills and agent workflows | ⏳ Planned |
| V2.1 | Multi-agent collaboration | ⏳ Planned |