{
  "markdown": "# Gemini Obsidian Extension\n\nThis is a powerful [Gemini CLI](https://github.com/google/gemini-cli) extension that integrates your **Obsidian Vault** directly into your AI workflow. It transforms Gemini into a \"Second Brain\" assistant capable of reading, searching, connecting, and managing your notes.\n\n## Features\n\n- **🧠 Semantic Search (RAG)**: Ask natural language questions about your notes. The extension indexes your vault using embeddings (via LanceDB) to find relevant context.\n- **🕸️ Graph Traversal**: Navigate your knowledge graph. Find backlinks (`[[linked from]]`) and outgoing links to surf your ideas.\n- **🛠️ Link Repair**: Audit broken wikilinks and make surgical in-note replacements without rewriting whole files.\n- **📝 Smart Journaling**: Fetch today's daily note or append logs to specific headings (e.g., `## Work Log`) with timestamps.\n- **⚡ Management**: Create, move, rename notes, safely update YAML frontmatter in single or batch mode, and edit specific sections.\n- **🔍 Fuzzy Search**: Quickly find files by name or content.\n\n## Demo\n\n![demo.gif](docs/demo.gif)\n\n## Prerequisites\n\n- **Node.js**: v18 or higher.\n- **Gemini CLI**: The host application for this extension.\n- **Obsidian Vault**: A local folder containing your markdown notes.\n\n## Installation\n\n1. **Install via Gemini CLI**:\n   ```sh\n   gemini extensions install https://github.com/thoreinstein/gemini-obsidian\n   ```\n\n2. **Install Native Dependencies**:\n   This extension requires native binaries for semantic search. You **must** run `npm install` inside the extension directory:\n   ```sh\n   cd ~/.gemini/extensions/gemini-obsidian && npm install\n   ```\n\n## Configuration\n\nThe extension needs to know where your Obsidian vault is located.\n\n**Option 1: Environment Variable**\nSet `OBSIDIAN_VAULT_PATH` in your shell profile:\n```bash\nexport OBSIDIAN_VAULT_PATH=\"/Users/you/Documents/MyVault\"\n```\n\n**Option 2: Runtime Configuration**\nThe first time you use a tool, gemini will ask to set `vault_path`. It will be cached in `~/.gemini-obsidian.config.json`.\n\n## Data Storage & Troubleshooting\n\n- **Vector Index**: The semantic search index is stored locally in `~/.gemini-obsidian-lancedb`.\n- **Module Not Found Error**: If you see an error like `Cannot find module '@lancedb/lancedb'`, it means the native dependencies were not installed. Run `npm install` in the extension directory as shown in the Installation section.\n- **Cache Reset**: If you suspect the index is corrupted or want a fresh start, you can manually delete the `~/.gemini-obsidian-lancedb` folder. The next time you run `/obsidian:index` or `obsidian_rag_index`, it will be recreated.\n- **Logs**: If you encounter issues, check the extension logs. Since this runs as an MCP server, errors are typically output to stderr.\n\n## Indexing Performance Tuning\n\n> [!WARNING]\n> Initial semantic indexing can be time- and resource-intensive, especially on large vaults.\n> For first-time indexing on larger vaults, prefer running indexing directly from the extension directory (outside an active Gemini chat session):\n> `node dist/index.js obsidian_rag_index`\n\n### Initial Indexing Expectations\n\n- Recommended threshold for one-time CLI indexing: vaults with roughly `500+` markdown files.\n- CPU usage can stay high for the full indexing run (multiple cores active).\n- In a real-world test with `~1000` files (`957` notes), indexing produced `13,296` chunks and took about `11 minutes` (`11:01`, ~`374%` CPU).\n\nFor large vaults, you can tune indexing throughput and chunk size with environment variables:\n\n- `GEMINI_OBSIDIAN_EMBED_BATCH_SIZE` (default: `48`): Number of chunks embedded per batch.\n- `GEMINI_OBSIDIAN_MIN_CHUNK_CHARS` (default: `40`): Skip very small chunks below this size.\n- `GEMINI_OBSIDIAN_MAX_CHUNK_CHARS` (default: `1800`): Split oversized paragraphs into smaller embedding-safe segments.\n- `GEMINI_OBSIDIAN_TARGET_CHUNK_CHARS` (default: `700`): Merge nearby short segments into larger chunks to reduce total embeddings.\n\nHigher `GEMINI_OBSIDIAN_TARGET_CHUNK_CHARS` generally improves indexing speed by reducing chunk count, but can reduce retrieval granularity.\n\nExample preset for very large vaults:\n\n```bash\nGEMINI_OBSIDIAN_EMBED_BATCH_SIZE=48 \\\nGEMINI_OBSIDIAN_TARGET_CHUNK_CHARS=900 \\\nGEMINI_OBSIDIAN_MIN_CHUNK_CHARS=60 \\\nnode dist/index.js obsidian_rag_index\n```\n\n## Commands\n\nThe extension comes with pre-configured slash commands for common workflows:\n\n| Command | Description |\n| :--- | :--- |\n| `/obsidian:daily` | Retrieve today's daily note, summarize tasks, and ask for updates. |\n| `/obsidian:ask` | Ask a question to your vault using RAG (e.g., `/obsidian:ask \"What did I learn about React?\"`). |\n| `/obsidian:search` | Fuzzy search for files by name or content. |\n| `/obsidian:index` | Trigger a manual re-index of the vault for semantic search. |\n\n## Available Tools\n\nThe following tools are exposed to the Gemini agent:\n\n### Retrieval & Search\n- `obsidian_rag_index`: Index the vault for semantic search.\n- `obsidian_rag_query`: Perform a semantic search query.\n- `obsidian_search_notes`: Simple text/filename search.\n- `obsidian_list_notes`: List files in a folder.\n- `obsidian_read_note`: Read the full content of a note.\n\n### Graph & Connections\n- `obsidian_get_backlinks`: Find all notes that link TO a specific note.\n- `obsidian_get_links`: Find all notes linked FROM a specific note.\n- `obsidian_get_broken_links`: Find wikilinks that point to missing notes.\n\n### Management & Journaling\n- `obsidian_create_note`: Create a new markdown note.\n- `obsidian_append_note`: Append text to the end of a note.\n- `obsidian_append_daily_log`: Append text to a specific heading (e.g., \"Log\") in today's daily note with a timestamp.\n- `obsidian_move_note`: Rename or move a note.\n- `obsidian_update_frontmatter`: Safely update YAML frontmatter keys in single-key or batch mode.\n- `obsidian_replace_section`: Replace the body of a heading without touching the rest of the file.\n- `obsidian_insert_at_heading`: Insert content at the beginning or end of a heading section.\n- `obsidian_replace_in_note`: Replace the first exact text match in a note for surgical inline edits.\n- `obsidian_get_daily_note`: Get or create today's daily note.\n\n## Skills\n\n- `obsidian-companion`: Tool selection and vault workflow guidance.\n- `compound`: Promote repeated project knowledge into durable global notes.\n- `moc-update`: Suggest Maps of Content that should link to a newly created note.\n- `link-audit`: Audit broken links, orphans, and cleanup opportunities.\n\n## Development\n\n```bash\n# Build changes\nnpm run build\n# Type check\nnpm run type-check\n# Run tests\nnpm test\n```\n\n## License\n\nISC\n",
  "bytes": 6658,
  "sha": "0542e0a010c8b8e274af977facf0e515720b9686bcdab7af06a39bc7d11eaf36",
  "repo_slug": "thoreinstein/gemini-obsidian",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_thoreinstein_gemini_obsidian_f3f0102c/readme"
}