Build a Second Brain from Zotero Highlights with n8n and RAG
You highlight brilliant sentences in Zotero, write margin notes, and promise yourself you’ll remember. Weeks later, you can’t recall which…
Build a Second Brain from Zotero Highlights with n8n and RAG
You highlight brilliant sentences in Zotero, write margin notes, and promise yourself you’ll remember. Weeks later, you can’t recall which paper said what — or where you stored that insight. What if you had a second brain that knows your highlights and answers questions on demand?

Second Brain = RAG
What is RAG (and why it matters)? Retrieval-Augmented Generation (RAG) lets an AI reason over your own materials. AI can only answer your question based on its pre-trained data. The highlighted sentences and related your notes cannot be used as long as you provide explicitly. The challenge is that even you can’t find what notes you wrote in the past. RAG can solve this challenge by creating your second brain. RAG make this passible: Your highlighted sentences are chunked, embedded into vectors, stored for fast retrieval, and pulled back at answer time so the model cites relevant passages.
n8n = The Second Brain Builder
Why n8n for your second brain I run this with self-hosted n8n via Docker. n8n is a flexible workflow engine that connects tools you already use. I do not only use n8n nodes (e.g, data extraction, AI agent, text split) but also incorporated applications (e.g., Supabase for database and semantic search, OpenAI chatbot via API) Crucially, it gives you full control over chunking strategies: you can define separators, chunk sizes, and overlaps as first-class nodes, then change them later without rewriting code. The result is a durable, tweakable pipeline for your research knowledge.


The n8n workflow: from Zotero to answers
- Input: one annotations text file Export a single text file of your highlights/notes from Zotero. The workflow groups annotations by paper using the “##” separator; if a group exceeds 2,000 characters, it’s split with a 200-character overlap. This balances recall and precision for retrieval.
- Embeddings: OpenAI text-embedding-3-small Use OpenAI embeddings to convert text into semantic vectors. Keep the same embedding node for both insert and retrieve so the vector space stays consistent. Prefer OpenAI for simplicity and quality; optionally, you can swap in open-source alternatives (e.g., Ollama with mxbai-embed-large) when needed.
- Storage: Supabase Vector Store Store vectors and metadata in a table for fast similarity search. If you are on Supabase Free, a tiny scheduled query every 6 days can keep the instance awake.
- Chatting with your second brain A chat trigger exposes a simple UI titled “Second Brain” so you can ask natural-language questions like “What did I note about X?” Answers are grounded by first retrieving from Supabase and then generating with a GPT-based model via API (e.g., OpenAI GPT). You can also inform readers that open-source models are viable and swappable if preferred.

What you get
- Answerable highlights: Ask questions and get answers grounded in your own notes.
- End-to-end control: Tune separators, chunk sizes, and overlaps directly in n8n.
- Modular and swappable: Change models or databases without starting over.
Call to action
Export a handful of annotated papers into one text file, run the workflow, and ask your second brain a real research question. Iterate on chunk size, overlap, and separators to fit your corpus. Your highlights are already valuable — RAG makes them actionable.
I’m still in the process of developing more authentic and practical use cases for RAG in research. If you’re interested in exploring how RAG can support your research, feel free to reach out. I’d be happy to discuss ideas or collaborate — just email me.
메타데이터
- post_id
- c761c2887fde
- slug
- build-a-second-brain-from-zotero-highlights-with-n8n-and-rag-c761c2887fde
- url
- https://medium.com/@yongjinL/build-a-second-brain-from-zotero-highlights-with-n8n-and-rag-c761c2887fde
- canonical_url
- https://medium.com/@yongjinL/build-a-second-brain-from-zotero-highlights-with-n8n-and-rag-c761c2887fde
- author_url
- https://medium.com/@yongjinL
- status
- ok
- fetched_at
- 2026-07-18 04:57:09