Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.xhipai.com/llms.txt

Use this file to discover all available pages before exploring further.

Wikipedia

Search articles and get summaries from Wikipedia using the free MediaWiki REST API. No API key required.

Quick Start

import { Agent, openai, WikipediaToolkit } from "@agentium/core";

const wiki = new WikipediaToolkit();

const agent = new Agent({
  name: "knowledge-agent",
  model: openai("gpt-4o"),
  instructions: "Look up facts on Wikipedia to answer questions accurately.",
  tools: [...wiki.getTools()],
});

const result = await agent.run("Tell me about the history of TypeScript");

Config

language
string
default:"en"
Wikipedia language code (e.g. "en", "fr", "de", "es").
maxResults
number
default:"5"
Default maximum search results per query.

Tools

ToolDescription
wikipedia_searchSearch Wikipedia for articles. Returns titles, URLs, and snippets.
wikipedia_summaryGet a summary of a Wikipedia article by exact title.

Example: Multilingual Research

const wiki = new WikipediaToolkit({ language: "fr" });

const agent = new Agent({
  name: "french-researcher",
  model: openai("gpt-4o"),
  instructions: "Recherchez des informations sur Wikipedia en français.",
  tools: [...wiki.getTools()],
});