WikipediaTools enable an Assistant to search wikipedia a website and add its contents to the knowledge base.

Example

The following assistant will run seach wikipedia for “ai” and print the response.

cookbook/tools/wikipedia_tools.py
from phi.assistant import Assistant
from phi.tools.wikipedia import WikipediaTools

assistant = Assistant(tools=[WikipediaTools()], show_tool_calls=True)
assistant.print_response("Search wikipedia for 'ai'")

Toolkit Params

knowledge_base
WikipediaKnowledgeBase

The knowledge base associated with Wikipedia, containing various data and resources linked to Wikipedia’s content.

Toolkit Functions

search_wikipedia_and_update_knowledge_base

This function searches wikipedia for a topic, adds the results to the knowledge base and returns them.

search_wikipedia

Searches Wikipedia for a query.

Message us on discord if you need help.