← all projects

slate-ai

A private notes assistant — on-device LLM for offline summarisation, a cloud model for deep synthesis, local embeddings + retrieval over your own notes.

View on GitHub ↗Kotlinupdated 5d ago

KotlinLiteRTRAGCompose

High-level design

A notes assistant that treats 'ask the cloud' as an escalation, not the default — most queries never leave the device.

chunker

sentence-aware splitting so retrieval doesn't cut mid-thought

embedding + cosine retrieval

pure Kotlin, runs on-device

router

decides on-device vs cloud based on query shape and retrieval confidence

on-device model (LiteRT)

handles short lookups and summarisation

cloud escalation

only for queries the router can't confidently answer locally

Low-level design

12 tests cover the retrieval pipeline and the routing policy specifically — the router is what's most likely to silently regress.

  • Routing decision is a pure function of query length, retrieval confidence, and latency budget — testable without a real model loaded
  • Compose UI observes a single sealed-class UI state, so there's no partial-update bugs