Skip to main content

llama-index packs agent_search_retriever integration

Project description

Agent-Search Retrieval Pack

This LlamaPack creates a custom retriever that uses the agent-search API for retrieving general content indexed from the internet.

This framework facilitates seamless integration with the AgentSearch dataset (terabytes of indexed data!) or hosted search APIs (e.g. Search Engines).

During query-time, the user passes in the query string, search provider (bing, agent-search), and relevant nodes are retrieved from the hosted dataset.

To learn more, please refer to the documentation here.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack AgentSearchRetrieverPack --download-dir ./agent_search_pack

You can then inspect the files at ./agent_search_pack and use them as a template for your own project!

Code Usage

You can download the pack to a the ./agent_search_pack directory:

# Optionally set the API key in the env
# import os
# os.environ["SCIPHI_API_KEY"] = "..."

from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
AgentSearchRetrieverPack = download_llama_pack(
    "AgentSearchRetrieverPack", "./agent_search_pack"
)

agent_search_pack = AgentSearchRetrieverPack(
    api_key="...", similarity_top_k=4, search_provider="agent-search"
)

# use the retriever directly
retriever = agent_search_pack.retriever
source_nodes = retriever.retrieve("query str")

# uses the agent-search retriever within a llama-index query engine!
query_engine = RetrieverQueryEngine.from_args(retriever)
response = query_engine.query("query str")

The run() function is a light wrapper around retriever.retrieve().

source_nodes = agent_search_pack.run("What can you tell me about LLMs?")

print(source_nodes)

See the notebook on llama-hub for a full example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_packs_agent_search_retriever-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_agent_search_retriever-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ea3b8fa289e9b29d60cc8aa5890615a853b0c4cd62efaa84de8ee589fa34f992
MD5 928f73d8cee0bd1fe37b42cc12187ffb
BLAKE2b-256 509d9d3c52bc64742796b6a1b15373a5588fc46a564243644c973b7a839d1582

See more details on using hashes here.

File details

Details for the file llama_index_packs_agent_search_retriever-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_agent_search_retriever-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6923f8ae998802ff73968ff9f8a597336111736291f551a84e6934cbe165a5e4
MD5 ede2ad8c6794e1323d861964f08c4090
BLAKE2b-256 169ece6357a37ccacdb7dd05a0ca3329793c57b1770acbacfe06296d5e7e3110

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page