AI conversation summaries¶
End-user workflow (engines, MLX vs CPU, Metal helper messaging): Catch up user guide.
Catch up summarizes the selected conversation without posting to the mesh. It supports Meshtastic and MeshCore channels/DMs, Reticulum LXMF DMs, MeshCore rooms and RRC rooms. The shared button and card provide unread/hour/loaded scopes, streamed text, cancellation, copy, regenerate, dismiss, actual message count, truncation disclosure and a settings link. Summaries are session memory only and should be checked against original traffic.
Opt-in and privacy¶
AI starts disabled, with no model selection. Only App > AI conversation summaries and launcher
settings search expose the feature before opt-in. The optional startup ai:getStatus reads
settings without downloading, probing OS AI, creating a model directory or starting workers.
Native availability probes run only in open AI settings or on an explicit test/summary request.
A saved OS choice exposes Catch up after restart; the first click rechecks native readiness.
After opt-in, an incomplete engine configuration or a missing/removed downloaded model shows
Set up Catch up, which opens App > AI conversation summaries. Choosing a ready engine restores
the range and generation controls. Setup does not read conversation history or start inference.
While startup status is unavailable, a strictly true saved opt-in exposes only this setup action.
Authoritative disabled status overrides the cache. Status reads have a ten-second deadline,
three startup attempts and another opportunity on window focus; teardown cancels recovery.
Only an authoritative ready status permits history access or inference. Late status results
cannot overwrite newer requests or configuration changes.
The main process owns endpoint requests and API keys. AiConfig encrypts keys with safeStorage,
rejects insecure OS storage and drops a key when its endpoint or engine changes. Provider blobs
are excluded from generic app-settings reads, and only validated ai:* writes may change AI
state, so generic preference writes cannot bypass disable teardown or endpoint validation.
Remote engines require HTTPS plus an acknowledgment specific to the saved endpoint. Local
engines accept literal loopback/private LAN and .local hosts. All endpoints disclose their
host on the result, including LAN servers, which receive text off-device. Settings warn when an
API key would be sent to an unencrypted HTTP LAN endpoint, including an already saved key. Redirects fail closed.
Gemini credentials use a header rather than the URL. Provider errors never include bodies or keys.
Disable/configuration changes abort active main requests, terminate native helpers, cancel model jobs as appropriate, invalidate renderer requests and clear displayed summaries. Loaded WASM is released at the end of each generation, cancellation or disable. Inference never invokes tools, interprets HTML or posts messages. JSON-quoted transcript lines and untrusted-data instructions reduce prompt injection risk; they do not guarantee model obedience.
Engines and platform limits¶
| Engine | Platforms | Requirements |
|---|---|---|
| Apple Intelligence | macOS 26+ | Eligible hardware, Apple Intelligence enabled, staged universal Foundation Models helper |
| Windows Phi Silica | Windows 11 24H2+ | Copilot+ hardware, ready model, Microsoft LAF token/attestation and supported package identity with systemAIModels |
| Downloaded (GGUF) | macOS, Windows, Linux | Explicit verified GGUF download and selection; bundled wllama 3.8.1 CPU WASM worker |
| Downloaded (MLX) | macOS Apple Silicon | Explicit verified MLX pack download; staged arm64 mesh-ai-mlx helper (mlx-swift-lm); Metal Catch up |
| Local server | All | Ollama, LM Studio, llama.cpp, vLLM, LocalAI or compatible endpoint |
| Remote provider | All | OpenAI-compatible, Anthropic, Gemini or Ollama wire format, HTTPS and acknowledgment |
Linux has no built-in OS LLM API. Unsupported OS/hardware hides that choice.
The existing Windows NSIS distribution does not supply the required package identity or
Microsoft-issued LAF credentials. The Windows helper therefore reports unavailable in that
installation. Compilation alone does not establish Windows OS AI readiness. Its project accepts
maintainer-provided AiLafToken/AiLafAttestation MSBuild properties; do not invent these values
or request a model download during a probe. Native CI compiles both Windows RIDs, but NSIS packaging deliberately excludes the
helper and its self-contained runtime until package identity is supported. The other engines are available without those Windows requirements.
Native helper source lives in native/ai/; scripts/build-ai-helper.mjs stages binaries and
runtime dependencies under resources/ai-helper/. Build/release CI compiles the Apple Foundation
Models helper before packaging. On Apple Silicon hosts the same script also builds optional
mesh-ai-mlx (SwiftPM under native/ai/mlx/). A missing optional helper warns and leaves OS AI
and/or MLX Catch up unavailable; it does not block local distribution builds. Large binaries and
Swift caches are excluded from Git and packaged resources. Swift Foundation Models returns
cumulative snapshots, so its helper emits only new suffixes. Windows has no max-output-token option
in this API; its helper uses a conservative 1,000-character bound.
Follow-up questions¶
After a Catch up completes, the shared card offers an inline Ask field. Answers stream under the
summary with prior turns kept in session memory. Follow-ups are stateless re-prompts on the
existing ai:summarize IPC: the request carries an optional followUp object (question, summary,
prior turns, contextKind) plus selected source messages — no new channel, no mesh posting, no
persistence.
Context retention (renderer session only):
- Always retain a newest-first raw transcript window capped at
AI_FOLLOW_UP_CONTEXT_MAX_CHARS(64,000 body characters), with a limited-context disclosure when clipped or otherwise truncated. - Multi-pass: also retain the final pre-final digest list; follow-ups prefer raw messages when present and fall back to digests only when no messages were kept.
- On-device engines (
os/bundled): a deterministic relevance selector scores messages with question + summary tokens (and force-includes pasted/quoted bodies) so anaphoric asks like “how?” can still find the subject. Hyphen compounds such as2-bytekeep a joined token (2byte) so topic asks focus the right bullets. Packing prefers paste and quoted-bullet focus first, then question-topic hits, then newest-first filler, and reserves a larger share of the ~12 KB prompt for transcript lines so a long Catch up summary cannot starve source grounding. - Endpoint engines receive the full retained transcript within the usual 64 KB prompt budget.
- Completed Catch up text strips echoed
/no_thinkmarkers and drops near-duplicate One-offs before display; Ask answers apply the same control-token strip and treat empty post-strip text as an invalid response.
Follow-ups are single-pass, share the renderer FIFO / rate limit / cancel / timeout path, and clear on regenerate, dismiss, disable, or config change. Bundled WASM still reloads the model per generation (show the loading phase). Answers never overwrite Catch up summary text.
Log Analyze with AI¶
The Log panel’s rule-based Analyze modal can offer Analyze with AI when Catch up AI is
opted in and ready and the heuristic analyzer produced at least one finding. Empty packed
findings (sender: 'empty') are rejected in main as noFindings without a docs fetch or
inference, so troubleshooting pages alone cannot invent issues. That path uses the same
ai:summarize IPC with surface: 'log' (single-pass; no follow-ups or multi-pass). Main
allowlist-fetches troubleshooting markdown from
raw.githubusercontent.com/Colorado-Mesh/mesh-client/main/docs/ (same pages as the published
MkDocs site), selects heading sections that match finding tokens under the engine prompt budget,
and builds the prompt via sibling ai-summarize-prompt-prepare.js
(src/main/ai/summarizePromptPrepare.ts, using src/shared/aiLogAnalysisPrompt.ts). A docs fetch failure, or an offline state detected by the main process after a
request starts, produces docsUnavailable. Separately, the Log panel disables the
AI action when the renderer is already offline or there are no findings. The built-in analyzer remains
available either way. See Log analysis.
Data and runtime boundaries¶
src/shared/ai-types.ts is the preload contract. Main services are under src/main/ai/;
src/main/ipc/ai-handlers.ts owns validation, rate limits and lifecycle. Registration is inert.
HTTP adapters parse bounded SSE/NDJSON, require a completion marker, support fragmented UTF-8
and emit coalesced IPC chunks. OpenAI reasoning models use completion-token budgets; Gemini
thinking settings are model-aware. Hidden reasoning has a bounded allowance, while visible text
is independently capped at 1,000 characters per pass. Chunk packing and main share the same
prompt formatter, including escaped text, full local timestamps, conversation metadata and each
map/reduce/final instruction. Source messages stay chronological, with stable ordering at equal
timestamps. Oversized messages are split at Unicode code-point boundaries without losing text
and count once in the completed source coverage. A pass that main cannot include completely
fails rather than claiming a complete summary. Reduction must shrink the digests and is bounded
to eight rounds, preventing a provider from looping forever. Intermediate and final digests are
quoted without synthetic ordering timestamps, so the model cannot mistake sequence numbers for
1970 chat dates. The complete UTF-8 prompt, including framing and metadata, is conservatively bounded
to AI_ON_DEVICE_MAX_PROMPT_BYTES (12,288) for Apple Intelligence and the bundled WASM engine
(AI_BUNDLED_N_CTX = 8,192). That leaves output/template headroom after tokenization for
structured Catch up finals. Leftover selected qwen3-* ids still append /no_think and disable
wllama thinking; the shipped Qwen2.5 pack has no thinking mode. Remote context
capacity remains model-dependent, with an AI_ENDPOINT_MAX_PROMPT_BYTES (64,000) cap.
These budgets are shared via aiSummaryPromptBudget so App → AI capacity copy stays aligned.
A dedicated ai:getHistory query preserves existing generic DB query semantics while adding
inclusive time bounds and exact conversation filters before each page’s limit (default 500,
plus one overflow row). Optional beforeAt/beforeId cursors page older history until the user’s
maxCollectedMessages ceiling. Catch up "since last read" sets byArrival when the caller's read
mark is an arrival time (watermarkClock: 'arrival', Chat and Rooms): the bounds, the order and
the cursor then use COALESCE(received_at, <stamp>), the clock its read mark comes from, and each
row carries that key as order. RRC marks are stamped (watermarkClock: 'stamp'), so RRC "since
last read" and the time-range scopes keep the stamp. Channels follow keyed
identities across slot/radio changes; unkeyed
legacy rows use the existing current/null-radio fallback. DMs and rooms use peer/server and radio
filters; Reticulum uses identity plus full destination hash; RRC uses canonical hub/room and prose
kinds. MeshCore skew normalization occurs before range filtering. idx_mc_msgs_room_ts is additive
and idempotent; no schema version change is needed.
Chat and Rooms reuse their opening unread-divider snapshots while the divider is active.
After the divider is cleared, summaries use the current persisted read watermark; hiding a
divider must never reset the unread range to all history. Empty ranges skip inference. RRC persists canonical read
watermarks through rrcReadWatermark.ts, snapshots before selection clears unread and retains
that boundary while caught-up updates the live watermark. An absent watermark can fall back to
the live unread count when enough opening history exists. Without that history or a known
read boundary, the unread scope starts at opening time; choose an explicit time range to include
older traffic. Derived boundaries cannot lead the local clock. History retention can remove older traffic.
History/live overlap uses a multiset union: matching copies across sources count once, while distinct
messages with identical timestamp/sender/body within either source retain their multiplicity.
The card reports a fixed collected count from the selected range at request start, then the actual
included count after main prepares the prompt. Neither count claims all historical traffic still exists;
new arrivals can increase the live unread badge while a summary runs. Legacy future RRC read values
are repaired in storage once, without emitting change events from the read helper. The pending card never labels
offered messages as included before main confirms coverage.
Channel summaries apply the same default/custom weather patterns and marked-sender rules to fetched
history as to visible chat when hiding weather is enabled. Numeric sender metadata stays local and
is stripped by request validation. DMs and rooms retain weather text. A fully collected multipage
range is complete. Older rows left behind by the collection ceiling or an unavailable pagination
cursor still disclose truncation, even if visibility filtering leaves fewer messages.
Bundled inference returns a validated localJob from main and runs through a thin renderer
AiWorkerHost. Wllama owns the actual WASM worker, so a second wrapper worker is unnecessary.
The module is dynamically imported only for explicit generation, uses bundled WASM, disables
CDN compatibility fallback and suppresses native logging. Vite and the built
mesh-client://renderer origin send Cross-Origin-Opener-Policy: same-origin and
Cross-Origin-Embedder-Policy: credentialless. Both pnpm start and installed apps switch origins only after the
legacy storage copy verifies; failure or a recovery flag keeps file://. When
crossOriginIsolated is true, SharedArrayBuffer enables about half of
navigator.hardwareConcurrency (capped at 8); otherwise Wllama uses one thread. App → AI
warns when that budget is below 6 (isBundledWllamaThreadBudgetLow); the floor is a comfort
threshold from maintainer timing (~45–60s for ~240 messages at 6 threads on one machine), not a
wall-clock guarantee—core speed and model size still dominate, so the UI stays platform-neutral
and does not predict duration. pnpm run dev
explicitly selects Vite; a running Vite server cannot redirect pnpm start. See
renderer origin and recovery for the startup matrix, migration, recovery
flags, and local/installed smoke checks, and renderer storage
for the SQLite-backed read watermarks. A renderer FIFO queue serializes summaries across engines
and conversations until streaming or worker completion, rather than just main-process acknowledgement.
While a Catch up waits behind another job, the card shows a queued status
(“Please wait — another summary is generating…”) instead of the generic preparing copy.
Waiting requests can be cancelled; configuration changes and teardown abort active and queued work.
Each generation deadline starts when its queue slot opens. Queue failures release the next job;
worker cleanup completes before the next downloaded model starts. Conversation range selections
live in the session store, so regenerate keeps the selected range after tab/protocol switches.
App → AI shows an approximate per-engine per-pass message capacity
(estimateAiSummaryMessageCapacity) and a user-configurable Catch up message limit
(maxCollectedMessages, default 2000, range 100–5000). When the collected range exceeds one
prompt budget, Catch up runs hierarchical multi-pass summarization (map digests → reduce → final
structured catch-up) while keeping on-device ~4 KB / endpoint 64 KB budgets per inference.
Small single-pass jobs still ask for up to five factual bullets; larger single-pass jobs and all
multi-pass finals use a structured summary (Conversations + One-offs) with a higher completion
token budget. Follow-ups keep a newest-first capped raw transcript (and multi-pass digests) in
session memory so pasted channel lines can be grounded. History is paginated until the configured
ceiling. Bundled WASM reuses a loaded model across map/reduce steps. Map and reduce passes use a
lower completion token budget than the final pass so multi-pass wall time stays closer to
proportional to coverage rather than maxing out every intermediate digest. The whole job shares the configured timeout; large ranges
often need several minutes on downloaded CPU models (a local/remote server is much faster for
1000+ messages). The Catch up card reports progress (part i of n / merging),
collected vs included counts, and ceiling truncation when the user limit stops collection.
Prompt metadata identifies the local IANA timezone, and every transcript timestamp includes its
local date and UTC offset, including across midnight and daylight-saving transitions. The worker uses a single completion slot and bounded
128-token batches. Model loading and transcript processing are shown separately; worker startup
errors fail the request without retaining their potentially sensitive details. CPU inference has a five-minute deadline covering
model loading and generation; endpoint/native requests retain the one-minute deadline.
The renderer deadline also covers stalled main-process acknowledgements and runtime imports. Abort races
initialization and terminates the worker even if upstream model loading has not settled.
Every pass also races acknowledgement and completion against cancellation, and removes its
remote waiter on every exit path. Child map steps share the parent's rate-limit admission.
Retained workers route fatal errors to the current pass and finish disposal before the queue
releases them. The Windows helper clears its active job before publishing a terminal event.
Downloaded-model settings explain that large conversations can take a few minutes. The prompt
asks for concrete updates, callsigns, times/places and stated answers, compresses greetings/banter,
and keeps unresolved questions open. Bundled sampling supplies llama.cpp's repeat_penalty and
repeat_last_n wire names (the pinned wllama types still use older names). Callback streaming
rejects sustained repeated phrases or sentences and releases the runtime through the same failure
path. Rejected text is cleared, with a larger-model/shorter-range retry suggestion. Copy is enabled
only for completed, non-error output. These controls do not establish factual accuracy.
mesh-ai: serves only enabled, verified manifest assets, with realpath containment and CORS for
the sandboxed renderer. Model installs stream to a unique temporary directory, hash incrementally
without buffering a gigabyte in memory, verify exact size/SHA-256 and publish by rename.
Byte-only download progress is throttled to 100 ms; state changes and terminal results emit immediately.
Catalog/status use persisted advisory metadata bound to asset digests, size, mtime, ctime and file identity.
The first runtime verification in a process always hashes the model before use; advisory records alone
never authorize serving bytes. Missing/corrupt metadata falls back to hashing. Concurrent
full verifications of the same model and file signature share one hash operation; advisory
metadata hits cannot satisfy runtime verification.
The pinned catalog records immutable Hugging Face revisions and publisher LFS SHA-256 values
checked on 2026-11-07. Cross-platform packs are Llama 3.2 3B Instruct and Qwen2.5 1.5B Instruct
GGUF Q4_K_M (wllama CPU). On Apple Silicon (darwin + arm64) the catalog also offers MLX 4-bit
twins of the same models, listed first, for Metal Catch up via mesh-ai-mlx. Main filters MLX
rows (and install/select) to that host only. Soft relative recommendations: Llama = quality
(recommended), Qwen = faster for slower machines — assigned to the MLX twins on Apple Silicon
and to the GGUF twins elsewhere. These labels are relative speed/resource guidance only, not
accuracy guarantees. Qwen uses Apache-2.0; Llama uses the Llama 3.2 Community License. Llama
downloads include the full license and Meta NOTICE beside the weights. Built with Llama.
Wllama/llama.cpp use MIT; MLX Swift uses the mlx-swift / mlx-swift-lm stack. Attribution belongs
in credits. No weights ship in the installer.
Older catalog ids (Llama 3.2 1B, Qwen3 1.7B, Qwen 0.5B, SmolLM2) are removed. A saved selection of a removed or off-platform model becomes not-ready; the app never silently selects or downloads a replacement. Choose explicitly from the catalog. Model cards show factual metadata (name, parameter count, bytes, license, runtime) plus the soft recommendation line when set.
RRC unread UI works with AI disabled. Room selection snapshots an observable opening boundary without marking the transcript read. The first incoming prose/whisper row carries a measured New messages divider; hub notices and self echoes do not anchor it. Without saved read state, the first actual alert-eligible arrival supplies the opening boundary. Later notices, self messages and focus transitions cannot move that boundary past unread traffic. The captured arrival belongs to the hub session and is removed with its unread count on read, part or DM close. Opening/jumping navigates to that row after history hydration. Arrivals while scrolled up preserve position and unread badges, including the selected room. Only a visible, focused reader at the latest messages clears the badge and divider and advances persisted read state. AI unread then uses that persisted watermark. Scroll frames and tab snapshots are scoped to the canonical hub/room so an old view cannot mark another view read. Linux, macOS and Windows share this lifecycle.
Release notes¶
See Catch up release notes, including RRC behavior that applies with AI disabled.
Validation¶
Focused tests cover default-off IPC behavior, URL/key policy, all adapters, fragmented streams,
response caps, cancellation, prompt framing, exact per-protocol DB scopes, broadcast/channel
remap history, verified installs, native pipe/exit/callback failures, renderer request correlation,
RRC watermarks and accessible controls. Run pnpm run check:pr before opening/updating the PR.
Native compilation and real-model smoke tests are separate from deterministic unit tests.
Windows runtime activation and hardware validation require an eligible, correctly packaged host.
Summary deadlines are configurable in App > AI conversation summaries from 30 to 1800 seconds. The default remains five minutes for downloaded CPU models and one minute for other engines. The saved deadline applies to renderer cancellation, main endpoint streaming and native generation; connection tests, native probes and model-download idle limits remain separate.