A local chat and read-only Apple Notes research assistant, built with TypeScript and Ollama. It reads long notes in sections, keeps temporary evidence summaries, and compares patterns across selected notes.
I’m an avid Apple Notes user with 700+ notes, many of them personal. I built NotesAI to research and find patterns across those notes without sending their contents to an API provider. The research runs entirely on my own computer.
You need Node.js 22 or later, Google Chrome, and Ollama running locally with a model already installed.
npm install
npm startThe chat opens automatically in a new Chrome Incognito window. Choose an installed model and ask a question. The first reply may take longer while Ollama loads the model. Press Ctrl+C in the terminal to stop the server.
No configuration file or keyboard shortcut setup is required. The app chooses a
free port and listens only on 127.0.0.1. If Chrome cannot open, use the
local URL printed in the terminal in a private browser window. The launcher does
not fall back to a regular window.
agent.mdsupplies the agent's personality and research instructions.src/analysis.tsreads long notes in stages and compares temporary findings.src/index.tsserves the page and passes chat messages to local Ollama.src/index.htmlis the chat page and its styling.src/chat.tshandles messages and updates the page.src/notes.tsprovides the read-only Apple Notes tools on macOS.
npm start first compiles the TypeScript browser code into the ignored dist/
folder. npm run typecheck checks the code without creating files.
Conversations stay in the current tab's memory. Refreshing the page or choosing New chat clears them. The app does not save chats, download models, or use cloud models. Apple Notes is read on demand. The app retains working notebooks and source passages in server RAM only for the current analysis, with no saved notebook or server session to reopen. Closing the chat tab cancels its active request and clears its conversation. The app never writes chats, notebook contents, or source notes to disk or to Apple Notes. Memory reclamation and model unloading are described below.
Use a local model with tool support, then ask about your notes. The agent can search titles and plain text across the library and read long notes in sections. For example: "Search my Notes for renovation plans and summarize what you find."
Run npm start from your own Terminal. Starting the agent does not read Notes;
the first Notes tool request may display a macOS Automation permission prompt
for the application running the agent (usually Terminal). Developing the code
does not require granting ChatGPT or Codex access to Notes. If previously denied,
enable Notes for the application running the agent in System Settings > Privacy
& Security > Automation.
macOS grants general Automation permission; read-only access is enforced by our
fixed search/read code. No tool can create, edit, move, delete, or unlock notes,
and the model cannot execute scripts or shell commands.
Searches scan 50 notes per page; quick reads return up to 12,000 characters per section. Quick lookups keep a small reading budget. For a thorough analysis, ask:
Read these notes fully and compare recurring patterns, changes, and contradictions: "Project journal", "Weekly reflections", and "Planning notes".
The agent searches for the selected notes, then calls analyze_notes. Code reads
every section with a 500-character overlap, asks the local model for compact
findings, combines larger notebooks in bounded batches, compares the notes, and
checks cited original passages before answering. Source references identify note
titles and character ranges. Coverage counts come from the code, not from the
model's claims.
A single analysis handles up to six selected notes and 2,000,000 characters in
total. Large notebooks are combined in stages so the entire source library never
needs to fit into one model request. It asks Ollama for at least 32,768 context
tokens per analysis step, increasing that within the model's advertised capacity
when needed. A conservative input budget reserves room for the answer and rejects
oversized steps rather than risking truncation.
Smaller-context models cannot use this workflow.
The temporary notebook is a set of evidence summaries, not lasting memory or
hidden reasoning. Edit agent.md and restart the server to change the direction.
Reading note 2 of 4, section 4… means the agent is reading and analyzing the
fourth section of the second of four selected notes. Each section contains up to
12,000 characters, with a 500-character overlap. Notes are processed one at a
time. The status can stay unchanged while the local model analyzes a section;
it is not a percentage or time estimate.
Later stages organize each note's findings, compare the notes, check supporting passages, and write the answer. Progress appears throughout; the answer appears after these stages finish. During a request, the model picker and New chat are disabled, the input is read-only, and Send becomes Stop.
Use Stop, refresh, or close the tab to cancel. Large analyses can take many minutes. There is no fixed total time cutoff; work continues until the selected material is processed, the total reading budget is reached, or you stop or close the chat. Each model request still has a three-minute timeout. Working-note lengths are targets, not rejection limits: completed verbose responses are kept and combined in bounded batches. An empty response is retried once, and a response cut off by the model gets one retry with more output space. Real model/context failures are reported explicitly.
Locked/unreadable notes and attachment contents are excluded. Notes detected as changing during reading are excluded from the comparison; rerun after edits finish. Notes exceeding the limits are explicitly marked incomplete. The final answer includes coverage for each selected note. Summaries can lose details and model judgments can be wrong; full reading does not guarantee every pattern will be found.
Memory needs depend on the selected model, its precision, context length, and runtime. No fixed hardware RAM minimum has been established for this project. No particular model is bundled or required; Notes analysis needs a local model with tool support and the context capacity described above. The total reading budget spans many requests, each with its own context window.
This example uses qwen3.8:27b-mlx-bf16 to analyze four selected notes.
The progress display shows section 4 of note 2.
Activity Monitor showed the following whole-Mac memory usage during this run:
| Measurement | Observed value |
|---|---|
| Physical memory installed | 512.00 GB |
| Memory used, whole Mac | 115.04 GB |
| App memory, all apps | 48.46 GB |
| Wired memory | 61.97 GB |
| Cached files | 66.58 GB |
| Compressed memory | 0 bytes |
| Swap used | 0 bytes |
| Memory pressure | Green |
The screenshot shows memory use across the entire Mac, including macOS and other apps. The 512 GB figure is the machine's installed RAM; NotesAI's memory requirements depend on the model you choose.
For the example above, macOS reported:
| Component | Memory used |
|---|---|
Model — qwen3.8:27b-mlx-bf16 |
72.62 GB |
| NotesAI chat server | 44.95 MB |
These figures cover the loaded model and chat server. Browser memory is additional, and usage will vary with the model and context length.
Ollama's model report showed 70.49 GB for the same model. It measures memory differently from macOS; this is an alternative reading, not additional memory to add to the total.
Closing the chat clears the conversation and cancels active research. The server and Ollama keep running, and Ollama may retain the model for faster replies. Memory usage may therefore stay high after the chat closes. Model retention is controlled by Ollama's keep-alive settings.
npm run typecheck
npm testTests use invented long notes and simulated model responses. They check coverage, evidence flow, source references, limits, cancellation, and isolation between analyses without opening Apple Notes. No additional testing package is needed.
Licensed under the MIT License.
The package is marked private to prevent accidental npm publication; this does not prevent sharing the repository publicly or using its MIT license.

