dev.baschen.is

okvault: an Obsidian vault as team memory for coding agents

Agents relearn the same things every session: how we release, why a service is set up the way it is, what went wrong last time. okvault keeps that knowledge in plain Markdown that people edit in Obsidian and review in git, and serves it to Claude Code over MCP with ranked search, instant FAQ answers and the context of the Jira ticket being worked on.

In short. A single Go binary. The vault is the source of truth and is committed whole: no database, no index files, no embeddings to download. The search index is rebuilt in memory at start-up and on every file change.

Seven MCP tools: kb_ask, kb_search, kb_get, kb_list, kb_ticket, kb_review and kb_write.

The format: OKF, read by Obsidian

Notes follow the Open Knowledge Format (v0.2). Each file is one concept: Markdown with YAML frontmatter in which only type is required. index.md files list each folder and log.md records changes, newest first. Obsidian shows the same frontmatter as properties, so nothing needs translating:

Lookup: BM25 first, and a FAQ path that would rather say no

Search is bleve with BM25 scoring and field boosts: title 4, aliases 3, description and tags 2, body 1. Title and body tolerate one typo, at a fifth of the weight. Hits are compact (path, title, a one-line snippet) and an agent reads the full note with kb_get, which keeps its context small. For a curated vault of a few thousand notes, keyword search is fast, explainable and needs nothing installed.

kb_ask is the fast path for questions. It returns a stored answer only when it is confident:

  1. Exact match. The question equals an FAQ title or alias once lower-cased and stripped of punctuation.
  2. Strong overlap. Otherwise, both sides go through the index's English analyzer (stop words, stemming). The answer comes back only if the terms overlap by at least 0.6 (Dice) and the FAQ covers at least 75% of the question's terms.
  3. Otherwise, no answer. confident: false with the five best search hits, so the agent reads further instead of repeating a near-miss as fact.

The coverage rule is there because of an early bug: a short FAQ, "What is okvault?", was answering "What is the okvault license?". The two share most of their words, but the FAQ doesn't cover the question.

Teams: knowledge in the vault, tasks in Jira

Tickets stay in Jira; copying them into the vault would only create stale duplicates. Notes reference them instead, and okvault connects the two directions.

The server's instructions tell the agent to use it as a loop:

  1. Start. Call kb_ticket and read the linked notes.
  2. Work. Search and ask as needed.
  3. Finish. Write down what the team should remember, such as a decision, a gotcha or a new FAQ answer, with kb_write and tickets: [PROJ-123], updating existing notes rather than adding near-duplicates.

Jira access is read-only on purpose. One GET /rest/api/{3|2}/issue/{key} covers it. Cloud's v3 API returns descriptions and comments as Atlassian Document Format (JSON), which okvault flattens to text; Data Center's v2 returns wiki markup, kept as is. Commenting or moving a ticket would post on someone's behalf, so the agent gets no tool for it.

Credentials come only from the environment of whoever runs okvault (JIRA_API_TOKEN, plus JIRA_EMAIL on Cloud). .okvault.yaml is committed with the vault, so it rejects unknown keys and URLs with credentials in them: a token pasted there by mistake fails loudly instead of landing in git.

Trust: who wrote it, and who checked it

A vault that agents write to needs a way to tell checked knowledge from unchecked. okvault uses OKF's own provenance keys rather than inventing new ones.

KeySet byMeaning
generated: {by, at}Every kb_writeWhich agent last wrote the note, and when
verified: [{by, at}]okvault verify, run by a personWho checked it. The name comes from git config user.name, never an email
stale_afterokvault verifyMoved one review interval ahead (180 days by default)
ownersThe note, or a folder default in .okvault.yamlWho is responsible for it

A note is unverified while its last agent write is newer than its last human check. kb_review (and okvault review --owner alice) is the maintenance queue: stale notes, unverified agent edits, drafts, broken links and notes without an owner. There is no MCP tool to verify, so the signal stays human. An agent with file access could still edit the key, which is what git review of the vault is for.

Many writers, one git repository

Trying it

go install github.com/baschen-dev/okvault/cmd/okvault@latest
okvault ask --vault ./vault "how do I add an faq"
okvault ticket --vault ./vault PROJ-123
claude mcp add --scope user okvault -- okvault serve --vault /path/to/vault --author claude-code

--read-only removes kb_write entirely, which suits a shared vault that only people edit.

Status

Unit tests, in-memory MCP tests and a stdio smoke test that drives the real binary pass in CI on Linux and Windows, and I use it from Claude Code against its own vault. The Jira client has been tested only against a mock server that returns real API shapes, not against a live Jira site. Embeddings are a possible later addition behind the same search package, as an option, so the binary still needs nothing else installed.

← All articles