AI · Tip

Custom RAG Pipeline over Apple Notes

RAG architecture for chatting with local Apple Notes via DeepSeek

A blueprint for building a custom retrieval-augmented generation (RAG) system over Apple Notes by reading its local SQLite database. It runs local embeddings on Apple Silicon (MPS) to handle semantic queries, applies date and keyword extraction for chronological accuracy, and sends context to DeepSeek API for answers.

How it works

Pipeline steps shown in the terminal: load notes from Apple Notes SQLite database (512 notes); retrieve by semantic search using sentence-transformers all-MiniLM-L6-v2 on the MPS device; rerank by recency and limit to 10 notes; extract dates and keywords (WordNet expansion) for date-specific queries like 'what did i do on 29 aug 2023'; format retrieved notes into a prompt (~975 characters); generate the answer via the DeepSeek chat completions API. Chat responses are multi-point, structured answers drawn from the notes.

What it's for

  • Query personal Apple Notes using natural language chat
  • Look up past thoughts or activities by specific dates in a personal journal
  • Build a local-first RAG pipeline using Apple Silicon hardware acceleration

Key points

  • Direct extraction of notes from the Apple Notes local SQLite database
  • Local semantic search using sentence-transformers (all-MiniLM-L6-v2) on MPS (Metal Performance Shaders)
  • Recency reranking to prioritize recent context
  • Date and keyword extraction with WordNet expansion for time-specific queries
  • Prompt formatting and final answer generation via DeepSeek chat completions API

Pricing

Free concept; requires DeepSeek API credits for completion calls.

Details

Type
Tip
Category
AI
Topic
RAG Architectures
Platforms
macOS, Command line
For
Developers looking to build AI search or chat interfaces over their local Apple Notes.
Alternative to
NotebookLM, Mem, Obsidian Smart Connections
Tags
rag, apple notes, deepseek, embeddings, nlp, macos

Why it was saved

  • @jbelevate, 6 March 2025: Directly answers Palmer Luckey's open question about LLM-interrogable personal notes; author offered to work with people on it.

Compare

Related

Updated