{"product_id":"local-agentic-rag-in-n8n-ollama-pgvector-document-qa","title":"Local Agentic RAG in n8n: Ollama + PGVector Document QA","description":"\u003ch3\u003eRun a fully local Agentic RAG in n8n using Ollama + PGVector for document QA\u003c\/h3\u003e\n\u003cp\u003eThis n8n template sets up an \u003cstrong\u003eentirely local\u003c\/strong\u003e \u003cstrong\u003eAgentic RAG (Retrieval Augmented Generation)\u003c\/strong\u003e system that can answer questions over your documents, dynamically selecting the right way to retrieve and analyze knowledge—without sending data to external AI services.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eUnlike standard RAG that mainly returns chunk-based matches, this template is designed to reason across your knowledge base and choose tools based on the question:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntelligent tool selection:\u003c\/strong\u003e switches between RAG lookups, full document retrieval, and SQL-backed querying when needed.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eComplete document context:\u003c\/strong\u003e retrieves entire documents instead of only chunk snippets when the question requires deeper grounding.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAccurate numerical\/tabular analysis:\u003c\/strong\u003e uses SQL for precise calculations—addressing common RAG weaknesses with spreadsheets and tables.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCross-document insights:\u003c\/strong\u003e connects related information across multiple documents to produce more coherent answers.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMulti-file processing:\u003c\/strong\u003e handles multiple documents within a single workflow loop, supporting larger knowledge bases.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eEfficient storage for tables:\u003c\/strong\u003e stores tabular data using \u003cstrong\u003eJSONB\u003c\/strong\u003e (without creating a new table per CSV), improving scalability.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLocal internal documentation Q\u0026amp;A\u003c\/strong\u003e for SaaS ops and automation engineers who need accurate answers with full context.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSpreadsheet\/document QA\u003c\/strong\u003e where numerical accuracy matters (calculations, metrics, and tabular fields).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eKnowledge base support\u003c\/strong\u003e that combines insights across multiple files, not just isolated chunks.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAgentic RAG architecture\u003c\/strong\u003e designed for n8n with nodes such as: \u003cem\u003eSet, Switch, Webhook, Postgres, Aggregate, Summarize\u003c\/em\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOllama + PGVector\u003c\/strong\u003e for local embeddings and retrieval.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgres\u003c\/strong\u003e for SQL-based numerical\/tabular operations and structured storage (including JSONB for tabular data).\u003c\/li\u003e\n\u003c\/ul\u003e\n\u003cp\u003e\u003cstrong\u003eAuthor:\u003c\/strong\u003e Jadai kongolo (jadai_ai_automation). Start by running the table creation nodes first to set up your environment.\u003c\/p\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45756678537395,"sku":"N8N-10157","price":16.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/vzrVb1tJbKzOvnLfwHAmv_RquojtOg.png?v=1785748243","url":"https:\/\/buyflowscripts.com\/products\/local-agentic-rag-in-n8n-ollama-pgvector-document-qa","provider":"N8N Commerce","version":"1.0","type":"link"}