Xu Wang136 downloadsCreate local, token-free context maps that help AI agents navigate your Obsidian vault.
Give AI agents a map of your Obsidian vault before they start reading your notes.
Obsidian Agent Context generates a local, token-free, agent-readable index of your vault so an AI agent can quickly understand what exists, where to look, and which files are worth opening next.
No LLM calls. No embeddings. No upload. Just a local context map.
Generate local index → Ask your agent if it helps → Keep it, merge it, or delete it
AI agents are much more useful when they know the structure of your workspace.
Without a map, an agent may open the wrong notes, miss important project folders, or spend tokens reading files that are not relevant. Obsidian Agent Context gives the agent a lightweight orientation layer first.
It helps an agent answer:
The goal is simple: less blind reading, better context selection, and lower token waste when you later use an AI agent.
Use this Obsidian plugin if your content lives mainly in Obsidian and you want commands inside the Obsidian UI.
Use this Python version if you want to index a general local folder, such as a code repository, research folder, data project, or mixed document directory. See Agent Context Indexer.
Generating the index itself costs almost nothing.
AGENTS.md files..agent_context/.After generating the index, you can ask your agent:
Read the Agent Context index. Does this help you understand my vault?
Which files would you open next?
Would this reduce the number of source files you need to read?
Would this likely save tokens compared with reading the vault directly?
If the answer is yes, keep using it.
If the answer is no, delete .agent_context/ and ignore or delete the generated pointer file. No workflow lock-in.
Obsidian Agent Context is intentionally NOT another heavy AI layer.
It does NOT:
It is a navigation layer, not a semantic search engine or summarizer.
Obsidian Agent Context is not yet available in the Obsidian community plugin marketplace. Until then, you can install it manually from the GitHub release.
manifest.json
main.js
styles.css
<vault>/.obsidian/plugins/
obsidian-agent-context
<vault>/.obsidian/plugins/obsidian-agent-context/
manifest.json
main.js
styles.css
After enabling the plugin, open the command palette with Ctrl + P and search for Agent Context.
Only download release files from this repository.
Obsidian Agent Context is useful when you want an agent to understand your vault before it starts reading source files.
The basic workflow has three steps:
1. Generate a local index
2. Ask your agent whether the index is useful
3. If useful, merge or keep the generated AGENTS pointer
After installing and enabling the plugin, open the Obsidian command palette with Ctrl + P and search for Agent Context.
You should see three commands:
Generate vault agent context
Generate configured folder contexts
Generate all agent contexts
Use them as follows:
.agent_context/latest/.Use this when you want a broad first map of the vault.
Run:
Generate vault agent context
This creates:
.agent_context/latest/
Then ask your agent:
Read the files in .agent_context/latest/
Does this help you understand the overall structure of my vault?
Would this reduce the number of source files you need to open?
Does this folder help to save the token usage significantly?
This is a good first step for discovery. The caveat is that for very large vaults, a full-vault index may still be broad or noisy. In that case, the vault-level scan is best used as a map to decide which folder should be scanned next.
Use this when you already know the project, research area, or folder you want the agent to focus on.
In plugin settings, enter one folder path per line:
Projects/Project_ABC
Literature
Research/Papers
Folder paths should be relative to the vault root. For example, if your vault is:
E:\obsidian-vault
and the folder is:
E:\obsidian-vault\Projects\Project_ABC
then enter:
Projects/Project_ABC
Then run:
Generate configured folder contexts
This creates folder-specific context indexes such as:
.agent_context/folders/projects__project_ABC/latest/
.agent_context/folders/literature/latest/
.agent_context/folders/research__papers/latest/
Then ask your agent:
Read the files in .agent_context/folders/<your project>/latest/
Does this give you enough context to work on this project?
Would this folder-level index save tokens compared with reading the folder directly?
Folder-level scans are usually more useful when the task is focused, because they reduce noise and give the agent a smaller, more relevant context map.
Use this when you want both a global map and focused folder maps.
Run:
Generate all agent contexts
This creates or updates:
.agent_context/latest/
.agent_context/folders/<folder_slug>/latest/
.agent_context/folder_context_registry.csv
Then ask your agent:
Read files in .agent_context/latest and .agent_context/folders/<your project>/latest/
Would this folder-level index save tokens compared with reading the folder directly?
This option combines broad discovery with focused context. It is useful when you want the agent to compare the vault-level map with several folder-level maps and tell you which ones are actually helpful.
If the generated context is helpful, you can keep using it and optionally merge the generated AGENTS.md or AGENTS.agent-context-indexer.md pointer into your own agent instructions.
If it is not helpful, you can simply delete:
.agent_context/
AGENTS.agent-context-indexer.md
or ignore the generated pointer. The scan itself did not consume tokens and did not upload your vault.
The Obsidian plugin is designed for Obsidian vaults.
A standalone Python version of the same idea is also available or planned for non-Obsidian use cases, such as local project folders, research folders, code repositories, and document directories.
The Obsidian plugin does not require the Python version. They are related tools built around the same idea: Agent Context Indexing.
The sections below describe how the plugin works, what it generates, and how agents should use the output.
The plugin scans your vault or configured folders and creates a local context package.
It extracts metadata and structure such as:
It removes fenced code blocks before extracting headings and links, so examples inside code blocks are not treated as real vault structure.
Vault-level output is written to:
.agent_context/latest/
Folder-level output is written to:
.agent_context/folders/<folder_slug>/latest/
A folder context registry is written to:
.agent_context/folder_context_registry.csv
Typical generated files include:
agent_context_manifest.json
directory_context.md
large_index_notice.md
folder_tree_summary.md
file_inventory_summary.md
inventory_group_counts.csv
inventory_markdown.csv
inventory_code.csv
inventory_data.csv
inventory_documents_sample.csv
inventory_media_sample.csv
inventory_other_sample.csv
note_index.csv
markdown_outline.csv
markdown_outline_summary.md
note_link_graph.csv
note_link_graph_summary.md
backlink_summary.md
frontmatter_index.csv
frontmatter_index_summary.md
attachment_reference_graph.csv
attachment_reference_summary.md
Vault-level indexing creates a broad map of the full vault.
Run:
Generate Vault Agent Context
Output:
.agent_context/latest/
Vault-level context is best for initial discovery. It helps an agent understand the overall shape of the vault before deciding whether a folder-level scan would be more useful.
Folder-level indexing creates focused indexes for selected folders.
In plugin settings, enter one folder path per line:
Projects/FrameAxis
Literature
Research/Papers
Then run:
Generate Configured Folder Contexts
Output example:
.agent_context/folders/projects__frameaxis/latest/
.agent_context/folders/literature/latest/
.agent_context/folders/research__papers/latest/
Folder-level context is useful when the vault-level index is too broad or noisy. It lets the agent focus on a specific project, literature area, research folder, or working directory.
To generate both the vault-level index and all configured folder-level indexes, run:
Generate All Agent Contexts
This creates or updates:
.agent_context/latest/
.agent_context/folders/<folder_slug>/latest/
.agent_context/folder_context_registry.csv
AGENTS.md pointersThe plugin writes pointer files so agents know where to start.
For vault-level context, the pointer is written at the vault root:
AGENTS.md
For folder-level context, the pointer is written inside the configured folder:
<folder>/AGENTS.md
The plugin does not overwrite an existing AGENTS.md.
If an AGENTS.md already exists, the plugin writes a fallback file instead:
AGENTS.agent-context-indexer.md
The fallback file explains that the existing AGENTS.md was not overwritten and can be merged manually if desired.
Agents should start with the manifest:
.agent_context/latest/agent_context_manifest.json
For folder-level context:
.agent_context/folders/<folder_slug>/latest/agent_context_manifest.json
Recommended order:
agent_context_manifest.json.directory_context.md.large_index_notice.md.folder_tree_summary.md.file_inventory_summary.md.inventory_group_counts.csv.note_index.csv and markdown_outline.csv to select relevant notes.note_link_graph.csv, backlink_summary.md, and frontmatter_index.csv for note navigation.attachment_reference_graph.csv for references to PDFs, images, data files, and other non-Markdown files.Obsidian Agent Context is designed to be local-first.
AGENTS.md files.For more details, see SAFETY.md.
The core design principles are:
For more details, see DESIGN.md.
.gitignoreGenerated context files usually should not be committed to a vault repository unless you intentionally want to share them.
Example:
.agent_context/
AGENTS.agent-context-indexer.md
**/AGENTS.agent-context-indexer.md
Whether to commit AGENTS.md depends on your workflow.
Possible future improvements:
.agent_context/runs/This project is in early MVP development. It is usable locally, but the format and generated outputs may change as the plugin is tested on more vaults.