This template provides a high-performance, cost-optimized alternative to standard AI Agents for building RAG (Retrieval-Augmented Generation) chatbots.
Instead of relying on a single expensive model to decide every action, this workflow uses a modular "Routing & Specialized Steps" architecture.
It delivers results up to 50% faster and 3x more cost-efficiently by only involving heavy-duty models when deep internal knowledge is actually required.
By leveraging Lookio as the core RAG platform, you can connect your own documentation (PDFs, Docs, Webpages) to a chat interface without the complexity of managing vector databases or custom chunking strategies manually.
Learn more about breaking down agents for efficiency in this YouTube deep dive.
👥 Who is this for?
- Customer Support Teams: Build an automated response system that answers queries based on official product guides or internal FAQs.
- Efficiency-Focused Developers: Scale AI operations without ballooning API costs by offloading simple queries to smaller models.
- Marketing & Content Teams: Provide instant access to brand guidelines or past content repositories for internal research.
💡 What problem does this solve?
- Eliminates Token Waste: Traditional agents send long system prompts to expensive models even for basic greetings like "Hello." This workflow routes those to a "nano" model, saving significant costs.
- Increases Reliability: By breaking down the "Agent" logic into discrete steps (Categorize -> Query Prep -> Retrieval -> Response), you gain more control over the output guidelines at every stage.
- Scalable Knowledge Retrieval: Uses Lookio to handle the heavy lifting of RAG, ensuring sourced and factual answers based on your private data rather than general AI training.
⚙️ How it works
- Memory & Intent Routing: The workflow fetches past messages and uses a specialized Text Classifier (powered by a small model) to determine if the user is asking a knowledge-based question or just chatting.
- Path A (Simple Response): If it's a greeting, a small model handles the reply instantly.
- Path B (Knowledge Retrieval): If information is needed, a specialized LLM step crafts a clean search query specifically for Lookio.
- RAG Execution: The Lookio API retrieves the exact insights needed from your connected knowledge documents.
- Final Generation: A large model synthesizes the specific Lookio results and the conversation history into a final, fact-based response.
What is Lookio, the RAG platform?
Lookio is a business-focused AI platform designed for automated knowledge retrieval.
Unlike casual AI tools, Lookio is "API-first," meaning it’s built specifically to integrate with tools like n8n.
It handles the entire RAG pipeline—from document ingestion to vector storage and logical retrieval—allowing you to focus on building the logic of your automation rather than the infrastructure of your AI.
Lookio offers various query modes (Eco, Flash, Deep) so you can prioritize speed or depth depending on your budget.
🛠️ Setup
- Set up Lookio: Create an account at Lookio.app, upload your documents, and create an assistant.
- API Key: In the RAG via Lookio node, replace
<YOUR-API-KEY> in the header and paste your assistant_id in the body.
- AI Credentials: Add your OpenAI (or preferred provider) credentials to the Very small model, Mini model, and Large model nodes.
- Activate: Turn the workflow on. You can now chat with your knowledge base via the n8n chat interface.
🚀 Taking it further
- Add More Branches: Expand the Intent router to include paths for specific actions, like extracting emails for lead generation or checking order statuses via a database lookup.
- Formatting Tweaks: Adjust the system prompts in the Write the final response node to match your brand's specific tone (e.g., "Explain it like I'm five" or "Legal professional tone").
- Deployment: Connect this backend to your website or a Slack channel for real-time team usage.