Integrate Desearch for Enhanced Agent Search
Search the web, Twitter, and more through the Desearch API in a LlamaIndex agent.
Why it matters
Empower your AI agent with Desearch's powerful search capabilities across web, Twitter, and more. Seamlessly integrate Desearch to enable agents to find and process information from diverse online sources.
Outcomes
What it gets done
Connect your agent to the Desearch API.
Perform web, Twitter, and general searches via the agent.
Leverage Desearch for data retrieval within agent workflows.
Enable agents to access and utilize information from multiple platforms.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-tool-tools-desearch | bash Overview
LlamaIndex Tools Integration: Desearch
A LlamaIndex tool for the Desearch API that searches the web, Twitter, and Reddit, combined or scoped to one platform. Use the combined search for cross-platform coverage, or the scoped functions when only Twitter or web results are needed.
What it does
The Desearch Tool connects a LlamaIndex agent to Desearch, letting the agent perform searches across multiple platforms - web, Twitter, and others - through one integration. DesearchToolSpec is initialized with a Desearch API key and exposes three functions the agent can call: ai_search_tool performs a search across multiple platforms at once (web, Twitter, Reddit, and more), twitter_search_tool runs a basic Twitter-specific search, and web_search_tool runs a basic web-specific search.
The source's own worked example shows the agent answering "Can you find the latest news on quantum computing?" - a query that benefits from Desearch's cross-platform reach rather than a single-source search.
When to use - and when NOT to
Use ai_search_tool when you want Desearch's combined multi-platform search (web, Twitter, Reddit, and more) in one call. Use twitter_search_tool or web_search_tool specifically when you want to scope the search to just Twitter or just the web, rather than everything at once. Do not use it without a Desearch API key from the Desearch developer dashboard; none of the three search functions work without one.
Capabilities
ai_search_tool searches across multiple platforms (web, Twitter, Reddit, and more) in one call. twitter_search_tool runs a Twitter-scoped search. web_search_tool runs a web-scoped search.
How to install
from llama_index_desearch.tools import DesearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
desearch_tool = DesearchToolSpec(
api_key=os.environ["DESEARCH_API_KEY"],
)
agent = FunctionAgent(
tools=desearch_tool.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
Requires a Desearch API key from the Desearch developer dashboard.
Who it's for
Developers building LlamaIndex agents that need current information from across the web and social platforms like Twitter and Reddit, in one combined search or scoped to a single platform.
Source README
Here's a README for the Desearch integration, modeled after the example you provided:
LlamaIndex Tools Integration: Desearch
This tool connects to Desearch to enable your agent to perform searches across various platforms like web, Twitter, and more.
To begin, you need to obtain an API key from the Desearch developer dashboard.
Website: https://desearch.io
Usage
Here's an example usage of the DesearchToolSpec.
To get started, you will need a Desearch API key
### %pip install llama-index llama-index-core desearch-py
from llama_index_desearch.tools import DesearchToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
desearch_tool = DesearchToolSpec(
api_key=os.environ["DESEARCH_API_KEY"],
)
agent = FunctionAgent(
tools=desearch_tool.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("Can you find the latest news on quantum computing?"))
Available Functions
- ai_search_tool: Perform a search using Desearch across multiple platforms like web, Twitter, Reddit, etc.
- twitter_search_tool: Perform a basic Twitter search using the Desearch API.
- web_search_tool: Perform a basic web search using the Desearch API.
This loader is designed to be used as a way to load data as a Tool in an Agent.
You can copy and paste this into your README file. Let me know if you need any more modifications!
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.