Skip to main content
from praisonaiagents import Agent

agent = Agent(
    name="WikiAgent",
    instructions="Search Wikipedia for factual information.",
)
agent.start("Explain the history of the internet")
The user asks for encyclopaedic facts; the agent searches Wikipedia and returns a grounded summary.

Wikipedia PraisonAI Integration

pip install wikipedia langchain_community
# tools.py
from langchain_community.utilities import WikipediaAPIWrapper
class WikipediaSearchTool(BaseTool):
    name: str = "WikipediaSearchTool"
    description: str = "Search Wikipedia for relevant information based on a query."

    def _run(self, query: str):
        api_wrapper = WikipediaAPIWrapper(top_k_results=4, doc_content_chars_max=100)
        results = api_wrapper.load(query=query)
        return results
# agents.yaml
framework: crewai
topic: research about nvidia growth
agents:  # Canonical: use 'agents' instead of 'roles'
  data_collector:
    instructions:  # Canonical: use 'instructions' instead of 'backstory' An experienced researcher with the ability to efficiently collect and
      organize vast amounts of data.
    goal: Gather information on Nvidia's growth by providing the Ticket Symbol to YahooFinanceNewsTool
    role: Data Collector
    tasks:
      data_collection_task:
        description: Collect data on Nvidia's growth from various sources such as
          financial reports, news articles, and company announcements.
        expected_output: A comprehensive document detailing data points on Nvidia's
          growth over the years.
    tools:
    - 'WikipediaSearchTool'

Quick Start

1

Install

pip install praisonaiagents wikipedia-api
2

Search Wikipedia with agent

from praisonaiagents import Agent

agent = Agent(
    name="WikiAgent",
    instructions="Search Wikipedia for factual information.",
)

agent.start("Explain the history of the internet")

Best Practices

Wikipedia tools are best for general knowledge and background context, not breaking news.
Extract specific sections rather than full articles to reduce token usage.
Combine Wikipedia (background facts) with web search (recent information) for comprehensive research.

Custom Tools

Build your own agent tools

Tools Overview

Browse PraisonAI tool documentation