Kosh (कोश)
Offline-First On-Device AI Vault & Local Second Brain for Android
Kosh (meaning Vault or Treasury in Sanskrit and Hindi) is a private, offline-first Android AI assistant built in native Kotlin and Jetpack Compose. It runs quantized LLMs directly on mobile NPU, GPU, and CPU silicon via Google LiteRT, pairing local PDF and Markdown retrieval with AES-256-GCM encrypted sealed vaults, biometric lock, and zero-telemetry backups.
Runs quantized .litertlm models (Gemma-4-E2B, Qwen2.5, phi-4-mini) locally with a live HUD tracking decode speed (34.5 t/s GPU), load, and RAM.
Per-session at-rest encryption via Android Keystore, PBKDF2 key derivation, explicit RAM key zeroing, and 12-word BIP39 recovery.
Extracts and chunks PDFs, Markdown, and text files on-device with stop-word fallback retrieval and clickable inline source citations.
Zero analytics or mandatory servers. Supports RAM-only temporary sessions, FLAG_SECURE screenshot controls, and encrypted .kosh backups.
Inside the Vault
Screens captured directly from Kosh v2.0 on Android across Obsidian, Aero Glass, and Sand themes. Select any screen to inspect full-resolution detail.
Local Neural Core & Cryptographic Vault Security
Most AI assistants stream private journals, contracts, and code to external servers. Kosh keeps both neural inference and encrypted knowledge storage strictly inside your Android device.

Hardware-Accelerated Inference & Offline Document RAG
Runs quantized .litertlm weights directly on Qualcomm Hexagon NPU, mobile GPU, or CPU while PDFBox-Android and SQLite FTS4 chunk, index, and cite local PDFs and notes with zero network calls.

Sealed Vaults, BIP39 Recovery & Atomic .kosh Backups
Lock individual threads or the entire app behind biometrics and PBKDF2-derived AES-256-GCM keys, erase active keys from RAM via DestroyableSecretKey, recover via 12-word BIP39 phrases, and verify backup AEAD tags atomically.
What Kosh Does
On-device LiteRT inference, AES-256-GCM sealed vaults, offline SQLite FTS4 RAG, and a multi-theme Jetpack Compose interface.
Multi-Model LiteRT Hub & Tag Routing
Import and verify multiple local LLM weights (.litertlm/.bin), switch between NPU, GPU, and CPU backends, and route chats with Fast, Balanced, and Deep Think modes.
Sealed Vaults, Biometrics & BIP39
Encrypt individual chat sessions and attached documents at rest with AES-256-GCM, unlock via Android Biometrics, and recover keys offline using a 12-word BIP39 mnemonic.
Offline PDF & Note RAG With Citations
Parse local PDF, Markdown, and TXT files via PDFBox-Android into SQLite FTS4 virtual tables with stop-word fallback and clickable inline source badges.
Rich Compose Renderer & Bundled KaTeX
Streams structured responses with collapsible Thinking blocks, formatted Code cards, persistent SQLite checklists, offline KaTeX math typesetting, and chunked Android TTS.
Hybrid Web Search & Local Agent Skills
Optional direct web search (OkHttp/Jsoup DOM extraction + OpenGraph previews) alongside a multi-turn ReAct AgentLoopExecutor with native Android and sandboxed JS skills.
Three Themes, Incognito & .kosh Backups
Switch between Obsidian, Aero Glass, and Sand themes, run RAM-only temporary sessions, control FLAG_SECURE screenshots, and export password-encrypted .kosh archives.
How It's Built
Structured across 72 Kotlin files separating Domain use cases, isolated native JNI delegates, SQLite v8 storage, and declarative Jetpack Compose UI.
Jetpack Compose MVI & Multi-Theme System
Reactive StateFlow architecture driving custom Markdown, Thinking, Code, Checklist, and bundled offline KaTeX renderers with stabilized LazyColumn streaming and three native palettes.
LiteRT & Qualcomm QNN Hexagon Delegate
Agnostic AIProvider wrapping LiteRTModelProvider with JNI lifecycle synchronization, legacy jniLibs extraction for QNN NPU drivers, sliding-window context budgeting, and live telemetry HUD.
SQLite v8 Vault, FTS4 Index & PDF Pipeline
Relational SQLite schema with foreign-key cascades, corruption self-healing backup handler, FTS4 triggers over PDFBox text chunks, relational color tags, and persistent message feedback.
AES-256-GCM Cryptography & Skill Sandbox
Per-session ciphertexts backed by Android Keystore, DestroyableSecretKey memory zeroing, atomic AEAD backup verification, BIP39 recovery, and bounded 5-turn ReAct tool execution.
Open Source & Privacy Promise
No telemetry, no analytics, and no mandatory cloud servers. Kosh v2.0 is open-source on GitHub with architectural documentation, NPU optimization guides, and a transparent zero-collection privacy policy.
