Knowledge & Research
Factual grounding via the public Wikipedia API.
wikipediaPulls facts straight from Wikipedia. Agents use it to get quick, trustworthy background on people, places, companies, or concepts before going deeper — and it works across dozens of languages.
Calls the public Wikipedia REST API with one of three operations: 'summary' fetches a page's lead paragraph, 'search' matches keywords to page titles, and 'article' returns the full article text. Supports every Wikipedia language edition (en, de, zh, …).
When a user asks:
Give me a short background on the Federal Reserve.
the agent calls the tool:
wikipedia(title="Federal Reserve", operation="summary")and gets back: a concise encyclopedic summary of the topic.
Set these before calling the tool. Values marked required must be present or the tool call will fail.
swarmai.tools.wikipedia.user-agent optional User-Agent header sent to Wikipedia REST API. Defaults to 'SwarmAI/1.0 (https://intelliswarm.ai; contact@intelliswarm.ai)'.
Wire this tool into a SwarmAI crew. Use the YAML DSL for declarative workflows, or the Java builder API when you want full programmatic control.
YAML DSL
# background-research.yaml
name: background-research-crew
process: SEQUENTIAL
agents:
- id: analyst
role: Research Analyst
goal: Ground answers with trustworthy encyclopedic facts
tools:
- wikipedia
tasks:
- id: background-research-task
agent: analyst
description: Fetch a Wikipedia summary for 'Federal Reserve' and extract its stated mandate.Java
import ai.intelliswarm.swarmai.agent.Agent;
import ai.intelliswarm.swarmai.task.Task;
import ai.intelliswarm.swarmai.swarm.Swarm;
import ai.intelliswarm.swarmai.swarm.SwarmOutput;
import ai.intelliswarm.swarmai.process.ProcessType;
import ai.intelliswarm.swarmai.tool.research.WikipediaTool;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
@Autowired ChatClient chatClient;
@Autowired WikipediaTool wikipediaTool;
Agent analyst = Agent.builder()
.role("Research Analyst")
.goal("Ground answers with trustworthy encyclopedic facts")
.chatClient(chatClient)
.tool(wikipediaTool)
.build();
Task analystTask = Task.builder()
.description("Fetch a Wikipedia summary for 'Federal Reserve' and extract its stated mandate.")
.agent(analyst)
.build();
SwarmOutput result = Swarm.builder()
.agent(analyst)
.task(analystTask)
.process(ProcessType.SEQUENTIAL)
.build()
.kickoff();Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/research/WikipediaTool.java in the swarm-ai repository.