Skip to main content

Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions

Workflow preview

Workflow preview
100%
Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This workflow builds a conversational AI chatbot agent using Claude 3.7 Sonnet model with the new . It enhances standard LLM capabilities with Anthropic’s features: Web Search and Think : Real time...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatanthropic, @n8n/n8n-nodes-langchain.memorybufferwindow, n8n-nodes-base.httprequesttool, @n8n/n8n-nodes-langchain.toolthink, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions
Workflow name
Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions

This workflow builds a conversational AI chatbot agent using Claude 3.7 Sonnet model with the new . It enhances standard LLM capabilities with Anthropic’s features: Web Search and Think:

  • Real-time web search, to answer up-to-date factual queries.
  • A “Think” function, to support internal reasoning and memory-like behavior by Anthropic.
  • A memory buffer, allowing the agent to maintain conversation history.
  • A system prompt defining clear ethical, functional, and formatting rules for interaction.

When a user sends a message (trigger), the chatbot evaluates the query, optionally performs a web search if needed, processes the result using Claude, and responds accordingly.


Advantages

  • 🧠 Enhanced Reasoning Abilities The Think tool allows the agent to simulate deep thought processes or contextual memory storage, improving conversational intelligence.

  • 🌐 Real-Time Knowledge via Web Search The integrated web_search tool enables the agent to fetch the latest information from the internet, making it ideal for dynamic or news-driven use cases.

  • 🧾 Contextual Responses with Memory Buffer The inclusion of a memory buffer allows the agent to maintain state across messages, improving dialogue flow and continuity.

  • 🛡️ Built-in Ethical Guidelines The system prompt enforces privacy, factual integrity, neutrality, and ethical response generation, making the agent safe for public or enterprise use.


How It Works

  1. Chat Trigger: The workflow begins when a chat message is received via a webhook. This triggers the AI Agent to process the user's query.
  2. AI Agent Processing: The AI Agent analyzes the query to determine if it requires information from the website or external sources. It follows a structured approach:
    • For website-related queries, it uses the provided context.
    • For external information, it employs the web_search tool to fetch up-to-date data from the internet.
    • The Think tool is used for internal reasoning or caching thoughts without altering data.
  3. Language Model: The Anthropic Chat Model (Claude 3.7 Sonnet) generates responses based on the analyzed query, incorporating website context or web search results.
  4. Memory: A simple memory buffer retains context from previous interactions to maintain continuity in conversations.
  5. Output: The final response is delivered to the user, excluding internal processes like web searches or reasoning steps.

Set Up Steps

  1. Configure Nodes:

    • Chat Trigger: Set up the webhook to receive user messages.
    • AI Agent: Define the system message and rules for handling queries.
    • Anthropic Chat Model: Select the Claude 3.7 Sonnet model and configure parameters like maxTokensToSample.
    • Memory: Initialize the memory buffer to store conversation context.
    • Tools:
      • web_search: Configure the HTTP request to the Anthropic API for web searches, including headers and authentication.
      • Think: Set up the tool for internal reasoning.
  2. Connect Nodes:

    • Link the Chat Trigger to the AI Agent.
    • Connect the Anthropic Chat Model, Memory, and Tools (web_search and Think) to the AI Agent.
  3. Credentials:

    • Ensure the Anthropic API credentials are correctly configured for both the chat model and the web_search tool.

Need help customizing?

Contact me for consulting and support or add me on Linkedin.

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 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 3 - Anthropic Chat Model

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

Block 4 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 5 - web_search

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

Block 6 - Think

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

Block 7 - Sticky Note

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

3. Summary Table

Workflow Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions
Complexity intermediate
Nodes 7
Categories Support Chatbot, AI Chatbot
Author Davide
Published 14 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4036/4036.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 Claude 3.7 Sonnet AI chatbot agent with Anthropic web search and think functions do?

This workflow builds a conversational AI chatbot agent using Claude 3.7 Sonnet model with the new . It enhances standard LLM capabilities with Anthropic’s features: Web Search and Think : Real time...

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 Support Chatbot, AI Chatbot use case.