---
title: Wikipedia Query
description: Query Wikipedia for information on a given topic.
---

Let an AI agent look up a topic on Wikipedia and read the article summaries.

## What it does

Wikipedia Query is a tool for an agent, not a step in the flow. It has no output port: you connect it to the **Tools** slot of a [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/).

When the agent calls it with a search term, the tool searches English Wikipedia, takes the top matching articles and returns each one as `Page: <title>` followed by its summary. By default it returns 3 articles and cuts the whole text at 4,000 characters. If nothing matches, the model gets "No good Wikipedia Search Result was found".

It only reads public Wikipedia, so no approval or credential is needed.

## When to use it

* The agent needs background facts: who someone is, what a term means, when something happened.
* You want well-known, stable facts rather than the latest news.

For current information, use [Web Search](/nodes/builtin/ai/aidependencies/tools/web-search/). To answer from your own documents, connect a knowledge base to the Tools Agent's **Knowledge** slot instead.

## Inputs and settings

* **Top K Results**: how many articles to read per search. Empty means 3.
* **Max Document Content Length**: the maximum number of characters returned in total, across all articles. Empty means 4,000. Raise it for more detail, lower it to keep runs cheaper.

## Outputs

This node has no output port. It plugs into a slot on another node instead of passing items along.

* **Tools** slot of [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/)

The summaries go back to the model, not to the next node. The agent's `steps` output lists each lookup, and its `response` holds the final answer.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. [Get Selected Text](/nodes/extension/getselectedtext/) reads a name you highlighted in an article, with **Output field name** `text`.
2. [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/) with **Prompt** `Who or what is {{ $input.text }}? Answer in three sentences.`, a [Chat OpenAI](/nodes/builtin/ai/aidependencies/llm/openai/) model in **Model**, and Wikipedia Query connected to **Tools** with **Top K Results** `2`.
3. [Display Markdown](/nodes/extension/displaymarkdown/) shows `{{ $input.response }}`.

## Common issues

* **"No good Wikipedia Search Result was found".** The search term matched no article. Ask the agent to use shorter, more general terms, or check the spelling.
* **The answer stops mid-way or misses details.** The text was cut at **Max Document Content Length**. Raise it, or lower **Top K Results** so each article gets more room.
* **Results are in English for a non-English topic.** The tool always searches English Wikipedia. Ask the agent to translate its answer.

## Related nodes

* [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/): the agent this tool plugs into.
* [Web Search](/nodes/builtin/ai/aidependencies/tools/web-search/): current information from the web.
* [Local Knowledge](/nodes/builtin/ai/aidependencies/vectorstore/localknowledge/): answers from your own documents.