Knowledge & Research
Query the arXiv preprint server.
arxiv_searchSearches arXiv, the world's largest open library of scientific preprints. Great when you want the agent to pull recent papers on a topic — machine learning, physics, biology — and get back titles, authors, and links to the PDFs.
Issues a query to the public arXiv API — either free-text across the full corpus or a direct ID lookup (e.g. '2308.12345'). Returns paper titles, authors, abstracts, submission dates, and direct PDF links. No API key is needed; rate limits apply as set by arXiv.
When a user asks:
Find recent papers on retrieval-augmented generation.
the agent calls the tool:
arxiv_search(query="retrieval-augmented generation", maxResults=10)and gets back: a list of preprints with titles, authors, abstracts, and direct PDF links.
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
# literature-review.yaml
name: literature-review-crew
process: SEQUENTIAL
agents:
- id: librarian
role: Research Librarian
goal: Find recent preprints relevant to the research question
tools:
- arxiv_search
tasks:
- id: literature-review-task
agent: librarian
description: Search arXiv for 'retrieval-augmented generation' and return the top 10 papers with titles, authors, and PDF links.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.ArxivTool;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
@Autowired ChatClient chatClient;
@Autowired ArxivTool arxivTool;
Agent librarian = Agent.builder()
.role("Research Librarian")
.goal("Find recent preprints relevant to the research question")
.chatClient(chatClient)
.tool(arxivTool)
.build();
Task librarianTask = Task.builder()
.description("Search arXiv for 'retrieval-augmented generation' and return the top 10 papers with titles, authors, and PDF links.")
.agent(librarian)
.build();
SwarmOutput result = Swarm.builder()
.agent(librarian)
.task(librarianTask)
.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/ArxivTool.java in the swarm-ai repository.