AIE6-ResearchAgent / models /search_tools.py
mafzaal's picture
Implement LangGraph Agent for Research with Document Retrieval and Search Tools
2dad3d9
raw
history blame contribute delete
841 Bytes
"""
Search tools module containing different search implementations.
"""
from langchain_community.tools.tavily_search import TavilySearchResults
from langchain_community.tools.arxiv.tool import ArxivQueryRun
from langchain_community.tools import DuckDuckGoSearchResults
from langchain_core.tools import Tool
def create_search_tools(max_results=5):
"""
Create search tools for the research agent.
Args:
max_results: Maximum number of results to return
Returns:
List of search tools for the agent
"""
# Initialize standard search tools
tavily_tool = TavilySearchResults(max_results=max_results)
duckduckgo_tool = DuckDuckGoSearchResults(max_results=max_results)
arxiv_tool = ArxivQueryRun()
return [
tavily_tool,
duckduckgo_tool,
arxiv_tool,
]