Akali176 downloadsRun a vault-aware AI agent with streaming output, safe file tools, and configurable OpenAI-compatible providers.
Ogent is an Obsidian vault-aware AI agent with streaming output, safe file tools, and bring-your-own-key provider support.
This repository is a personal fork and ongoing customization of OpenAgent for Obsidian. The upstream project and its MIT license remain the foundation; the changes in this repository focus on a lightweight, practical Agent for an Obsidian knowledge base.
execute_commands dispatcher. Vault, Git, Web, and Plugin actions use an allowlisted domain/action/args vocabulary; arbitrary Shell and arbitrary Git arguments are never exposed.web.search, followed by public HTML/plain-text retrieval through web.fetch. Results include source metadata and fetched pages are treated as untrusted reference material.This project intentionally keeps the core Agent small. Grounded Research, MLX/local embedding packs, and the former hackathon/evaluation data are not part of the current project. They can be developed as separate projects if needed later.
The plugin does not provide arbitrary terminal commands. Git operations are a deliberately limited desktop-only exception and cannot address paths outside the current Vault.
When the release is available in the Obsidian Community plugins directory, install Ogent from Settings → Community plugins → Browse. For testing a release before marketplace propagation, manual installation from GitHub remains supported.
main.js, manifest.json, and styles.css from a GitHub release, or build them locally.<vault>/.obsidian/plugins/agent-ogent/ if it does not exist and copy the three files into that directory.If you previously used the upstream OpenAgent build, enable this plugin once and then disable the old open-agent plugin. The first launch imports its settings and session files without deleting the old data.
For mobile, sync the same plugin files into the mobile vault's .obsidian/plugins/agent-ogent/ directory.
Open Settings → Ogent and configure:
| Setting | Description |
|---|---|
| Provider | Currently an OpenAI-compatible endpoint. |
| Base URL | The provider API base URL, for example https://api.openai.com/v1. |
| API key | The key used by the configured model provider. |
| Model | A model name accepted by the endpoint; models can be fetched from /models. |
| Interface language | Automatic system language, 简体中文, or English. This controls command plans and approval prompts. |
| Web search provider | Tavily or Brave Search. |
| Web search API key | Optional until the Agent needs web.search; required for web search calls. |
| System prompt | Optional instruction prepended to conversations. |
| Agent memory | Optional plugin-local preferences. Do not store secrets here. |
| Execution scope | Read only, Ask before action, or Full access for the current chat. |
When current or time-sensitive information is needed, the Agent can use execute_commands with web.search and then web.fetch a selected page. Web access is approval-controlled and does not make DeepSeek or another model's native knowledge current by itself; the command results supply the current sources.
web.fetch accepts only HTTP(S) URLs and blocks local, loopback, private, and link-local hosts.spawn("git", args, { shell: false }), and are limited to the current Vault after real-path and repository-root checks. In Ask mode, Git writes, commits, branch changes, pulls, and pushes explain hooks, remotes, and credential risks before waiting for approval..obsidian/plugins/agent-ogent/data.json. This file is ignored by Git. Never commit it, put keys in notes or OpenAgent.md, or include them in bug reports and exported sessions.Requirements: Node.js and npm.
git clone https://github.com/Akali-yyds/ObsidianAgent-Ogent.git
cd ObsidianAgent-Ogent
npm install
# Development/watch build
npm run dev
# Verification
npm run build
npm run lint
npm test -- --run
To deploy a production build into a local test vault, set .vault-path to the vault path (the file is ignored by Git), or set the OBSIDIAN_VAULT environment variable, then run:
npm run deploy
The deploy script copies main.js, manifest.json, and styles.css into the vault's agent-ogent plugin directory. Do not copy data.json from a personal vault into the repository.
src/
main.ts Plugin entry point and Obsidian integration
settings.ts Provider, web, consent, and tool settings
view.ts Chat panel, controls, and rendering
loop.ts Agent system prompt and execution entry point
provider.ts OpenAI-compatible streaming provider
sessions.ts Persistent sessions and event recovery
compaction.ts Conversation context compaction
consent/ Approval, diff, checkpoint, and undo logic
commands/ Structured command schema and executor
tools/vault/ Vault read/write/path implementations
tools/git.ts Desktop Git implementation and safety checks
tools/plugin.ts Feature-detected public plugin command access
tools/web-search.ts Tavily and Brave Search implementation
tools/web-fetch.ts Safe public-page fetching and text extraction
ui/ Compact Agent controls and menus
Issues and pull requests are welcome. Please avoid including API keys, private vault content, data.json, generated bundles, or personal session files in reports or patches. Run the lint and test commands before opening a pull request.
This project is derived from nikitaclicks/obsidian-openagent. The upstream copyright notice is retained and modifications are attributed to Akali-yyds. See LICENSE for the MIT License.