n8n and Claude: Agentic RAG retrieval walkthrough

Learn how an n8n RAG workflow rewrites queries, combines semantic and keyword search, and retries retrieval when evidence is insufficient.

Player not loading? Watch on YouTube

Ashish Bhatia walks through the retrieval half of an agentic RAG workflow in n8n. An earlier installment covered PDF ingestion; this tutorial starts with a shoe catalog already stored in the database. The supplied stack description identifies self-hosted n8n, Claude for routing and generation, Voyage AI embeddings, Supabase storage, and Cohere rerank-v3.5.

The router decides whether a request needs retrieval. A rewriter then translates the question into search terms. Hybrid search combines semantic matches from 1024-dimensional Voyage vectors with keyword matches, and reciprocal rank fusion merges the results. In the example, Cohere reduces 12 candidate chunks to five. A grader checks whether those chunks contain enough evidence to answer and sends weak results back through rewriting and retrieval.

Three tests show how this workflow behaves on the sample catalog. A direct price question returns $580 for the Apex Runner. A black tie wedding question produces a Nightfall Oxford recommendation through semantic retrieval; Bhatia says the corpus does not contain the word "wedding." A warranty question triggers two retries before the system reports that it lacks the information.

The custom RAG Inspector exposes retrieval scores, rewrites and grader reasoning. Bhatia uses it to examine failures and explains that retries add latency. These examples demonstrate the workflow's behavior on the sample document, rather than establishing a general guarantee against hallucinations.