Skip to main content
The Wikipedia search integration allows users to perform search in wikipedia pages within the AG2 framework. Follow these steps to integrate Wikipedia Tools with AG2 Agents.

Package Installation

To get started with the Wikipedia Search integration in AG2, follow these steps: Install AG2 with "wikipedia and openai since we use OpenAI’s LLMs in our example:
Note: If you have been using autogen or ag2, all you need to do is upgrade it using:
or
as autogen and ag2 are aliases for the same PyPI package.
You’re all set! Now you can start using Wikipedia Search with AG2.

Implementation

Imports

Agent Configuration

Configure an assistant agent and user proxy to be used for LLM recommendation and execution respectively.

Wikipedia Query Run Tool Setup

Usage Example

With the setup complete, you can now use the assistant to fetch wikipedia search results.

Output