Summary
CoTabby drops learned context on daemon restart.
Problem
Users want to build context over time to make CoTabby "learn" their wording and style.
Right now CoTabby forgets everything on daemon restart. This is a major blocker for personalized interaction.
In contrast, CoTypist stores context between restarts by storing them in an encrypted local sqllite database.
Proposed direction
CoTabby could follow a similar workflow and store captured text in a secure local sqllite database.
There's also an implied ability to import or preload context form captured text adhoc. (eg. Upload your blog history to help CoTabby understand your writing style.)
Additional context
Current flow:
- Capture: ScreenCaptureKit grabs a ~500×600 px region around the focused field in the focused window — not the full screen. Triggered ~350 ms after you focus a new field (debounced).
- OCR: Apple's Vision framework (VNRecognizeTextRequest) extracts visible text. Screenshot is downsampled to ≤900 px for speed.
- Normalize: Whitespace collapsed, UI noise stripped, capped at 2,000 chars.
- Optional summarization: If a local llama model is loaded, LlamaVisualContextSummarizer condenses it to a ~4-sentence, ≤900-char summary on-device.
- Inject: The text excerpt is added to the prompt sent to Apple Intelligence / llama.cpp — all on-device.
- Discard: Pixel data is dropped from memory after OCR. No screenshot survives.
Proposed:
Storage: SQLite via GRDB.swift, encrypted at rest with SQLCipher. Single file at ~/Library/Application Support/Cotabby/history.sqlite. Encryption key generated on first run, stored in the macOS Keychain (sync disabled), so the DB is unreadable if copied off the machine.
Privacy guardrails
• Off by default; single toggle in Settings → Privacy → "Save suggestion history".
• Respect the existing secure-field / disabled-app filters — never log from password fields or disabled bundle IDs.
• Configurable retention (7 / 30 / 90 days / forever); a background sweep deletes older rows.
• "Pause for 1 hour" menu item, "Clear all history" button, and per-app delete in Settings.
• Export to JSON / CSV.
UI surface
• New Settings tab "History" with search, app filter, and outcome filter.
• Optional: surface a "recently accepted" list for re-use
Summary
CoTabby drops learned context on daemon restart.
Problem
Users want to build context over time to make CoTabby "learn" their wording and style.
Right now CoTabby forgets everything on daemon restart. This is a major blocker for personalized interaction.
In contrast, CoTypist stores context between restarts by storing them in an encrypted local sqllite database.
Proposed direction
CoTabby could follow a similar workflow and store captured text in a secure local sqllite database.
There's also an implied ability to import or preload context form captured text adhoc. (eg. Upload your blog history to help CoTabby understand your writing style.)
Additional context
Current flow:
Proposed:
Storage: SQLite via GRDB.swift, encrypted at rest with SQLCipher. Single file at ~/Library/Application Support/Cotabby/history.sqlite. Encryption key generated on first run, stored in the macOS Keychain (sync disabled), so the DB is unreadable if copied off the machine.
Privacy guardrails
• Off by default; single toggle in Settings → Privacy → "Save suggestion history".
• Respect the existing secure-field / disabled-app filters — never log from password fields or disabled bundle IDs.
• Configurable retention (7 / 30 / 90 days / forever); a background sweep deletes older rows.
• "Pause for 1 hour" menu item, "Clear all history" button, and per-app delete in Settings.
• Export to JSON / CSV.
UI surface
• New Settings tab "History" with search, app filter, and outcome filter.
• Optional: surface a "recently accepted" list for re-use