You can effortlessly chat with any Wikipedia page with the help of AI Agents. Turn hours of research into seamless chatting. The Agent searches all of Wikipedia, provides you with concise responses, and links sources.
What is the Wikipedia Tool
The Wikipedia Tool component allows you to chat with any Wikipedia article. An AI agent finds wikipedia.org articles that match your query. It then identifies the key points and returns a summarized version of the article. If that’s not enough, you can continue chatting with the bot to learn more about the topic or seamlessly transfer to other related topics.
How to use the Wikipedia tool
This component works with an autonomous AI agent. AI Agents are computer programs that can perform tasks and make decisions independently. The Agents observe their environment and take action based on their unique programming, knowledge, and goals.
The tool gives the AI agent the plain-text content of the article. While an average Wikipedia page is approximately 500-800 words, some pages go up to 100,000 words and more. That’s why the Agent will identify the key points and provide you with a 500-word paraphrased summary of the article.
If you need more information, simply ask the bot. It’s just like chatting with a knowledgeable friend. It will get deeper into the topic, combining various articles or seamlessly switching to related topics.
How to connect the Wikipedia Tool to your Flow
Let’s create a basic Wikipedia Chabot. Thanks to the use of an AI Agent, the Flow is super simple and contains just a few components:
- Add Chat Input and AI Agent.
- Connect the input to the Agent.
- Connect the Wikipedia Tool to the AI Agent’s Tool handle.
- Connect Chat History to let the past messages inform future answers. This is optional and costs more tokens, but it is necessary if you want to give follow-up questions.
- You’re ready to send the Agent’s text output to the chat.
Feel free to experiment and expand the Flow. You can add more search tools and Knowledge Retrievers to make the bot a true information powerhouse. Play around with the Agent’s goal and backstory to achieve your desired output.
Wikipedia Tool in action
Below, I’ve decided to ask the chatbot about Retrieval-augmented Generation, RAG. The technology FlowHunt uses to search and retrieve information from fresh sources instead of having to be trained. Even the Wikipedia Tool itself works on the principle of RAG:
The first reply details what RAG is and what it is used for. Let’s say you want to know more about the process behind RAG. You can simply post a follow-up question.
I’ve set up the Agent to always link the sources it used. In the second reply, we can see that besides using the same article on RAG, it also took some information from an article on Vector Databases.
Note: If you want to know where the Flow gets the information, simply tell the AI Agent to always link the sources by including it in its goal.
What happens if there isn’t a Wikipedia article that matches your query? The Chatbot lets you know about it instead of hallucinating an answer. Let’s test it. We know that FlowHunt doesn’t have a Wikipedia page (yet), meaning the bot can’t access the information it needs.
When the Agent can’t find any suitable Wikipedia articles, it apologizes and prompts you to search the web: