Skip to main content

Intelligent web query and semantic re-ranking flow using Brave and Google Gemini

Workflow preview

Workflow preview
100%
Intelligent web query and semantic re-ranking flow using Brave and Google Gemini preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Workflow Description This workflow is a powerful, fully automated web query and semantic reranking system that allows users to perform precise, detailed searches, intelligently rank search results ...

Best for

  • Market Research automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.datetime, n8n-nodes-base.webhook, @n8n/n8n-nodes-langchain.outputparserautofixing, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.code, n8n-nodes-base.respondtowebhook, @n8n/n8n-nodes-langchain.chainllm

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mind-Front.

Original n8n.io source

1.1 Workflow description

Title
Intelligent web query and semantic re-ranking flow using Brave and Google Gemini
Workflow name
Intelligent web query and semantic re-ranking flow using Brave and Google Gemini

Workflow Description

This workflow is a powerful, fully automated web query and semantic reranking system that allows users to perform precise, detailed searches, intelligently rank search results and provide high-quality, structured output. Built with AI-powered components, the workflow leverages semantic query generation, result re-ranking, and real-time reporting to deliver actionable insights.

It is particularly well-suited for real-time data retrieval, market research, and any domain requiring automated yet customizable search result processing.


How It Works

  1. Webhook Integration for Input:

    • The workflow begins with a Webhook Node that captures the user's search query as input, enabling seamless integration with other systems.
  2. Step 1: Semantic Query Generation (Powered by "Semantic Search - Query Maker"):

    • Using AI (Google Gemini), the initial query is refined and transformed into a context-aware, expert-level search query.
    • The process ensures that the search engine retrieves the most relevant and precise results.
  3. Step 2: Web Search Execution:

    • A free Brave Search API processes the refined query to fetch search results, ensuring speed and cost efficiency.
  4. Step 3: Semantic Re-Ranking of Results (Powered by "Semantic Search - Result Re-Ranker"):

    • The workflow reranks the search results based on relevance to the original question, prioritizing the most relevant URLs dynamically.
    • Results are passed through AI-powered intelligent reranking to ensure the final output reflects optimal relevance and quality.
  5. Step 4: Structured Output Generation:

    • Results are converted into a well-structured, organized JSON format, ranking the top 10 search results with their titles, links, and descriptions.
    • Missing ranks (if fewer than 10 results) are handled gracefully with placeholders, ensuring consistency.
  6. Step 5: Real-Time Reporting:

    • The reranked search results are sent back to the user or integrated system via the Webhook Node in a JSON-formatted response.
    • Reports are highly structured and ready for downstream processing or consumption.

Key Features

  1. AI-Powered Query Refinement:

    • Transforms basic queries into detailed, expert-level search terms for optimal results.
  2. Dual-Stage Semantic Search:

    • Combines query generation and result reranking for precise, high-relevance outputs.
  3. Top 10 Result Reranking:

    • Dynamically ranks and organizes the top 10 results based on semantic relevance to the query.
  4. Customizable Integration:

    • Fully modifiable for alternative APIs or integrations, such as other search engines or custom ranking logic.
  5. JSON-Formatted Structured Results:

    • Outputs reranked results in a standardized format, ideal for integration into systems requiring machine-readable data.
  6. Webhook-Based Flexibility:

    • Works seamlessly with Webhook inputs for easy deployment in diverse workflows.
  7. Cost-Effective API Usage:

    • Pre-integrated with the free Brave Search API, minimizing operational costs while delivering accurate search results.

Instructions for API Setup

  1. Brave Search API:
  2. AI Integration (Google Gemini):
    • Visit Google AI Studio and generate an API key for semantic query generation and reranking.
  3. Webhook Configuration:
    • Set up the input Webhook to capture search queries and the output Webhook to deliver reranked results.

Why Choose This Workflow?

  • Precision and Relevance: Combines AI-based query generation with advanced reranking for accurate results.
  • Fully Customizable: Easily adapt the workflow to alternative APIs, search engines, or ranking logic.
  • Real-Time Insights: Provides structured, real-time output ready for immediate use.
  • Scalable and Modular: Ideal for businesses, researchers, and data analysts needing a robust, repeatable solution.

Tags

AI Workflow, Semantic Search, Query Refinement, Search Result Reranking, Real-Time Search, Web Search Automation, Google Search, Brave Search, News Search, API Integration, Market Research, Competitive Intelligence, Business Intelligence,Google Gemini, Anthropic Claude, OpenAI, GPT, LLM

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Date & Time

Type / Role
n8n-nodes-base.dateTime - dateTime
Config choices
Version 2

Block 4 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 5 - Auto-fixing Output Parser6

Type / Role
@n8n/n8n-nodes-langchain.outputParserAutofixing - outputParserAutofixing
Config choices
Version 1

Block 6 - Auto-fixing Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserAutofixing - outputParserAutofixing
Config choices
Version 1

Block 7 - Structured Output Parser1

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 8 - Query-1 Combined

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.1

Block 10 - Semantic Search - Result Re-Ranker

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 11 - Query

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 12 - Webhook Call

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Semantic Search -Query Maker

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.4

Block 15 - Anthropic Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatAnthropic - lmChatAnthropic
Config choices
Version 1.2

Block 16 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1

Block 17 - Structured Output Parser2

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 18 - Parser Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 19 - Agent Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGoogleGemini - lmChatGoogleGemini
Config choices
Version 1

Block 20 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Intelligent web query and semantic re-ranking flow using Brave and Google Gemini
Complexity advanced
Nodes 20
Categories Market Research, AI RAG
Author Mind-Front
Published 16 Dec 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2643/2643.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Intelligent web query and semantic re-ranking flow using Brave and Google Gemini do?

Workflow Description This workflow is a powerful, fully automated web query and semantic reranking system that allows users to perform precise, detailed searches, intelligently rank search results ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Market Research, AI RAG use case.