Skip to content

feat: let JARVIS search an Obsidian vault, read-only - #24

Open
luca-71 wants to merge 2 commits into
ethanplusai:mainfrom
luca-71:feat/obsidian
Open

feat: let JARVIS search an Obsidian vault, read-only#24
luca-71 wants to merge 2 commits into
ethanplusai:mainfrom
luca-71:feat/obsidian

Conversation

@luca-71

@luca-71 luca-71 commented Aug 10, 2026

Copy link
Copy Markdown

Ask "what did I write about X?" and JARVIS searches your Obsidian vault and reads the note back.

Stacked on #23. It extends the action vocabulary that PR introduces, so it is branched from it rather than from main to avoid a guaranteed conflict. Review #23 first.

Why the filesystem

A vault is a folder of Markdown files. This reads it directly — no AppleScript, no TCC permission prompt, no Local REST API plugin to keep running, no sync daemon. It is the simplest integration in the project, and the only one that cannot be broken by a macOS update.

OBSIDIAN_VAULT switches it on. Unset, every function returns empty and JARVIS simply has no vault; the settings panel shows the row greyed rather than red, because an unconfigured vault is opt-in, not broken.

Read-only, by design

Following mail_access: no create, edit, move, or delete function exists. Not disabled — absent. A voice assistant that mishears one word in ten must not be able to alter the user's own knowledge base.

Two guards back that up:

  • read_vault_note resolves its path from search results and then re-checks it against the vault root. The query arrives from a speech transcript by way of an LLM, so it is untrusted, and a note name is not a licence to read the disk. Verified against ../../.ssh/id_rsa, ../../../etc/passwd, and /etc/passwd — none escape.
  • Machinery folders (.obsidian, .git, _attachments) are skipped, and oversized files are ignored.

Search

Walks the notes rather than keeping an index — an index can go stale, and a vault is small enough that walking it is imperceptible (110 notes, 466KB, ~30ms). Title matches outweigh body matches ten to one, since notes are named deliberately: memoria in a filename is a stronger signal than the same word buried in a paragraph.

Exposed as [ACTION:VAULT] search terms. Measured 0/21 misroutes across Italian and English phrasings, including conversational controls that must produce no tag at all. The extracted queries are clean: "Cosa ho scritto nelle mie note sul marketing della piramide?"piramide marketing.

A bug this exposed

The lookup collision guard suppressed any result arriving within 3s of the last utterance — but the utterance it measured was the one that ordered the lookup. Every fast lookup therefore silenced itself:

LLM embedded action: {"action": "vault", "target": "piramide marketing"}
Skipping lookup audio for vault — user spoke recently
Lookup vault complete: Your note "la-piramide-marketing" says: Piano Marketing …

The search worked perfectly and the answer was thrown away. Calendar and mail hid this by being slow enough to fall outside the window; a 30ms vault search never once got through. The guard now compares against the requesting turn, so it fires only when the user has genuinely started a new one — which is what it was always meant to mean.

Known nit

With a lookup this fast, the result can occasionally beat the acknowledgement out of the socket, so the two arrive in the wrong order. It reads oddly but loses nothing. Fixing it properly means signalling the lookup task once the main response has been sent, which is more restructuring than the symptom justifies here.

Testing

pytest tests/ gives 35 passed, 8 failed — identical to this branch's base, so no regressions. The 8 pre-existing failures are unrelated: 7 need playwright install, and test_browse_action_keywords imports ACTION_KEYWORDS, a symbol that no longer exists in server.py. tsc --noEmit clean.

Verified end to end against a real 110-note vault: the disabled path, a non-existent path, path traversal, routing, and the spoken result.

🤖 Generated with Claude Code

Luca Trisiello and others added 2 commits August 10, 2026 18:16
Asked "what's my schedule today?", JARVIS reached for [ACTION:SCREEN] and
described the monitor. The reason was visible in the raw completions:

  "[ACTION:SCREEN] Good evening, sir — let me pull up your calendar"

The intent was right and the vocabulary was wrong. The calendar and mail
lookups existed, but only the hardcoded English phrase table could reach
them — they were never offered to the model as action tags. SCREEN was the
only inspection action it had, so it substituted, and a monitor photograph
came back instead of a schedule.

Add [ACTION:CALENDAR] and [ACTION:MAIL], wired to the same
_lookup_and_report machinery the phrase table already used, and narrow
SCREEN's description to the display itself.

This is not an i18n fix. English was equally broken; it was merely masked,
because the phrase table intercepts the exact wordings before the model is
consulted. Anything unlisted fell through — "When is my next appointment?"
went to SCREEN too, and now does not.

Measured over 12 phrasings x 3 runs per language, comparing the tag chosen
against the tag expected:

  English   6/21 wrong -> 0/36
  Italian   9/21 wrong -> 0/36

Also give the two actions their own acknowledgement. The model tends to
write prose after the tag, which is parsed as the target and stripped, so
without this the spoken line degraded to a bare "Right away, sir."

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A vault is a folder of Markdown files, so this reads the filesystem
directly — no AppleScript, no TCC prompt, no plugin or REST bridge to keep
running. Set OBSIDIAN_VAULT to switch it on; unset, every function returns
empty and JARVIS simply has no vault.

Read-only by design, following mail_access: no create, edit, move or delete
function exists. A voice assistant mishearing a command must not be able to
alter the user's own knowledge base.

Search walks the notes rather than keeping an index, which cannot go stale
and is trivially fast at vault scale. Title matches outweigh body matches
ten to one, since notes are named deliberately. read_vault_note resolves
its path from search results and then re-checks it against the vault root:
the query arrives from a speech transcript by way of the model, and a note
name is not a licence to read the disk.

Exposed as [ACTION:VAULT] with the search terms as its target, alongside a
status row in the settings panel. Measured 0/21 misroutes over Italian and
English phrasings, including controls that must produce no tag.

Also fix the lookup collision guard, which this feature exposed. It
suppressed any result arriving within 3s of the last utterance — but the
utterance it measured was the one that ordered the lookup, so every fast
lookup silenced itself. Calendar and mail hid this by being slow; a vault
search takes 30ms and was never once heard. It now compares against the
requesting turn, so the guard fires only when the user has genuinely
started a new one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant