One retrieval-augmented generation problem, solved twice. Once as a no-code n8n workflow answering questions over WhatsApp, and once as a Python pipeline built on LlamaIndex's router query engine. Same job, two very different sets of trade-offs.



A RAG system is easy to demo and hard to place. The interesting question is not whether retrieval works, it is which shape of system you should reach for. So I built the same capability along both routes: an orchestrated no-code workflow, and a Python pipeline with explicit control over routing and indexing.
A WhatsApp message hits the trigger, the agent calls a retrieval tool that runs a similarity search over a Supabase pgvector store, and the answer is written only from the passages that came back. A second branch handles ingestion: documents are chunked with a recursive splitter, embedded and inserted. Chat and embedding models both run on local Ollama, so there is no per-token cost and nothing leaves the machine.
Here the routing is the point. The same document is indexed twice (a summary index for whole-document questions and a vector index for specific passages) and an LLMSingleSelector reads each tool's description to decide which one should answer. Swapping between Google Gemini and a fully local Ollama backend is a config change, not a rewrite.