<!-- Generated by scripts/sync-agent-content.mjs. Edit the shared public sources, then regenerate. -->
# ContextKey

Cursor-side autocomplete using a model running on your Mac.

- Dates: 2026
- Status: Experimental prototype
- Areas: Software engineering; Native apps; AI / ML
- Stack: Swift · AppKit · MLX · Accessibility
- Topics: Swift; macOS; MLX; Accessibility; OCR; Local-First Tools
- Public case study: https://mgiorgetti.com/project_details/project-contextkey.html

## Problem

System-wide autocomplete needs useful text context from both native fields and browser editors without taking keyboard focus away from the destination.

## Contribution

Experimental macOS prototype integrating Accessibility context, a Chromium extension, optional OCR, MLX candidate generation and an AppKit suggestion overlay.

## Technical approach and public case study

Autocomplete beside your cursor, using the current field and a model running on your Mac.

- Swift · AppKit · MLX

- Experimental prototype

Option–Space inserts the displayed suggestion.

### Reading the current field

**Native applications**

Accessibility reads the focused field, surrounding text, and nearby labels. Optional Vision OCR adds text from the active window when needed.

**Browser editors**

A Chromium extension supplies DOM context for web editors that expose little text through Accessibility.

**Local inference**

MLX generates candidates locally. A filter rejects irrelevant or repeated continuations.

### Displaying suggestions

An AppKit overlay shows the suggestion without taking focus. Acceptance is handled only while a suggestion is visible, and insertion preserves the clipboard.

## Results and limitations

This is an experimental prototype. The public case study explains candidate filtering and insertion behavior but does not publish completion-quality, latency or application-compatibility benchmarks.

## Public supporting links

- [Portfolio case study](https://mgiorgetti.com/project_details/project-contextkey.html)
- [Matteo Giorgetti profile](https://mgiorgetti.com/profile.md)
