Documentation
¶
Overview ¶
record_decision — a single tool call that writes a well-structured, frontmatter-tagged knowledge note into the vault.
Why this exists: watching the agent try to "update the roadmap," it burned minutes fumbling note structure — which path, which heading, what frontmatter. This tool removes that reasoning entirely: the STRUCTURE is baked into the tool, so the model supplies only the content (title/type/project/tags/body) and gets a correctly-formatted note filed under agent/decisions/ with Dataview-queryable frontmatter matching the vault protocol convention.
It writes to the vault filesystem directly (like vault_note), so it works whether or not the MCP vault server is connected — and it is NOT a duplicate of any MCP tool (nothing in the Obsidian MCP suite encodes this convention), so it survives the file-layer dedup.
Local semantic search — embeddings over the vault.
Substring search fails exactly when memory does: you remember the *concept* ("that clustering IP problem") but not the keyword (RegisterAllProvidersIP). With an embedding model loaded in LM Studio and "embed_model" set in config, vault_search gains a "related by meaning" section powered by a local index.
Design: notes are chunked by paragraph (~1200 chars), embedded via the standard /v1/embeddings endpoint in batches, and cached in a gob file under ~/.agent/index/ keyed by vault path. The index is INCREMENTAL: each search rescans the vault by (path, mtime, size) and embeds only new or changed chunks — a stable vault costs one query embedding per search, nothing more. No vector database; at personal-vault scale a linear cosine scan over a few thousand chunks is microseconds.
Everything degrades: no embed_model configured → keyword search only, silently. Embedding server errors → keyword results plus one dim note.
Structured & atomic editing — the "safe refactor" toolset.
Three capabilities the plain edit_file loop couldn't give a small model:
edit_files — N edits across M files applied ATOMICALLY: every edit
validates first, then all apply, or none do. The DI
refactor failed repeatedly because the model changed
todo.go, broke the build, and couldn't change cmd/*.go
in the same breath — the tree was red between turns.
This makes "change the signature and every caller" one
indivisible step.
rename_symbol— a REAL rename via gopls, not text substitution: renames
the declaration and every reference across packages,
respecting scope (won't touch a same-named field on an
unrelated type). Falls back with a clear message when
gopls isn't installed.
go_diagnostics—type errors and vet findings from gopls WITHOUT a build,
so the model can check its work cheaply mid-turn.
Plus parseTestFailures (used by the verify loop): turns a wall of `go test` output into just the failing tests and their file:line assertions, so the model gets a target instead of a haystack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDecisionTool ¶
func RegisterDecisionTool()
RegisterDecisionTool adds record_decision when a vault is configured.
func RegisterEmbedTools ¶
func RegisterEmbedTools()
RegisterEmbedTools adds code_search when an embedding model is configured.
func RegisterStructuredTools ¶
func RegisterStructuredTools()
RegisterStructuredTools adds the atomic/gopls tools. gopls tools are registered even when gopls is absent — they return an install hint rather than vanishing, so the model learns the capability exists.
func RegisterVaultTools ¶
func RegisterVaultTools()
Types ¶
This section is empty.