# 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 is 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](https://xiry.app/topics/ai.md)
- 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](https://x.com/jbelevate/status/1897443458329038898): Directly answers Palmer Luckey's open question about LLM-interrogable personal notes; author offered to work with people on it.

## Compare

- [Alternatives to NotebookLM](https://xiry.app/alternatives/notebooklm.md)

## Related

- [8 Ways to Improve RAG Applications](https://xiry.app/resources/8-ways-to-improve-rag-applications): Practical architectural strategies to fix common failure modes in RAG systems (Tip, Free)
- [CLaRa: Bridging Retrieval and Generation with Continuous Latent Reasoning](https://xiry.app/resources/clara-bridging-retrieval-and-generation-with-continuous-late): RAG framework using continuous latent reasoning and embedding-based context compression (Article or course, Free)
- [ai-engineering-hub](https://xiry.app/resources/ai-engineering-hub): Open-source tutorials and project templates for LLMs, RAG, and AI agents. (GitHub repo, Open source)
- [Gemini Notebook](https://xiry.app/resources/gemini-notebook): AI research assistant grounded strictly in your uploaded notes and documents. (Web app, Freemium)
- [Local Deep Researcher](https://xiry.app/resources/local-deep-researcher-2395): Fully local web research and report writing assistant using Ollama or LMStudio (GitHub repo, Open source)
- [Unlimited-OCR](https://xiry.app/resources/unlimited-ocr): Open-source vision-language model for parsing multi-page documents in one pass (AI model, Open source)

Updated 11 October 2026. Page: https://xiry.app/resources/custom-rag-pipeline-over-apple-notes

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
