Personal Knowledge Vault

A private-by-default knowledge vault: your notes stay on your machine, and the cloud is used only when you explicitly approve exactly what gets sent.

Inspiration

Our notes are the most personal thing we own — journals, health notes, finances, half-finished ideas. The best AI models live in the cloud, so every "AI for your notes" tool asks you to upload the whole vault first. That trade-off never felt acceptable. We wanted the opposite default: private unless you say otherwise, with the AI still useful enough to be worth opening.

What it does

Knowledge Vault opens a folder of Markdown and PDF notes directly from disk and gives every note a label:

  • Private — runs ONLY_ON_DEVICE via Gemini Nano. If the on-device model isn't available, the feature fails loudly; it never silently falls back to the cloud.
  • Shareable — eligible for cloud requests, but only after approval.

On top of that, it offers instant local keyword search, streaming on-device summaries, on-device action-item extraction as structured JSON, and cross-document Q&A in the cloud with citations that jump to the source passage. Before any cloud call, a What leaves your device panel shows the notes, chunk count, character count, and the actual text, and every answer is stamped Answered on-device or Answered in cloud.

How we built it

SvelteKit 5 (static SPA) with Vite, TypeScript, Tailwind CSS 4 and daisyUI 5. Vault import uses the File System Access API, PDF text comes from pdf.js, notes are chunked with frontmatter awareness and persisted in IndexedDB, and search is MiniSearch over a local index — no embeddings, no network. The AI layer wraps firebase/ai, building one model per InferenceMode (ONLY_ON_DEVICE with the Chrome Prompt API / Gemini Nano, ONLY_IN_CLOUD with a Gemini Flash-Lite model) and routing each request through a privacy module that validates labels, assembles the payload before sending it, and blocks private notes outright. Cloud answers are schema-constrained JSON whose citations are checked against real chunk IDs. App Check with reCAPTCHA Enterprise protects the quota, and the app deploys as a static build to GitHub Pages through a GitHub Actions workflow.

Challenges we ran into

  • Hybrid inference is narrow. Firebase AI Logic's on-device path is web-only Chrome desktop, single-turn text-only, with a small context window. That forced chunking plus map-reduce summaries, and a UI that explains availability instead of pretending.
  • Honest privacy is hard to prove. We had to make the claim inspectable: the approval panel reuses the exact payload that gets sent, and the mode badge reads the SDK's reported inferenceSource rather than our own assumption. Refusing to fall back to the cloud meant turning a convenience into a deliberate error path.
  • Citations that lie. Models happily invent sources, so we validate every returned chunk ID against the real vault and drop anything that doesn't resolve.
  • On-device model setup. Gemini Nano may need a flag and a multi-minute download, which we surface with an availability chip and a progress indicator, and initializeDeviceModel has to be triggered from a real user gesture.
  • Deployment details that bite. Static hosting needed SPA fallback, a base path for the project-pages URL, .nojekyll so the _app/ assets survive, build-time inlining of the Firebase config, and the deployed origin registered under App Check.

Accomplishments that we're proud of

  • The privacy story is real and demonstrable: private-note actions complete with an empty Network tab or in airplane mode, and the guardrail visibly refuses to send a 🔒 note to the cloud.
  • A hybrid app where the split is a product feature instead of an implementation detail — the label decides the backend, and the user sees which one answered.
  • On-device structured output (action items as validated JSON) and cloud answers with citations that actually open the right note and highlight the passage.
  • The vault, search, labels, and setup diagnostics all work with zero API keys; AI is an addition, not a prerequisite.

What we learned

Privacy is a UX problem as much as a cryptography problem. A guarantee nobody can see is a guarantee nobody trusts, so we spent disproportionate effort on the payload panel, the mode badges and the refusal paths. I also learned to design for model constraints: small on-device context makes summarisation and extraction a natural fit, and leaving multi-document reasoning to the cloud is both a technical and a narrative win. Finally, schema-constrained output plus server-side validation is far more reliable than asking nicely for JSON.

What's next for Personal Knowledge Vault

  • Deep research over notes plus Google Search grounding, the first item our plan deliberately cut from the MVP.
  • Semantic search with local embeddings alongside the keyword index.
  • Optional end-to-end encrypted sync, so a vault can follow you across machines without becoming someone else's data.
  • Conversation history and a graph view of how notes connect.
  • Broader on-device coverage as hybrid inference reaches more browsers and platforms, with the same router and the same labels.

Built With

Share this project:

Updates

Submission history