Dragonglass AI

unlisted

by Cody Johnson

Bring your own LLM (Ollama, OpenAI, Anthropic, Gemini) and chat with your vault. Reads and searches notes, proposes edits as reviewable diffs, and applies them only after you approve.

Updated 17d agoMIT
View on GitHub

Dragonglass AI

Bring your own LLM to Obsidian. Dragonglass AI is a free, open-source, agentic assistant that lives in a sidebar, understands your vault as a linked knowledge base, and proposes every change as a diff you approve before it is written.

  • Bring your own model. Local models through Ollama, OpenAI, Anthropic or Google Gemini with your own API key, or any OpenAI-compatible endpoint (Moonshot's Kimi, OpenRouter, Groq, LM Studio, vLLM, llama.cpp). No subscription, no account, no proxy; cloud usage is billed to you by the provider. See Ways to run it.
  • Local-first and private. Nothing leaves your machine except the message you type, the context you choose to attach, the results of the tools the model calls and a short vault overview (note count and top-level folder names), and only to the provider you configured. A web search goes out only when you approve it. No telemetry.
  • Agentic, with oversight. The model can list, search and read notes, inspect properties, links and backlinks, find the notes most related to one and say why, and propose creating, editing, moving or renaming notes, changing their properties and creating folders. Every change is shown for review; you approve, reject, or revert. Nothing is written otherwise.
  • Web fallback, on your say-so. With a Tavily key, the model can search the web when the vault lacks an answer. You approve every search and can change its words first; the answer cites web pages as [web N], and Save to vault proposes a research note with its sources.
  • A writing assistant for your script. Ask for a scene and the model looks up the characters and places in your vault first, drafts it in the chat in the format of the note you have open (Fountain by default), and cites the notes that shaped it. Revise it in the chat; every version stays a click away. Insert puts the version you are looking at over your selection or at your cursor, through the same review as any edit. Check lore flags where the script contradicts the vault, with a one-click fix for each line, and a sequel canon note records the changes you meant to make.

Status

This is the 0.1 MVP. It is a working vertical slice, not the full product. What works, what was verified, and what is missing are listed honestly in What works and Known limitations.

Install

Dragonglass AI is not yet in the community plugin directory. Install manually:

  1. Build or download main.js, manifest.json and styles.css (see Development).
  2. Copy them into <your vault>/.obsidian/plugins/dragonglass-ai/.
  3. In Obsidian, open Settings → Community plugins, turn off Restricted mode if needed, and enable Dragonglass AI.

Requires Obsidian 1.13.2 or newer (for keychain-backed secret storage).

Ways to run it

Dragonglass talks to a model over an API. It never logs in to a chat app, so a ChatGPT, Claude or Gemini chat subscription cannot be used; only API keys (or a local server) work. Pick whichever suits you:

  • Local Ollama. Models run on your own machine; nothing leaves it. See Ollama.
  • Ollama cloud models, through your local Ollama. Sign in once with ollama signin, pull one of the cloud models from Ollama's library (for example a Kimi K2 cloud tag), and select it as an Ollama model. No code or extra settings are needed. These models run on Ollama's servers, so your messages and attached context leave your machine even though the plugin talks to 127.0.0.1.
  • An OpenAI, Anthropic or Google Gemini API key. Billed by that provider to your account. See OpenAI, Anthropic and Google Gemini.
  • Any OpenAI-compatible endpoint. Services such as Moonshot (Kimi models) and OpenRouter (many vendors' models behind one key), or a server you run yourself such as LM Studio, vLLM or llama.cpp. See OpenAI-compatible endpoint.

Configure

Open Settings → Dragonglass AI.

Ollama (local)

  1. Install Ollama and pull a model that supports tool calling, for example ollama pull llama3.1 or ollama pull qwen2.5. Thinking models such as qwen3 work too, but pause for a long time before answering (see "Let thinking models think" below).
  2. Leave Server URL at http://127.0.0.1:11434 unless Ollama runs elsewhere.
  3. Enter the model name and select Test Ollama connection. It reports the server version and whether that model is installed.

Ollama allows requests from Obsidian's app:// origin by default. If you run an older Ollama or have set OLLAMA_ORIGINS yourself, either include app://obsidian.md in it or switch Advanced → Network transport to the Obsidian request API, which bypasses CORS but does not stream.

Models without tool support still work for plain chat; the plugin notices the rejection, retries without tools, and tells you.

Two settings matter for local models:

  • Context window is sent as Ollama's num_ctx on every request (default 16,384 tokens). Until the plugin sets it, Ollama runs at its own default of 4,096 tokens, which one long note overflows; when that happens Ollama silently keeps about half the prompt and drops the system prompt and your question. The value is capped at what the model supports. If a prompt is still cut, the reply carries a warning saying so. Note content sent to the model is also trimmed to half the window when Max characters per note would exceed that.
  • Let thinking models think controls models such as qwen3 or deepseek-r1 that reason before answering. While they think the sidebar shows "Thinking…" with the elapsed time, and the reasoning is kept in a collapsed block above the reply; the usage line says how many output tokens went to thinking. Turn the setting off to send think: false for faster, direct answers. Expect 15 to 110 seconds of thinking per turn on an 8B model on a laptop.

Search runs on an index the plugin builds in memory when Obsidian starts (about a second for 20,000 notes, in the background) and keeps current as notes change; nothing is written to disk. Each search hands the model the full text of as many of its best matches as fit a token budget, after the usual list of excerpts, so a small model answers from the notes instead of from short excerpts. Note text in search results (under Context) sets that budget, 4,000 tokens by default and never more than a quarter of the context window when the provider reports one; zero turns it off. A match too long for what is left is cut if at least half of it fits and skipped otherwise, and each note is also held to Max characters per note. When the query names a note but asks about something it does not mention (a person's climbing project), the search also lists the notes it links to and reads them in full within half of that budget.

OpenAI

For the three cloud providers, the Model field and the sidebar's model menu list the chat models your key can use. Until the key works they offer a short list of each provider's current models instead.

  1. In API key, create a new keychain secret and paste your key. The key is stored by Obsidian's secret storage (backed by the OS keychain on desktop), never in plugin files or notes.
  2. Pick a model from the Model field's list (or type any model id) and select Test OpenAI connection.

GPT-6.1 Sol and Terra take tool calls only through OpenAI's Responses API, so Dragonglass talks to them over that API and to other OpenAI models over Chat Completions. A model you type in that OpenAI says needs the Responses API for tools moves over to it for the rest of the session. Either way the requests are stateless: Dragonglass asks OpenAI not to store them.

Anthropic

  1. In the Anthropic group, create a keychain secret holding your Anthropic API key (from the Anthropic Console). It is sent only to Anthropic.
  2. Pick a model from the Model field's list (or type any model id) and select Test Anthropic connection.
  3. Max output tokens caps each reply (Anthropic requires a cap). Raise it if long answers or drafted notes are cut off.

Anthropic only accepts requests from a browser context such as Obsidian's when the client opts in, so the plugin sends the anthropic-dangerous-direct-browser-access header. Your key still goes only from your machine to Anthropic.

Google Gemini

  1. In the Google Gemini group, create a keychain secret holding a Gemini API key from Google AI Studio. It is sent only to Google, in a request header rather than the URL.
  2. Pick a model from the Model field's list (or type any model id) and select Test Gemini connection.

OpenAI-compatible endpoint

For any server that speaks the OpenAI Chat Completions API. It shows up as Custom in the sidebar's provider menu.

  1. Base URL is the API root that /chat/completions and /models sit under, usually ending in /v1. For example:
    • Moonshot: https://api.moonshot.ai/v1
    • OpenRouter: https://openrouter.ai/api/v1
    • Groq: https://api.groq.com/openai/v1
    • LM Studio: http://127.0.0.1:1234/v1
    • llama.cpp llama-server: http://127.0.0.1:8080/v1
    • vLLM: http://127.0.0.1:8000/v1
  2. Authentication: most services take Authorization: Bearer <key>. Choose Key in a custom header for services that want the key in a named header (for example api-key), or No authentication for local servers; then no key is ever sent.
  3. API key: a keychain secret, like the other providers. It is sent only to the base URL above.
  4. Model: the model id exactly as the service names it, or pick one from the sidebar model menu once the connection works.
  5. Select Test endpoint connection. It lists the server's models with the authentication you chose.

Two switches cover servers that do not support everything:

  • Tool calling off stops sending tool definitions, for servers or models that reject them or answer with broken tool calls. With it on, a server that refuses tools (for example vLLM without --enable-auto-tool-choice, or llama.cpp without --jinja) still gets an answer: the plugin retries once without tools and says so.
  • Streaming off asks for whole replies, for servers that cannot stream.

An endpoint on localhost, 127.x.x.x or [::1] is treated as local: the sidebar does not show the cloud privacy note and token counts are not described as billed. Any other host is treated as a remote service. If the connection test cannot reach a server that answers from the command line, the server probably refuses requests from Obsidian's app:// origin (CORS); switch Advanced → Network transport to the Obsidian request API.

Switching providers

Switch providers from the sidebar at any time. The conversation stays as it is, including earlier tool calls, and the next message goes to the new provider with the whole history. Each reply is labelled with the model that wrote it.

Context

By default the active note and any selected text are attached to each message. A selection is attached once: if it is still selected at the next message its chip is no longer highlighted, and clicking it sends it again. The active note is the Markdown note you last focused in any window, so it stays attached while you type in the sidebar or have a Canvas or PDF open. Toggle them per message in the sidebar, or attach other notes with Attach note…. When a cloud provider is active the sidebar says so, and highlighted chips are exactly what gets sent.

Web search (optional)

When the vault does not have an answer, the model can search the web. It works the same with every provider, including local Ollama models, because Dragonglass runs the search itself through Tavily.

  1. Create a Tavily API key (the free plan has 1,000 searches a month and needs no card).
  2. In Settings → Dragonglass AI → Web search, add it under Tavily API key. It is stored in Obsidian's keychain and sent only to Tavily.
  3. Optionally list Preferred sites, one per line (a game's wiki, an official site). They are searched first, and the search widens to the whole web only when they have nothing, which uses a second search credit.

Without a key there is no web search tool; the model says when the vault lacks an answer and can point you to this setting.

Use

Open the sidebar with the gem icon in the ribbon or the command Dragonglass AI: Open chat.

  • Ask questions: "What does my Launch note say about the date?"
  • Answers cite the notes they draw on as links, [[Launch]], right after each claim, and anything without a source is worded as the model's suggestion. Under the answer, From your vault lists the cited notes; one whose text was not in the model's context for that answer is marked unverified, one it saw only part of (a search excerpt, its properties or a selection) says so, and a link to a note that does not exist says "no such note". Notes the same answer proposes changing are not listed. Replies saved by an earlier version get no list, and in a conversation that has them, later answers leave such notes unflagged rather than guess.
  • When the vault lacks an answer and a Tavily key is set, the model may ask to search the web. A card shows the search words in an editable field: change them if you like, then Search (or Enter), or Don't search (or Escape) to keep the answer to your vault. One approval lets the model read up to 3 of that search's result pages as plain text, cut to a length cap. Claims from the web carry [web N] markers that link to their pages, and From the web under the answer lists the cited pages. Web pages are treated as untrusted: the model is told never to follow instructions in them, and it can only read pages your approved search returned.
  • Save to vault under an answer that cites web pages proposes a new note in Web research/: the answer with its links, the cited pages under Sources, the date, and from-web: true in its properties so it is never mistaken for canon. It is reviewed like any other new note.
  • Send a message with Cmd+Enter (Ctrl+Enter on Windows and Linux). Enter on its own adds a new line, so longer messages can be written out.
  • Copy a reply: select text in the sidebar and copy it as usual, or select Copy under a reply to put its Markdown on the clipboard.
  • Ask for edits: "Move the launch date in Projects/Launch.md to November 15." The model reads the note, proposes a change, and a card with the diff appears. Select Approve to apply or Reject to discard.
  • Beyond text edits, the model can propose rewriting one section by its heading, setting or removing properties (reviewed as each property's old and new value), moving or renaming a note (the card lists the notes whose links change; links follow Obsidian's "Automatically update internal links" setting) and creating a folder.
  • When one request changes several notes, the proposals appear as one card ("3 changes across 3 notes") with Approve all and Reject all; each note's diff is a collapsible section with its own Approve and Reject. Approve all is all or nothing: if any note changed since it was proposed, nothing is written and the card names the note. Once applied, Undo all restores every note the same way, moves moved notes back, and sends notes the batch created to Obsidian's trash if they are untouched; new folders stay. The model is asked for one proposal per note per request, so each card is one note.
  • If you edit the note yourself after a proposal was made, the card switches to out of date and approval is blocked; undoing your edit makes it approvable again. Otherwise ask again.
  • Revert on an applied edit restores the snapshot taken before it was applied. It is refused if the note changed after the edit was applied, so later edits are never overwritten. Reverting a property change puts the properties back, and reverting a move moves the note back; a created note or folder, including a folder a move created, is not removed. Snapshots are kept under the plugin folder (last 50).
  • Stop cancels generation. Partial text is kept.
  • Conversations persist in the vault's plugin folder and survive switching providers. Deleting one asks for confirmation first; there is no undo.
  • The light next to the model menu shows the last connection check. It turns red when a request fails because the provider is unreachable or refuses the request, and is re-checked every time you send.

Token counts reported by the provider are shown under each reply, summed over every tool round of that turn, and as a conversation total. These are counts, not bills. The optional usage warning is a reminder, not a spending limit.

Drafting scenes

Dragonglass is built for writing a screenplay beside the lore that backs it. Open the scene you are working on, then ask: "draft the scene where Kael meets Mira at the watchtower". The model searches the vault for the characters and places named, reads their notes, and answers with the scene in a draft card, saying under it which notes shaped the scene; those notes appear under From your vault like any answer's sources. When the model names none, the notes its tools read that turn are listed under Read for this draft instead, so you can always see what the scene was built from.

The draft matches the open note's format, read from the note itself: Fountain (INT. PLACE - DAY, names in capitals, dialogue beneath), a Markdown screenplay (headings and bold names), or prose. The note is read for this only when it is in the script folder (below) or attached to your message; otherwise, or with nothing to match, drafts are Fountain.

Ask for changes in the chat ("make Kael colder") and the whole scene is rewritten as a new version; the card shows the latest with arrows to step back through the earlier ones, so you can compare or go back. Copy copies the version shown. Insert into … puts it into the note you have open: over the selected text if there is one, otherwise at the cursor, with a blank line either side. The note must be in editing view, since Reading view has no cursor; Insert asks you to switch if it is not. The insert is a proposal like any other edit: the diff shows under the card, and nothing is written until you approve it.

Right after a draft, a message that names no note is taken as being about the draft, and the model cannot propose note edits on that turn. To change a note then, name it with a [[link]], a .md path, the word "note" or the open note's title.

An optional Script folder setting (Settings → Dragonglass AI → Writing) names the folder that holds your screenplay. Notes in it are the script, not lore, so the model's searches and related-note lookups leave them out unless it asks about the script itself, and the open note's format is matched when the note is in this folder. Drafts go into the open note either way: inserting into a note outside that folder still works, and the review says so.

Checking lore

Check lore, beside Send, checks the note you have open against the vault, or just the selection if there is one. The notes it names go along, found by note name or alias, and the model can look up more. It flags lines that contradict the lore on relationships, timeline or voice.

Each issue shows the script line, what the vault says with a link to the note, and two buttons. Fix it proposes the corrected line. Intentional says the change is deliberate and proposes recording it in the sequel canon note, creating the note if needed. Both are normal proposals: the diff shows under the issue, and nothing is written until you approve it. Dragonglass drops any flag whose line is not in the script or whose note the model was not shown, and says how many it left out. It also says when a script was too long to fit in the model's context, so you can select the rest and check that. The notes used are listed under Read for this check.

The sequel canon note (Sequel canon.md unless you change it under Settings → Writing) records deliberate changes to the original lore. Write it yourself or let Intentional add to it. It goes with every message and the model is told it overrides the other notes for drafting and for the lore check. A line added through Intentional is reliable: it is never flagged again. A change in your own words depends on the model taking it in, so a check can still flag a line that agrees with it, and how often depends on the case. A draft is not guaranteed to follow the canon note either, and with one present a small model often proposes edits to your notes alongside or instead of the draft; nothing changes unless you approve one (figures under "What works").

What works

Verified by automated tests against a fake provider server and by driving a real Obsidian 1.14.5 instance with the plugin installed in a disposable vault:

  • Plugin loads, sidebar opens, settings tab renders.
  • Streaming chat over the Ollama, OpenAI, Anthropic and Gemini wire formats, including tool calls, tool results, usage, cancellation, and error mapping (bad key, rate limit, server error, unreachable server, model without tools).
  • Custom OpenAI-compatible endpoints with bearer, custom-header and no authentication, a server that rejects tools, and streaming turned off.
  • Switching providers mid-conversation, including replaying tool calls made by one provider to another.
  • Read tools: list, read, search, metadata with links and backlinks, related notes with reasons, active note and selection.
  • Edit flow end to end: ask for a change, model reads the note, proposes a find/replace, diff is shown, approve applies it through the Vault API, the open editor shows the new content, a snapshot is written, revert restores it.
  • Stale detection: a note edited after the proposal cannot be approved.
  • Batch review: a request that changes several notes shows one grouped card; Approve all applies every note, is disabled while one is out of date, and Undo all puts them all back, trashing the notes it created.
  • Source markers: a cited answer's links open their notes, and the sources list flags an unread and a missing note.
  • Web search against a scripted Tavily stand-in: the approval card, edited search words, declining, Stop while it waits, preferred sites widening to the whole web, page reads, [web N] links, Save to vault through review, and no web tool without a key.
  • Folder, move, property and section changes with a scripted model: Approve all then Undo all across a new folder, a move that updates links (including Obsidian's update-links prompt when automatic updates are off, a link added in the same batch, and two moves in a row through one note), a move into a new folder reverted, a property change applied and reverted exactly, a stale property change refused, and replace_section refusing a missing or ambiguous heading.
  • Scene drafting: a draft card with the notes that shaped it listed under it, revisions stepped through in the card, Insert at the cursor or over a selection through the review, a stale review refused, and script pages left out of search.
  • Lore check with a scripted model: an issue list for the open note and for a selection, Fix it and Intentional through the review, the canon note created only on approval, reject and undo bringing the buttons back, a stale review and a line that has gone both refused, flags on a missing note left out and counted, results surviving a reload, and a re-check after a fix and a canon entry coming back clean.
  • Conversation history persists across plugin reload.

Verified live against Ollama with qwen3:8b on a laptop (every scenario above except the folder, move, property and section changes, which have run only with the scripted model, for drafting only a draft, a revision and Insert at the cursor, and for the lore check a check, Fix it, Intentional and a re-check). The lore check's reliability on a laptop with qwen3:8b, on one test scene with four planted contradictions, five runs: it found 11 of the 20, per run 3, 2, 3, 3 and 0, at about 76 seconds a check. On a scene with nothing wrong it flagged 4 lines in 3 of 5 runs, so read each claim against its note before acting on it. A line recorded through Intentional is reliable: it was flagged in 0 of 3 re-checks. A canon change in the owner's words depends on the case: a sister the lore does not have was flagged in 0 of 5 runs, while a changed birthplace still had an agreeing line flagged in 3 of 5 runs, against 4 of 5 with no canon note. Use Intentional on a false flag: a line it records is never flagged again. Drafting with the canon note is not verified to follow it. Asked for a short scene where Kael names his birthplace, with the canon note moving it to Frosthaven and the script's own mentions changed to Ashfall so Frosthaven could only come from canon: in 5 runs with the canon note, 4 gave a draft and all 4 had him born in Frosthaven (2 of them still mentioned Ashfall), and the fifth gave no draft and proposed note edits instead. The model called write tools in all 5 of those runs, 15 calls in total. In 3 control runs without the canon note, 2 gave a draft, both saying Ashfall, the third answered with a malformed reply and no draft, and 1 called write tools. Nothing was written in any run, since every write waits for review. Real OpenAI, Anthropic and Gemini keys were not available on the build machine; those wire formats are tested against shapes from the official API documentation. The custom endpoint has not been run against Moonshot, OpenRouter or another live service yet; it is the OpenAI adapter pointed at a different URL. Tavily has not been called with a real key yet; the adapter follows Tavily's API reference and is tested against a stand-in that answers in its documented shape. To verify live:

  1. Run Ollama with a tool-capable model and set it in settings; or add an OpenAI, Anthropic or Gemini key in the keychain.
  2. Select Test … connection: it should report the Ollama version or the number of models your key can use.
  3. In a scratch vault, create Projects/Launch.md containing Launch date: November 1. and send "Change the launch date in Projects/Launch.md to November 15".
  4. Approve the proposal and confirm the note changed.
  5. For web search, add a Tavily key, ask about something the vault lacks, approve the search and check that the results and page reads make sense.

Known limitations

  • A ChatGPT, Claude or Gemini chat subscription cannot be used; only API keys or a local server.
  • Custom endpoints get the standard OpenAI request shape. Provider-specific extras (OpenRouter routing options, reasoning fields some services stream) are not sent or shown, and a server without a /models route fails the connection test even if chat works.
  • The model is not told whether a proposal was approved or rejected; it only knows the user must approve.
  • No Canvas or Bases support yet.
  • No semantic search or stemming; search matches any query word at the start of a word in note names and content, ranking rarer words and notes that contain more of the words first. A paraphrase that shares no word with the note ("guarantee" for "warranty") is not found.
  • Cost estimates are not shown, only token counts from the provider.
  • Desktop verified only. The code avoids desktop-only APIs but mobile has not been exercised.
  • Very long notes are truncated when attached or read (configurable limit).
  • The lore check is as good as the model. Dragonglass can verify that a flag quotes a real line and cites a note the model saw, not that the model read the note correctly, and it cannot tell you what the model missed. A small local model misses some contradictions and flags some lines that are fine.
  • Web pages are read as plain text from their HTML. Pages that build their text with JavaScript, and PDFs, cannot be read; the model falls back to the search snippet.

Development

npm install
npm run dev      # watch build to main.js
npm run build    # typecheck + production build
npm test         # vitest (unit tests + adapters against the fake server)
npm run lint     # eslint with eslint-plugin-obsidianmd

For a disposable in-app check without a real model:

npm run build
node test/fake-server/server.mjs 11435 &   # fake Ollama, OpenAI, Anthropic, Gemini, Tavily on :11435
node scripts/e2e-vault.mjs .e2e            # builds .e2e/vault and .e2e/userdata
/Applications/Obsidian.app/Contents/MacOS/Obsidian \
  --user-data-dir="$PWD/.e2e/userdata" --remote-debugging-port=9333

The isolated user-data directory means this Obsidian instance never sees your real vaults or settings. The fake server answers scripted prompts such as hello, read Projects/Launch.md, and edit Projects/Launch.md replace "November 1" with "November 15". Cloud providers need a keychain secret holding the fake key: sk-fake for OpenAI, sk-ant-fake for Anthropic, gemini-fake for Gemini. The custom endpoint starts on the fake server's /local/v1, which needs no key and rejects tools; /keyed/v1 takes custom-fake in an api-key header. For web search, store tvly-fake as a keychain secret, pick it under Tavily API key, set webSearch.baseUrl in the vault's plugin data.json to the fake server's /tavily, and send web <words>.

Docs: architecture, roadmap, decision record.

Privacy

  • No telemetry. No account. No server of ours.
  • The whole vault is never uploaded. What goes to the provider you picked is your message, the context you attach (the active note, a selection, attached notes), the content of every note the model reads through its tools, the results of its searches (an excerpt per matching note and per note linked from a note the query names, plus the full text of the best of them that fit Note text in search results, 4,000 tokens by default), and a short overview of the vault: the note count and the names of the top-level folders. Search itself reads every note locally to build its index; only those results are sent. With a cloud provider, all of that leaves your machine.
  • Web search contacts Tavily only for a search you approve, sending the search words (which you see and can edit) and your preferred sites. Reading a result page fetches that page with no key or cookie. Search results and page text then go to your provider like any tool result.
  • With every message, while the note you have open is in the script folder or attached, a short sample of it (its first 1,200 characters) goes along so drafts can match its format, whether or not you are drafting. Otherwise no part of it is sent, and drafts default to Fountain.
  • While the sequel canon note exists it goes with every message, whether or not you are drafting. Check lore sends the open note or its selection, the notes it names (up to 12) and what the model looks up.
  • API keys live in Obsidian's secret storage and are never logged or written to notes.
  • Note content and web content are treated as data: the model is told not to follow instructions found inside notes or web pages.
  • All writes require your approval and are snapshotted for rollback.

License

MIT. See LICENSE.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.