arXiv Agent
arXiv research paper search and analysis tools for AI agents.
from praisonaiagents import Agent
from praisonai_tools import search_arxiv
agent = Agent(name="Researcher", tools=[search_arxiv])
agent.start("Find recent papers on retrieval-augmented generation")The user asks for literature; the agent searches arXiv and returns relevant papers.
arXiv Tools
Use arXiv Tools to search and analyze research papers with AI agents.
- Install Dependencies
First, install the required packages:
bash pip install praisonaiagents praisonai-tools arxiv - Import Components
Import the necessary components:
python from praisonaiagents import Agent, Task, AgentTeam from praisonai_tools import search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category - Create Agent
Create a research agent:
python research_agent = Agent( name="ResearchAgent", role="Scientific Literature Specialist", goal="Find and analyze relevant scientific papers.", backstory="Expert in academic research and literature review.", tools=[search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category], reflection=False ) - Define Task
Define the research task:
python research_task = Task( description="Search for recent papers on 'quantum machine learning' and summarize key findings.", expected_output="List of relevant papers with summaries.", agent=research_agent, name="quantum_research" ) - Run Agent
Initialize and run the agent:
python agents = AgentTeam( agents=[research_agent], tasks=[research_task], process="sequential" ) agents.start()
Understanding arXiv Tools
What are arXiv Tools?arXiv Tools provide scientific paper search capabilities for AI agents: – Paper search functionality – Author-based search – Category filtering – Abstract retrieval – PDF download options
Available Functions
from praisonai_tools import search_arxiv
from praisonai_tools import get_arxiv_paper
from praisonai_tools import get_papers_by_author
from praisonai_tools import get_papers_by_categoryFunction Details
search_arxiv(query: str, max_results: int = 10, sort_by: str = “relevance”, sort_order: str = “descending”, include_fields: Optional[List[str]] = None)
Search arXiv for papers:
- Flexible query support
- Customizable results
- Multiple sorting options
- Field selection
from praisonai_tools import search_arxiv
# Basic search
papers = search_arxiv("quantum computing")
# Advanced search
papers = search_arxiv(
query="quantum computing",
max_results=5,
sort_by="submittedDate",
sort_order="descending",
include_fields=["title", "authors", "summary"]
)get_arxiv_paper(paper_id: str, include_fields: Optional[List[str]] = None)
Get specific paper details:
- Direct ID lookup
- Full paper metadata
- Customizable fields
- PDF/Abstract links
from praisonai_tools import get_arxiv_paper
# Get paper by ID
paper = get_arxiv_paper("2401.00123")
# Get specific fields
paper = get_arxiv_paper(
paper_id="2401.00123",
include_fields=["title", "authors", "pdf_url"]
)get_papers_by_author(author: str, max_results: int = 10)
Search papers by author:
- Author-specific search
- Publication timeline
- Sort options
from praisonai_tools import get_papers_by_author
# Get author's papers
papers = get_papers_by_author("Yoshua Bengio", max_results=5)get_papers_by_category(category: str, max_results: int = 10)
Search papers by category:
- Category-specific search
- Latest publications
- Sort options
from praisonai_tools import get_papers_by_category
# Get papers in category
papers = get_papers_by_category("cs.AI", max_results=5)Examples
Basic Research Agent
from praisonaiagents import Agent, Task, AgentTeam
from praisonai_tools import search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category
# Create research agent
research_agent = Agent(
name="PaperSearcher",
role="Scientific Literature Specialist",
goal="Find relevant scientific papers on specified topics.",
backstory="Expert in academic research and literature analysis.",
tools=[search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category],
reflection=False
)
# Define research task
research_task = Task(
description="Search for papers on 'transformer models in NLP' from the last year.",
expected_output="List of relevant papers with abstracts and key findings.",
agent=research_agent,
name="nlp_research"
)
# Run agent
agents = AgentTeam(
agents=[research_agent],
tasks=[research_task],
process="sequential"
)
agents.start()Advanced Research with Multiple Agents
from praisonaiagents import Agent, Task, AgentTeam
from praisonai_tools import search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category
# Create research agent
research_agent = Agent(
name="Researcher",
role="Literature Specialist",
goal="Gather comprehensive scientific literature.",
tools=[search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category],
reflection=False
)
# Create analysis agent
analysis_agent = Agent(
name="Analyzer",
role="Research Analyst",
goal="Analyze and synthesize research findings.",
backstory="Expert in scientific literature analysis.",
reflection=False
)
# Define tasks
research_task = Task(
description="Search for papers on quantum computing applications in cryptography.",
agent=research_agent,
name="quantum_research"
)
analysis_task = Task(
description="Analyze the papers and identify key trends and breakthroughs.",
agent=analysis_agent,
name="research_analysis"
)
# Run agents
agents = AgentTeam(
agents=[research_agent, analysis_agent],
tasks=[research_task, analysis_task],
process="sequential"
)
agents.start()Best Practices
Agent Configuration
Configure agents with clear research focus:
from praisonai_tools import search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category
Agent(
name="Researcher",
role="Literature Specialist",
goal="Find relevant scientific papers",
tools=[search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category]
)Task Definition
Define specific research objectives:
Task(
description="Find papers on 'deep learning in healthcare' from top authors",
expected_output="Curated list of papers with impact analysis"
)Common Patterns
Literature Review
from praisonaiagents import Agent, Task, AgentTeam
from praisonai_tools import search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category
# Literature search agent
searcher = Agent(
name="Searcher",
role="Literature Specialist",
tools=[search_arxiv, get_arxiv_paper, get_papers_by_author, get_papers_by_category]
)
# Review agent
reviewer = Agent(
name="Reviewer",
role="Research Reviewer"
)
# Define tasks
search_task = Task(
description="Find papers on AI ethics",
agent=searcher
)
review_task = Task(
description="Review and summarize findings",
agent=reviewer
)
# Run workflow
agents = AgentTeam(
agents=[searcher, reviewer],
tasks=[search_task, review_task]
)