Retrieve and Index Search Engine Data
AgentSearch Loader integrates search APIs and RAG-specialized LLMs into LlamaIndex, enabling query-time retrieval from Bing or AgentSearch with models like
Why it matters
Integrate with search engines like Bing to retrieve real-time information and index it for use with RAG-specialized LLMs, enabling advanced search agent capabilities.
Outcomes
What it gets done
Connect to AgentSearch dataset or hosted search APIs.
Query search engines with user-defined strings.
Load retrieved search results into LlamaIndex.
Provide metadata including related queries and search results.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-agent-search | bash Overview
AgentSearch Loader
AgentSearch Loader is a LlamaIndex reader that connects to hosted search APIs (Bing, AgentSearch) and RAG-specialized language models like SciPhi/Sensei-7B-V1. It accepts a query string, search provider, and model name, then returns documents. Use AgentSearch Loader when building LlamaIndex applications that need to retrieve information from web search APIs or specialized search datasets. It fits scenarios where you need to augment static document stores with external search sources.
What it does
AgentSearch Loader is a LlamaIndex reader that connects your data pipeline to hosted search APIs (including Bing and AgentSearch) and RAG-specialized language models such as SciPhi/Sensei-7B-V1. At query time, you pass a search string, choose a search provider, and specify a RAG model; the loader returns documents.
When to use - and when NOT to
Use AgentSearch Loader when you need to augment LlamaIndex workflows with web search or specialized search datasets, especially when you want RAG-optimized LLMs to process search results. It fits scenarios where your application needs to retrieve information from external search sources.
Do not use this loader if your use case relies entirely on private, offline document collections with no need for external search APIs. Avoid it when you cannot accommodate the latency of external API calls or when your compliance requirements prohibit sending queries to third-party search services.
Inputs and outputs
You provide a query string, a search provider identifier (such as bing or agent-search), and a RAG provider model name (for example, SciPhi/Sensei-7B-V1). Optionally, you can set the SCIPHI_API_KEY environment variable for authentication.
The loader returns document objects. Based on the example, documents contain a text field and a metadata dictionary.
pip install llama-index-readers-agent-search
### Optionally set the API key in the env
### import os
### os.environ["SCIPHI_API_KEY"] = "..."
from llama_index.readers.agent_search import AgentSearchReader
reader = AgentSearch()
document = reader.load_data(
query="latest news",
)[0]
### text = "The latest news encompasses ... and its consequences [2]."
### metadata = {'related_queries': ['Details on the...', ...], 'search_results' : [...]}
Integrations
AgentSearch Loader integrates with the AgentSearch dataset and hosted search APIs including Bing. It works with RAG-specialized language models such as SciPhi/Sensei-7B-V1. The loader is designed as a data source for LlamaIndex, fitting into the broader LlamaIndex ecosystem for building retrieval-augmented generation pipelines.
Who it's for
This loader serves developers building LlamaIndex-based applications who need to incorporate search APIs or search datasets into their RAG workflows. If you are already using LlamaIndex and need to extend your data sources beyond static documents, AgentSearch Loader provides a straightforward integration path.
Source README
AgentSearch Loader
pip install llama-index-readers-agent-search
This framework facilitates seamless integration with the AgentSearch dataset or hosted search APIs (e.g. Search Engines) and with RAG-specialized LLM's (e.g. Search Agents).
During query-time, the user passes in the query string, search provider (bing, agent-search), and RAG provider model (SciPhi/Sensei-7B-V1).
To learn more, please refer to the documentation here.
Usage
Here's an example usage of the AgentSearchReader.
### Optionally set the API key in the env
### import os
### os.environ["SCIPHI_API_KEY"] = "..."
from llama_index.readers.agent_search import AgentSearchReader
reader = AgentSearch()
document = reader.load_data(
query="latest news",
)[0]
### text = "The latest news encompasses ... and its consequences [2]."
### metadata = {'related_queries': ['Details on the...', ...], 'search_results' : [...]}
This loader is designed to be used as a way to load data into LlamaIndex.
https://github.com/run-llama/llama_index/
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.