Repository navigation
Offline Tooling and Documentation
PAIOS ships a complete 23-page Google ML Kit GenAI & Android AICore Documentation Hub plus embedded PAIOS self-knowledge—available 100% offline inside the app and queryable by Gemini Nano via RAG.
Defined in assets/docs/docs_manifest.json, the in-app Docs Explorer bundles 22 official Google ML Kit GenAI pure-Markdown guides alongside PAIOS's Hardware & Device Eligibility / Error Matrix (devices.md.txt / genai.md.txt):
- Direct Model Access (Prompt API): Overview, Get Started, Prompt Design, Evaluate Prompt Quality, System Instructions, Prefix Caching, Structured JSON Output, Thinking Mode, Function Calling, Model Selection & TPU Acceleration.
- Agentic Workflows: Overview, Defining & Registering Tools, Managing Sessions & Lifecycle, Streaming Events & UI Synchronization.
- Task & Modality APIs: Speech Recognition, Real-Time Speech Translation, Neural Text-to-Speech, Multimodal Image Description & OCR, Summarization, Proofreading, Rewriting, On-Device Vector Embeddings.
-
Hardware & Errors:
Supported Hardware & Device Eligibility Matrixand verifiedGenAiException.ErrorCodetaxonomy.
Every guide uses a Stale-While-Revalidate (SWR) pipeline without scraping HTML:
-
Tier 1 — Bundled Offline Assets: All 23
.md.txtfiles live inassets/docs/for instant0msoffline access. -
Tier 2 — Local Disk Cache: Synced updates are written atomically to
${appDocumentsDir}/docs_cache/${id}.md.txt. -
Tier 3 — Direct Google
.md.txtEndpoints: Manual refresh (refreshDoc(id)inDocExplorerPage) fetches Google Developers' native pure-Markdown.md.txtURLs (e.g.https://developers.google.com/ml-kit/genai/prompt/android.md.txt).-
Captive-Portal Protection (
_isHtml): Before overwriting Tier 2 cache,_isHtmlverifies the response is not an HTML login/error page, safely preserving offline Markdown. -
Explicit UTF-8 Decoding: All remote doc fetches decode
response.bodyBytesas UTF-8. -
Performance (
v1.8.9): Background per-turnsyncRemoteDocs()HTTP calls were eliminated from the chat generation path so inference never incurs unnecessary network overhead.
-
Captive-Portal Protection (
Rather than stuffing feature lists into every prompt's system instruction, PAIOS keeps system_default.md at 2 sentences and moves identity/capability facts into offline RAG (paios.docs, enabled by default):
-
Canonical Tool & Aliases:
query_aicore_documentationplus normalized aliasesabout_paios,paios_info, andget_paios_info(InternalToolsHelper.DOCS_TOOL_ALIASES). -
Query Normalization: Prompts like
"who are you","tell me about yourself","what are you", or"introduce yourself"normalize automatically to"PAIOS overview features". -
Self-Knowledge Sections (
genai.md.txt/devices.md.txt):PAIOS Overview, Identity & PrivacyPAIOS Model Variants, Thinking Mode & MultimodalityPAIOS System Assistant Overlay & On-Demand Screen InspectionPAIOS Extensions & M3x Mesh Ecosystem
-
Term-Frequency Ranking (
rankDocumentationSections): Scores matching documentation sections offline across both Dart (DocService) and Kotlin (InternalToolsHelper), boosting PAIOS identity sections on overview queries and returning concise excerpts ready for synthesis.
Related Pages: M3x Mesh Ecosystem & Extensions · Localization & Prompts · Supported Devices & AICore Error Taxonomy
PAIOS (page.puzzak.paios) — Synced with v1.8.9+26112001 | GitHub Repository · Nightly Google Group · Play Testing Opt-In · Report an Issue