Skip to content

[recipes] Apple Notes import via macOS automation#184

Open
DavidROliverBA wants to merge 11 commits into
NateBJones-Projects:mainfrom
DavidROliverBA:contrib/davidroliver/apple-notes-import
Open

[recipes] Apple Notes import via macOS automation#184
DavidROliverBA wants to merge 11 commits into
NateBJones-Projects:mainfrom
DavidROliverBA:contrib/davidroliver/apple-notes-import

Conversation

@DavidROliverBA
Copy link
Copy Markdown

What this does

Imports Apple Notes directly into Open Brain using JXA (JavaScript for Automation) — no manual export step. Notes are converted from HTML to Markdown, chunked at heading boundaries, and ingested with embeddings and metadata including web URLs and note-to-note links.

What it requires

  • macOS with Notes.app (built-in)
  • Python 3.10+
  • OpenRouter API key
  • Working Open Brain setup

Tested on

  • macOS 15 (Sequoia)
  • Both iCloud and "On My Mac" accounts

I have tested this on my own Open Brain instance.

DavidROliverBA and others added 10 commits April 15, 2026 17:31
- Two-file pipeline: JXA extractor → Python importer
- HTML→Markdown via markdownify, web URL + note-to-note link extraction
- Heading-based chunking with optional LLM distillation
- Sync log + SHA-256 content fingerprint dedup
- Full OB1 PR gate compliance checklist

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 8-task TDD plan: scaffold → JXA extractor → parser → chunking/fingerprint → CLI importer → embed/insert → README → PR
- Covers secret scan, sync log, dry-run, --no-llm flag, exponential backoff
- Complete code in every step, no placeholders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… report

- Add _with_retry() with exponential backoff for 429/5xx errors
- Add get_embedding() via OpenRouter embeddings endpoint
- Add classify_type() via gpt-4o-mini JSON-mode classification
- Add insert_thought() with duplicate fingerprint detection
- Add live_import() orchestrating embed → classify → insert per chunk
- Add _maybe_distil_with_llm() for chunks over 1000 words
- Add _write_report() producing import-report.md summary
- Replace Task 6 stub in main() with live_import() call
@github-actions github-actions Bot added documentation Improvements or additions to documentation recipe Contribution: step-by-step recipe labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown

Hey @DavidROliverBA — welcome to Open Brain Source! 👋

Thanks for submitting your first PR. The automated review will run shortly and check things like metadata, folder structure, and README completeness. If anything needs fixing, the review comment will tell you exactly what.

Once the automated checks pass, a human admin will review for quality and clarity. Expect a response within a few days.

If you have questions, check out CONTRIBUTING.md or open an issue.

…acking

Remove accidentally committed __pycache__ .pyc files from git index and
add a recipe-level .gitignore covering __pycache__, *.pyc/pyo, and
runtime files (.env, notes-export.json, apple-notes-sync-log.json,
import-report.md).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alanshurafa alanshurafa added area: recipes Review area: recipes review: needs-author-response Contributor response or clarification needed alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role labels May 20, 2026
@alanshurafa
Copy link
Copy Markdown
Collaborator

Thanks for the contribution, and welcome. The Apple Notes recipe itself is solid — JXA extraction with no manual export step, HTML-to-Markdown with heading-boundary chunking, a notes_parser.py with tests, and you have tested it against both iCloud and On-My-Mac accounts. macOS-only is fine for a recipe.

One scope thing before this is ready: the PR also includes two files under docs/superpowers/plans/ and docs/superpowers/specs/ — those look like planning and design artifacts from your own build workflow, not project documentation (OB1's docs/ is for setup guides, FAQ, and companion prompts). Recommend author refresh to drop those two files and keep the PR scoped to recipes/apple-notes-import/. The recipe is the contribution; the process docs do not need to ship with it.

— Alan (community reviewer; non-binding)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alan-reviewed Reviewed by Alan Shurafa in Community Reviewer role area: recipes Review area: recipes documentation Improvements or additions to documentation recipe Contribution: step-by-step recipe review: needs-author-response Contributor response or clarification needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants