Pull bounded, citation-ready context packs from any personal Markdown knowledge vault (Obsidian-style) for a downstream agent: token budgets, source-grounded extraction, and a handoff contract. Triggers when an agent needs vault context for a follow-up agent, when a handoff needs every claim traceable to a note, or when note context must fit a hard token budget.
./install.sh obsidian-vault-contextname: obsidian-vault-context description: "Pull bounded, citation-ready context packs from any personal Markdown knowledge vault (Obsidian-style) for a downstream agent: token budgets, source-grounded extraction, and a handoff contract. Triggers when an agent needs vault context for a follow-up agent, when a handoff needs every claim traceable to a note, or when note context must fit a hard token budget."
Given a query and a token budget, extract exactly the vault notes that answer the query, assemble them into a self-contained context pack, and attach a handoff contract so the downstream agent knows what the pack contains, what it does not, and which note every claim came from. Works on any Markdown vault that uses YAML frontmatter, tags, and wikilinks (Obsidian, Logseq-exported, plain Markdown notes).
.md files. For each note, parse the YAML frontmatter (title, tags, aliases, date, status) and the body. Resolve wikilink [[Note#Heading]] and ^block-id references so quotes can point at a section or block, not just a file.relevant, partial, or off-topic and keep only the first two. Cut anything dated, tagged archive, or with status: draft unless the requester asked for it.note path, section, and date from frontmatter.For the grading rubric, scoring details, and the full handoff schema, read references/method.md. For quick local packs, use the CLI: `bin/pack.py <vault> <query> --budget 2000`.
A finished pack always has four parts:
PACK: the quoted sections in rank order, each labeled with a stable source id (S1, S2, ...), note path, section heading, and frontmatter date.COVERAGE: one line per sub-question of the query: covered by which source ids, or marked GAP when no note answers it.GAPS: explicit list of what the vault did not contain, so the downstream agent does not mistake absence for evidence.HANDOFF: the contract block below.HANDOFF contract fields:
json
{
"query": "the original question",
"token_budget": 2000,
"tokens_used": 1730,
"source_count": 4,
"vault_path": "/path/to/vault",
"built_at": "2026-10-08",
"instruction": "Answer only from the PACK. Cite claims as [S1], [S2]. A claim you cannot cite is uncertainty: say so."
}
[...].undated). An old note next to a new one must be visibly old.publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e
No ratings yet — be the first to rate it.