Build a Smart Conversational AI with LangChain and n8n

Discover how to create a practical AI assistant in n8n using LangChain. This workflow combines Wikipedia lookup and real-time weather data fetching to answer chat prompts effectively, saving you hours of manual research and response crafting.
agent
manualChatTrigger
toolWikipedia
+4
Workflow Identifier: 1656
NODES in Use: manualChatTrigger, agent, memoryBufferWindow, toolWikipedia, toolHttpRequest, lmChatOllama, stickyNote
Automate AI chat with LangChain and n8n

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What this workflow does

This workflow uses n8n to create a chat assistant that answers questions about weather and general information.
It solves the problem of slow replies and mistakes by giving quick, accurate answers automatically.
The result is faster responses with correct info from Wikipedia and live weather data.


Who should use this workflow

Any user who wants to automate replies about weather or places in a chat.
Good for customer support teams needing fast, accurate help without searching many websites.


Tools and services used


Inputs → Processing → Outputs Explained

Inputs

User sends a chat message manually in n8n via the On new manual Chat Message node.
This message can ask about weather or places.

Processing Steps

The AI Agent reads the chat, guided by a system message.
It checks if the question needs Wikipedia info or weather data.

If Wikipedia info is needed, the agent calls the Wikipedia node to get facts.
If weather info is needed, the agent extracts location coordinates, then calls the Weather HTTP Request node to get the forecast.

The Window Buffer Memory node keeps the last 20 messages so conversations feel connected.
Finally, the Ollama Chat Model creates a natural reply to send back.

Outputs

The user receives a clear chat reply.
It contains either weather forecast data or detailed place information, depending on the question.


Beginner step-by-step: How to use this workflow in n8n

1. Import workflow

  1. Download the workflow file using the Download button on this page.
  2. In your n8n editor, click “Import from file” and select the downloaded file.

2. Set credentials and API keys

  1. Add your Ollama API credentials in the Ollama Chat Model node.
  2. Ensure internet connection for the Weather HTTP Request node to access Open-Meteo API.

3. Update any relevant data

  1. If needed, update parameters like location, temperature units, or memory length inside nodes.

4. Test the workflow

  1. Send a manual chat message via On new manual Chat Message node to see AI answer.

5. Activate for production

  1. Turn on the workflow in n8n to run live.

If self hosting n8n, see self-host n8n for help setting up.


Common errors and how to fix them

  • AI Agent not starting or empty answers: Check the On new manual Chat Message node is connected properly and the system message is set in AI Agent.
  • Weather API gives errors or no data: Verify parameter names in Weather HTTP Request are exactly latitude, longitude, forecast_days, and hourly.
  • Ollama model authentication fails: Confirm Ollama API keys are correct and the service is running.

Ideas for customization

  • Add more tools like YouTube search or dictionary nodes connected to the AI Agent.
  • Change the Window Buffer Memory context length to remember more or fewer past messages.
  • Switch the Ollama model to another supported language model by updating the model node.
  • Improve system message instructions for clearer AI task handling or add fallback replies.
  • Tweak the weather API request to include more forecast days or weather alerts by changing query parameters.

Summary and results

✓ Saves time by answering weather and knowledge questions automatically.
✓ Uses real-time weather data and Wikipedia info for accuracy.
✓ Keeps chat memory so answers stay relevant to the conversation.
✓ Easy to test and activate in n8n with simple setup steps.
✓ Helps customer support give fast and correct responses.


Automate AI chat with LangChain and n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Yes. The Ollama Chat Model node can be switched with other LangChain-supported language models, but credentials and prompts may need updates.
No. The only external API is Open-Meteo which is free with generous limits, so costs are minimal.
Conversation data is stored temporarily in the Window Buffer Memory node inside n8n. No external databases are used unless added.
This happens if the On new manual Chat Message node is not connected properly to the AI Agent node or the system prompt is missing.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.