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:
aliases, a native Obsidian key, doubles as the list of other ways people ask an FAQ question.- The committed
.obsidian/app.jsonmakes Obsidian write relative Markdown links instead of wikilinks, so links work in Obsidian, on GitHub and in any OKF tool. - Keys okvault doesn't know are preserved on every write, as the spec requires.
- Per-device Obsidian state (
workspace.json) is ignored; settings and templates are committed.
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:
- Exact match. The question equals an FAQ title or alias once lower-cased and stripped of punctuation.
- 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.
- Otherwise, no answer.
confident: falsewith 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.
- Linking.
tickets: [PROJ-123]in a note's frontmatter links it on purpose. A key written in the text counts as a mention, but only for project keys listed in the vault's.okvault.yaml: a generic pattern would treatUTF-8as a ticket. - Exact keys in search. The English analyzer splits
PROJ-123intoprojand123, so ticket keys go into a separate exact-match field. - Ticket context.
kb_ticket PROJ-123returns the ticket (summary, status, assignee, description, the last three comments), the notes that link to it or mention it, and notes matching its summary. Without Jira credentials it still returns the notes.
The server's instructions tell the agent to use it as a loop:
- Start. Call
kb_ticketand read the linked notes. - Work. Search and ask as needed.
- Finish. Write down what the team should remember, such as a decision, a
gotcha or a new FAQ answer, with
kb_writeandtickets: [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.
| Key | Set by | Meaning |
|---|---|---|
generated: {by, at} | Every kb_write | Which agent last wrote the note, and when |
verified: [{by, at}] | okvault verify, run by a person | Who checked it. The name comes from git config user.name, never an email |
stale_after | okvault verify | Moved one review interval ahead (180 days by default) |
owners | The note, or a folder default in .okvault.yaml | Who 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
- No silent overwrites.
kb_getreturns a revision, a short hash of the file's bytes.kb_writewithbase_revisionfails if the note changed since, whether a teammate edited it in Obsidian or agit pullbrought in a new version, and the agent reads it again and merges. - Generated files are rebuilt, not merged. On an
index.mdconflict, take either side and runokvault index. CI fails if an index is out of date. - The log merges by union.
log.mdis append-only, so.gitattributessetsmerge=union. When two branches logged on the same day,okvault indexmerges the duplicate date sections back together. A custom merge driver was ruled out because it would need setup in every clone's.git/config. - Live edits. While the server runs, it reloads within about 300 ms of any
change to a note or to
.okvault.yaml, and keeps generated indexes current.
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.