Discover how n8n’s new Cohere integration can transform your AI agents in Wassenger
Você já construiu um chatbot que parecia promissor mas depois ofereceu respostas irrelevantes ou confusas? Você não está sozinho. Um dos maiores desafios ao criar agentes de IA inteligentes é fazê-los fornecer respostas precisas e relevantes de forma consistente.
A boa notícia é que o n8n acabou de lançar um recurso revolucionário: integração com Cohere re-rankers. E a melhor parte é que agora você pode aproveitar essa tecnologia poderosa diretamente dos Wassenger Flows, sem precisar configurar servidores ou lidar com instalações complexas.
👉 Start your 7-day free trial on Wassenger and leverage our powerful WhatsApp automation flows to transform your customer service today! ⚡
What are Re-rankers and Why Do They Matter?
Imagine que você tem uma enorme biblioteca com milhares de livros. Quando alguém te faz uma pergunta, você precisa encontrar os livros mais relevantes rapidamente. Os métodos tradicionais de vector search são como um bibliotecário que trabalha muito rápido, mas às vezes traz livros que não são exatamente o que você precisa.
Re-rankers são como um segundo bibliotecário especialista que revisa essa primeira seleção e entrega apenas os livros mais úteis e precisos para a sua consulta específica.
The Problem with Traditional Vector Search
Em um sistema típico de RAG (Retrieval-Augmented Generation), o processo funciona assim:
- Documents are split into small chunks of text
- Each chunk is converted into numbers (vectors) that represent its meaning
- When you ask a question, it’s also converted into numbers
- The system searches for chunks that are mathematically “closest” to your question
O problema? Essa busca pode perder nuances importantes. É como procurar músicas semelhantes apenas pelo ritmo, ignorando a letra ou o gênero.
👉 Start your 7-day free trial on Wassenger and leverage our powerful WhatsApp automation flows to transform your customer service today! ⚡
The Solution: Two-Stage Search
Re-rankers implementam o que é conhecido como two-stage search:
Stage 1: Broad Retrieval
- O sistema busca um grande número de resultados potenciais (20–50 chunks)
- É rápido, mas não perfeitamente preciso
Stage 2: Intelligent Re-ranking
- Re-rankers analisam simultaneamente tanto a sua pergunta quanto cada chunk
- Eles geram pontuações de relevância super-precisas
- Retornam apenas os 3–5 chunks mais úteis
Wassenger Flows: The Cloud Revolution Has Arrived
É aqui que os Wassenger Flows se tornam seu melhor aliado. Tradicionalmente, implementar essas tecnologias avançadas exigia:
- ✗ Configurar seus servidores
- ✗ Instalar e manter o n8n
- ✗ Gerenciar atualizações e dependências
- ✗ Conhecimento técnico avançado
Com Wassenger Flows, tudo isso desaparece. Nosso novo recurso inclui todo o poder da interface do n8n diretamente na nuvem, o que significa que você pode:
- ✅ Criar agentes de IA avançados sem configuração técnica
- ✅ Usar Cohere re-rankers com apenas alguns cliques
- ✅ Implementar hybrid search sem dores de cabeça
- ✅ Escalar automaticamente de acordo com suas necessidades
👉 Start your 7-day free trial on Wassenger and leverage our powerful WhatsApp automation flows to transform your customer service today! ⚡
Practical Implementation: Step by Step
Basic Setup in Wassenger Flows
- Access Wassenger Flows from your account
- Create a new flow using the “AI Agent with Re-ranking” template
- Connect your vector database (E.g., Supabase, Pinecone).
- Add your Cohere API key in the credentials
- Enable the “Re-rank Results” toggle
Advanced Setup: Hybrid Search
Para casos de uso mais complexos, os Wassenger Flows permitem que você implemente:
- Metadata filtering: Pesquise apenas em subconjuntos relevantes da sua informação
- Hybrid search: Combine vector search com full-text search
- Multiple re-rankers: Para diferentes tipos de consultas
Get the Full workflow here 👇
{
"name": "AI Agent Rerank Cohere",
"nodes": [
{
"parameters": {
"options": {
"systemMessage": "=# Company Business Intelligence Assistant\n\nYou are \"[REDACTED_COMPANY_NAME]\", a specialized business intelligence assistant for the company.Your primary responsibility is to provide answers exclusively based on the available knowledge sources.\n\n## Knowledge Sources\nYou have access to two critical knowledge bases:\n1.**CompanyDocuments** - Contains business documents, service guides, company information, and operational procedures\n2.**RestaurantLeads** - Contains potential restaurant client data including ratings, contact information, business details, and market insights\n\n## 🚨 CRITICAL: Tool Selection Protocol\n\n### MANDATORY Tool Usage Rules:\n**CompanyDocuments tool MUST be used for:**\n- ANY question about company services, capabilities, or offerings\n- Pricing inquiries(\"how much\", \"cost\", \"price\", \"fee\")\n- Company information(\"about the company\", \"what is the company\", \"company details\")\n- Business processes(\"how does the company work\", \"process\", \"procedure\")\n- Service features and benefits\n- Any question containing keywords: company, service, price, cost, business, how to, process, capability, offering\n\n**RestaurantLeads tool MUST be used for:**\n- Lead generation and prospecting requests\n- Restaurant recommendations and listings\n- Market analysis and competitive intelligence\n- Location-based restaurant queries\n- Rating, review, and business characteristic analysis\n- Contact information and outreach data\n\n### Search Strategy Hierarchy:\n1.**Company-specific queries** → Use CompanyDocuments FIRST, always\n2.**Restaurant/lead queries** → Use RestaurantLeads FIRST\n3.**Business intelligence/strategy** → Use BOTH tools sequentially\n4.**Ambiguous queries** → Default to CompanyDocuments first, then RestaurantLeads if needed\n\n## Execution Process(Follow Strictly):\n1.**Query Classification**: \n - Identify if query mentions company, services, pricing, or company info\n - If YES → Immediately use CompanyDocuments tool\n - If restaurant/lead focused → Use RestaurantLeads tool\n - If business strategy → Use both tools\n\n2.**Tool Selection Verification**:\n - Double-check that you're using the correct tool for the query type\n - When in doubt about company-related content → ALWAYS search CompanyDocuments\n\n3.**Search Execution**: \n - Execute search in identified tool(s) before generating any response\n - Use specific, relevant keywords from user query\n\n4.**Response Generation**: \n - Base response entirely on search results\n - Clearly cite which knowledge base provided the information\n - Match user's language(Indonesian/English)\n\n## Core Operating Principles\n- **MANDATORY SEARCH**: Never respond without searching appropriate knowledge base first\n- **NO EXTERNAL KNOWLEDGE**: Absolutely no information from outside the knowledge bases\n- **EXPLICIT SOURCE CITATION**: Always state \"Based on CompanyDocuments...\" or \"According to RestaurantLeads...\"\n- **LANGUAGE MATCHING**: Respond in exact same language as user input\n- **ACCURACY OVER COMPLETENESS**: Better to say \"no information found\" than guess\n\n## Quality Assurance Checklist\nBefore every response, verify:\n- ✅ Did I search the appropriate knowledge base?\n- ✅ Is my answer based solely on search results?\n- ✅ Did I cite the correct source?\n- ✅ Am I responding in the user's language?\n- ✅ Did I avoid using external knowledge?\n\n## Error Handling\nIf no relevant information found in knowledge bases:\n- **English**: \"I searched [specific knowledge base] but don't have information about [topic].Could you provide more specific details or rephrase your question?\"\n- **Indonesian**: \"Saya telah mencari di [basis pengetahuan spesifik] tetapi tidak memiliki informasi tentang [topik].Bisakah Anda memberikan detail yang lebih spesifik atau mengubah pertanyaan Anda?\"\n\n## Debugging Mode\nAlways mention in your response which tool you used:\n- \"After searching CompanyDocuments...\"\n- \"Based on my search in RestaurantLeads...\"\n- \"From both knowledge bases...\"\n\nThis helps identify if tool selection is working correctly.\n\nRemember: Your value comes from providing accurate, source-backed intelligence from the company's specific business context and restaurant lead database.Always search first, cite sources, and match the user's language."
}
},
"id": "[REDACTED_NODE_ID]",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [420, 1340],
"typeVersion": 2
},
{
"parameters": {
"options": {}
},
"id": "[REDACTED_NODE_ID]",
"name": "Embeddings OpenAI3",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [620, 1660],
"typeVersion": 1.2
},
{
"parameters": {
"mode": "retrieve-as-tool",
"toolName": "CompanyDocuments",
"toolDescription": "=MANDATORY TOOL for questions about: CompanyDocument services, pricing, company information, business processes, operational procedures, service capabilities, company policies, internal guidelines, and any [REDACTED_COMPANY_NAME]-specific business inquiries.Always use this tool first when users ask about [REDACTED_COMPANY_NAME] services or company information.",
"tableName": {
"__rl": true,
"mode": "list",
"value": "documents",
"cachedResultName": "documents"
},
"topK": 20,
"useReranker": true,
"options": {}
},
"id": "[REDACTED_NODE_ID]",
"name": "RAG1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [640, 1520],
"typeVersion": 1.1
},
{
"parameters": {
"mode": "retrieve-as-tool",
"toolName": "RestaurantLeads",
"toolDescription": "=Search restaurant leads database containing potential client information, ratings, contact details, business characteristics, location data, and market insights.Use for lead generation, market analysis, and client prospecting.",
"tableName": {
"__rl": true,
"mode": "list",
"value": "restaurant_leads",
"cachedResultName": "restaurant_leads"
},
"topK": 20,
"useReranker": true,
"options": {}
},
"id": "[REDACTED_NODE_ID]",
"name": "Leads1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreSupabase",
"position": [920, 1520],
"typeVersion": 1.1
},
{
"parameters": {
"options": {}
},
"id": "[REDACTED_NODE_ID]",
"name": "Embeddings OpenAI4",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [940, 1660],
"typeVersion": 1.2
},
{
"parameters": {
"content": "# Send Message",
"height": 580,
"width": 1360,
"color": 4
},
"id": "[REDACTED_NODE_ID]",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [60, 1240],
"typeVersion": 1
},
{
"parameters": {
"contextWindowLength": 20
},
"id": "[REDACTED_NODE_ID]",
"name": "Chat Memory",
"type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
"position": [500, 1500],
"typeVersion": 1.3
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"id": "[REDACTED_NODE_ID]",
"name": "Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [360, 1500],
"typeVersion": 1.2
},
{
"parameters": {
"modelName": "rerank-multilingual-v3.0"
},
"id": "[REDACTED_NODE_ID]",
"name": "Reranker Cohere",
"type": "@n8n/n8n-nodes-langchain.rerankerCohere",
"position": [760, 1660],
"typeVersion": 1
},
{
"parameters": {
"modelName": "rerank-multilingual-v3.0"
},
"id": "[REDACTED_NODE_ID]",
"name": "Reranker Cohere1",
"type": "@n8n/n8n-nodes-langchain.rerankerCohere",
"position": [1060, 1660],
"typeVersion": 1
},
{
"parameters": {
"events": ["message:in:new"]
},
"type": "n8n-nodes-wassenger.wassengerTrigger",
"typeVersion": 1,
"position": [220, 1340],
"id": "[REDACTED_NODE_ID]",
"name": "Wassenger Trigger",
"webhookId": "[REDACTED_WEBHOOK_ID]",
"credentials": {
"wassengerApiKey": {
"id": "[REDACTED_CREDENTIAL_ID]",
"name": "[REDACTED_CREDENTIAL_NAME]"
}
}
}
],
"pinData": {},
"connections": {
"RAG1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Leads1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Chat Memory": {
"ai_memory": [
[
{
"node": "AI Agent1",
"type": "ai_memory",
"index": 0
}
]
]
},
"Reranker Cohere": {
"ai_reranker": [
[
{
"node": "RAG1",
"type": "ai_reranker",
"index": 0
}
]
]
},
"Reranker Cohere1": {
"ai_reranker": [
[
{
"node": "Leads1",
"type": "ai_reranker",
"index": 0
}
]
]
},
"Embeddings OpenAI3": {
"ai_embedding": [
[
{
"node": "RAG1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Embeddings OpenAI4": {
"ai_embedding": [
[
{
"node": "Leads1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Wassenger Trigger": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "[REDACTED_VERSION_ID]",
"meta": {
"instanceId": "[REDACTED_INSTANCE_ID]"
},
"id": "[REDACTED_WORKFLOW_ID]",
"tags": []
}
Real-World Use Cases
1. Intelligent Customer Support
- Problem: Respostas genéricas que não resolvem dúvidas específicas
- Solution: Re-rankers que identificam exatamente o artigo de ajuda mais relevante
2. Sales Assistants
- Problem: Recomendações de produto imprecisas
- Solution: Re-ranking que considera histórico, preferências e contexto atual
3. Educational Chatbots
- Problem: Explicações que não se adaptam ao nível do estudante
- Solution: Re-rankers que priorizam conteúdo apropriado para cada usuário
👉 Start your 7-day free trial on Wassenger and leverage our powerful WhatsApp automation flows to transform your customer service today! ⚡
Measurable Results
Os benchmarks da Cohere mostram melhorias dramáticas:
- Até 40% mais acurácia em respostas relevantes
- Redução de 60% em respostas irrelevantes ou confusas
- Maior satisfação do usuário ao receber informações mais úteis
Your Next Step
Pronto para levar seus agentes de IA ao próximo nível?
Wassenger Flows torna a implementação dessas tecnologias avançadas tão simples quanto arrastar e soltar. Você não precisa ser um especialista em IA nem passar noites configurando servidores.
Start Today:
- Sign up at Wassenger.com
- Go to Flows from your account
- Explore our templates
- Build your first intelligent agent in minutes
The AI agent revolution is here, and with Wassenger Flows, it’s within everyone’s reach. Why settle for mediocre responses when you can offer extraordinary experiences?
👉 Start your 7-day free trial on Wassenger and leverage our powerful WhatsApp automation flows to transform your customer service today! ⚡











