π Seed a Supabase AI knowledge base from Notion with Ollama embeddings
β‘ 3 views Β· π Internal Wiki & Knowledge Base
Description
Quick overview
This n8n template ingests your entire Notion database into a Supabase vector store, making every page searchable by an AI assistant or chatbot. It runs on a schedule to keep your knowledge base in sync automatically, and each run is safe to repeat β no manual cleanup, no duplicate embeddings.
How it works
- Clears the knowledge base before each run so re-runs are always safe and up to date
- Fetches all pages in your Notion database
- Retrieves the full block content of each page
- Skips empty pages
- Prepends each pageβs title to its content and appends the source Notion URL, then splits into chunks and generates embeddings using Ollamaβs nomic-embed-text
- Stores the embeddings in Supabase, ready for semantic search
Setup
- Create a Notion internal integration, share your target database with it, and add a Notion API credential in n8n.
- Enable pgvector in Supabase, create the
documentstable andmatch_documentsfunction, and add a Supabase credential (Project URL and service_role key) in n8n. - Install and run Ollama, pull
nomic-embed-text, and add an Ollama credential pointing to your Ollama base URL. - In the Notion node, replace
YOUR_DATABASE_IDwith your Notion database ID, and in the Supabase delete request, replaceYOUR_SUPABASE_PROJECT_URLwith your Supabase Project URL.
Requirements
- Supabase account with pgvector enabled
- Notion account with an internal integration connected to your database
- Ollama running locally (ollama.com) with nomic-embed-text pulled
Customization
- Swap the Ollama embedding node for OpenAI, Cohere, or HuggingFace. The workflow uses n8nβs LangChain-based embedding pipeline, so any supported embedding model works. If you switch models, update the vector(768) column in your SQL to match the new dimension.
- Adjust chunk size and overlap in the Split Text for Processing node to suit your content.
- To capture content inside toggles and deeply indented lists, enable Also Fetch Nested Blocks in the Fetch Page Blocks node. For large databases, leave it off to avoid Notion API rate limits.
Additional info
Pairs well with: Search multiple knowledge bases with an Agentic RAG assistant (query everything youβve stored).
π Nodes Used
HTTP Request, Notion, Schedule Trigger, Recursive Character Text Splitter, Supabase Vector Store, Default Data Loader
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File