llama-index-packs-agent-search-retriever


Namellama-index-packs-agent-search-retriever JSON
Version 0.1.4 PyPI version JSON
download
home_page
Summaryllama-index packs agent_search_retriever integration
upload_time2024-03-06 03:34:32
maintainerlogan-markewich
docs_urlNone
authorYour Name
requires_python>=3.9,<3.12
licenseMIT
keywords agent retriever search
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://agent-search.readthedocs.io/en/latest/).

## CLI Usage

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

```bash
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:

```python
# 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()`.

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

print(source_nodes)
```

See the [notebook on llama-hub](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/dense_x_retrieval/dense_x_retrieval.ipynb) for a full example.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "llama-index-packs-agent-search-retriever",
    "maintainer": "logan-markewich",
    "docs_url": null,
    "requires_python": ">=3.9,<3.12",
    "maintainer_email": "",
    "keywords": "agent,retriever,search",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/f5/99/ff51ce4779a09f719b77967997746acd9832abe5bdd6a3a41f5b71c82fb0/llama_index_packs_agent_search_retriever-0.1.4.tar.gz",
    "platform": null,
    "description": "# Agent-Search Retrieval Pack\n\nThis LlamaPack creates a custom retriever that uses the agent-search API for retrieving general content indexed from the internet.\n\nThis framework facilitates seamless integration with the AgentSearch dataset (terabytes of indexed data!) or hosted search APIs (e.g. Search Engines).\n\nDuring query-time, the user passes in the query string, search provider (`bing`, `agent-search`), and relevant nodes are retrieved from the hosted dataset.\n\nTo learn more, please refer to the documentation [here](https://agent-search.readthedocs.io/en/latest/).\n\n## CLI Usage\n\nYou can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:\n\n```bash\nllamaindex-cli download-llamapack AgentSearchRetrieverPack --download-dir ./agent_search_pack\n```\n\nYou can then inspect the files at `./agent_search_pack` and use them as a template for your own project!\n\n## Code Usage\n\nYou can download the pack to a the `./agent_search_pack` directory:\n\n```python\n# Optionally set the API key in the env\n# import os\n# os.environ[\"SCIPHI_API_KEY\"] = \"...\"\n\nfrom llama_index.core.query_engine import RetrieverQueryEngine\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nAgentSearchRetrieverPack = download_llama_pack(\n    \"AgentSearchRetrieverPack\", \"./agent_search_pack\"\n)\n\nagent_search_pack = AgentSearchRetrieverPack(\n    api_key=\"...\", similarity_top_k=4, search_provider=\"agent-search\"\n)\n\n# use the retriever directly\nretriever = agent_search_pack.retriever\nsource_nodes = retriever.retrieve(\"query str\")\n\n# uses the agent-search retriever within a llama-index query engine!\nquery_engine = RetrieverQueryEngine.from_args(retriever)\nresponse = query_engine.query(\"query str\")\n```\n\nThe `run()` function is a light wrapper around `retriever.retrieve()`.\n\n```python\nsource_nodes = agent_search_pack.run(\"What can you tell me about LLMs?\")\n\nprint(source_nodes)\n```\n\nSee the [notebook on llama-hub](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/dense_x_retrieval/dense_x_retrieval.ipynb) for a full example.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index packs agent_search_retriever integration",
    "version": "0.1.4",
    "project_urls": null,
    "split_keywords": [
        "agent",
        "retriever",
        "search"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c788bd75e61cf7f82ffee4b4f9256ff7176fef1e4b0be0e05fba2ccfadf2a336",
                "md5": "7580e0f5a267914be8efe4060f7d14ee",
                "sha256": "97235c28728df6c44f32bad24db974f4701371f2b707d7b0543049ebea7a9a33"
            },
            "downloads": -1,
            "filename": "llama_index_packs_agent_search_retriever-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7580e0f5a267914be8efe4060f7d14ee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.12",
            "size": 3607,
            "upload_time": "2024-03-06T03:34:31",
            "upload_time_iso_8601": "2024-03-06T03:34:31.115777Z",
            "url": "https://files.pythonhosted.org/packages/c7/88/bd75e61cf7f82ffee4b4f9256ff7176fef1e4b0be0e05fba2ccfadf2a336/llama_index_packs_agent_search_retriever-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f599ff51ce4779a09f719b77967997746acd9832abe5bdd6a3a41f5b71c82fb0",
                "md5": "cb7b8c8a96e2c203f5267f8999561b37",
                "sha256": "112bdd1f49ac98bca3ae72615c5f7c8b0b4704c9846076da5f9d10fe571aef1d"
            },
            "downloads": -1,
            "filename": "llama_index_packs_agent_search_retriever-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "cb7b8c8a96e2c203f5267f8999561b37",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.12",
            "size": 3154,
            "upload_time": "2024-03-06T03:34:32",
            "upload_time_iso_8601": "2024-03-06T03:34:32.617950Z",
            "url": "https://files.pythonhosted.org/packages/f5/99/ff51ce4779a09f719b77967997746acd9832abe5bdd6a3a41f5b71c82fb0/llama_index_packs_agent_search_retriever-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-06 03:34:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-packs-agent-search-retriever"
}
        
Elapsed time: 0.69748s