Chat with your Obsidian vault using configurable LLM providers, embeddings, local vector search, and optional pgvector storage.
- Chat view inside Obsidian with streaming responses.
- Vault-aware RAG mode that retrieves indexed note chunks before answering.
- Configurable chat, embedding, and rerank models.
- Markdown-aware chunking strategies:
- delimiter splitting
- Markdown heading splitting
- Markdown Q&A splitting
- fixed length splitting
- Local vector storage in the vault.
- Optional PostgreSQL + pgvector storage for larger indexes.
- Per-file chunking overrides and chunk preview in the index manager.
- Optional LightRAG backend for graph-based RAG answers, Markdown vault sync, processing status, and source references.
- Obsidian desktop.
- Node.js 18+ for development.
- An OpenAI-compatible chat and embedding endpoint, or one of the configured providers.
- Optional: PostgreSQL with the
pgvectorextension if you choose pgvector storage.
This plugin is currently desktop-only because pgvector support uses the Node.js pg package. Mobile support would require removing or lazily isolating that desktop dependency.
-
Run a production build:
npm install npm run build
-
Copy these files into your vault:
<Vault>/.obsidian/plugins/simple-rag-plugin/ main.js manifest.json styles.cssstyles.cssis only needed if present. -
Reload Obsidian.
-
Enable the plugin from Settings → Community plugins.
npm install
npm run devFor easiest local development, keep this repository inside:
<Vault>/.obsidian/plugins/simple-rag-plugin/
- Open Settings → Obsidian RAG Integration.
- Add at least one chat model and one embedding model.
- Select the embedding model in the Embedding tab.
- Choose a vector database:
- Local file stores vectors inside the vault.
- pgvector stores vectors in PostgreSQL.
- Select a chunking strategy.
- Run Index all vault notes or index individual files from the index manager.
- Open Copilot Chat and ask questions about your vault.
- Open Settings → Obsidian RAG Integration → LightRAG.
- Enable LightRAG and set the server URL, for example
http://192.168.50.209:9621. - Select Test connection to verify
/health. - Keep Auto sync Markdown enabled or select Start sync to sync immediately. Edits are debounced (continuous typing is coalesced into a single re-sync after you pause, with a hard cap so a long editing session still syncs periodically), and the periodic scan defers to files you are actively editing to avoid re-processing intermediate states. Renames and deletions remove the corresponding LightRAG document, and a full Start sync also reconciles the server by removing orphaned documents whose vault files no longer exist (only documents previously created by this plugin are touched).
- In Vault chat mode, the default answer mode calls LightRAG
/query/datafor retrieval, then uses the plugin's selected chat model to generate the final answer. You can switch to direct LightRAG/query/streamgeneration in the LightRAG query settings.
LightRAG sync only sends Markdown files. New or changed files are submitted in batches of up to 3 texts per /documents/texts request. When a synced file changes, the plugin deletes the previously tracked LightRAG document and inserts the updated text because the current LightRAG API does not expose an in-place document update endpoint. The plugin listens for vault file events, scans once on startup, and can periodically rescan the vault by mtime to catch missed events. The LightRAG exclude list supports exact paths, folder prefixes such as private/, and simple glob rules such as archive/**/*.md; excluded files are not synced and previously synced excluded files are removed from LightRAG on the next scan. LightRAG chat defaults to /query/data retrieval plus plugin-model generation, strips generated inline References sections, and shows a limited de-duplicated source list based on retrieved chunks. The LightRAG settings tab refreshes pipeline and tracked document status automatically while it is open.
- Open Copilot chat
- Index all vault notes
- Reindex current file
This plugin does not include hidden telemetry.
Depending on your settings, it may send the following data to external services:
- Chat messages and retrieved note context to your selected chat model provider.
- Note chunks and user queries to your selected embedding provider.
- Candidate retrieval results to your selected rerank provider, if reranking is enabled.
- If LightRAG is enabled, Markdown file contents and vault-chat retrieval queries are sent to your configured LightRAG server. In the default answer mode, retrieved chunks are then sent to your selected chat provider so the plugin's model can generate the final answer. If you switch to direct LightRAG generation, LightRAG uses its own configured LLM for the final answer.
API keys are stored in Obsidian plugin settings data. Only configure providers you trust. If you use local vector storage, vectors are stored inside your vault. If you use pgvector, vectors and chunk text are stored in your configured PostgreSQL database.
For a GitHub release, make sure:
manifest.jsonhas the correctversion.versions.jsonmaps that version to the correctminAppVersion.npm run buildsucceeds.- Push a tag that exactly matches
manifest.jsonversion, for example0.1.0. - The release workflow will build the plugin and upload
main.js,manifest.json,styles.cssif present, and a zip archive.
git tag -a 0.1.0 -m "0.1.0"
git push origin 0.1.0See LICENSE.