Animated data flow diagram

Conversational AI Agent: Ollama with Wikipedia & Weather Lookup

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Ollama Wikipedia Langchain Open-Meteo API

Overview

Unlock Interactive Knowledge & Real-time Data with this AI Agent

This n8n workflow sets up an intelligent AI Agent designed for interactive conversations. It leverages a locally hosted Ollama Large Language Model (like Llama 3.2) to understand your prompts and generate human-like responses. The agent's superpower lies in its ability to use specialized tools: it can consult Wikipedia for in-depth information on a vast range of topics and fetch current weather conditions for any location using an external API. With a built-in memory, it remembers the context of your last 20 messages, making conversations feel more natural and continuous. This agent is perfect for solopreneurs, founders, and tech teams looking to build custom, private AI assistants without relying on third-party cloud services for the core LLM processing.

Key Features & Benefits

  • Local LLM Power: Utilizes Ollama (e.g., Llama 3.2) for private, cost-effective, and customizable AI responses. You control the model and the data.
  • Knowledgeable Assistant: Integrates with Wikipedia, allowing the agent to look up and incorporate factual information into its answers.
  • Real-time Data Access: Equipped with a tool to call a weather API (Open-Meteo), providing up-to-date weather forecasts.
  • Context-Aware Conversations: Remembers the last 20 messages using Window Buffer Memory for more coherent and relevant interactions.
  • Interactive Engagement: Triggered by manual chat inputs, making it easy to test, use, and integrate into chat interfaces.
  • Tool-Using Agent: Demonstrates a core AI Agent capability – deciding which tool (Wikipedia, Weather) to use based on the user's query, guided by its system prompt.
  • Easy to Customize: The system prompt, tools, and underlying LLM model can be easily modified or extended to suit your specific needs.

Use Cases

  • Internal Knowledge Bot: Deploy as an assistant for your team to quickly find information from Wikipedia or check weather conditions without leaving their chat.
  • Customer Support Augmentation (B2C/B2B): Handle initial customer inquiries by providing general information or weather-related details if relevant to your service (e.g., travel, outdoor events).
  • Interactive Data Retrieval: Build a conversational interface to fetch specific data points (like weather) without manual lookups.
  • Educational Tool: Use as a learning aid that can explain concepts using Wikipedia and provide real-world data examples.
  • Development & Prototyping: A great starting point for founders and CTOs to experiment with local LLMs and tool-using AI agents for various business applications.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • Ollama service running and accessible by your n8n instance. Ensure you have pulled the desired model (e.g., ollama pull llama3.2:latest).
  • If your Ollama service is not on http://localhost:11434 or requires authentication, you'll need to create and select the appropriate Ollama API credentials in n8n.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Ensure your Ollama service is running and accessible from your n8n instance with the required model downloaded.
  4. In the 'Ollama Chat Model' node, select your configured Ollama API credential. Verify the 'Model' parameter is set to a model you have available in Ollama (e.g., llama3.2:latest).
  5. Verify the 'Weather HTTP Request' tool is configured correctly. The default Open-Meteo API does not require a key for basic use but ensure n8n can reach https://api.open-meteo.com.
  6. The 'Wikipedia' tool requires no special credential setup.
  7. Review the 'System Message' in the 'AI Agent' node's parameters. The default is: "You are a helpful assistant, with weather tool and wiki tool. find out the latitude and longitude information of a location then use the weather tool for current weather and weather forecast. For general info, use the wiki tool." You can customize this to change the agent's behavior.
  8. Activate the workflow. Test by manually triggering the 'On new manual Chat Message' node (e.g., by clicking 'Test workflow' and then 'Execute node', or using a chat interface if integrated).

Tags:

AI AgentAutomationOllamaLangchainWikipediaWeather APIConversational AILocal LLMKnowledge Retrieval

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation