llama-index-packs-fusion-retriever


Namellama-index-packs-fusion-retriever JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
Summaryllama-index packs fusion_retriever integration
upload_time2024-11-18 00:55:58
maintainerjerryjliu
docs_urlNone
authorYour Name
requires_python<4.0,>=3.9
licenseMIT
keywords fusion hybrid query retriever rewriting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fusion Retriever Packs

## Hybrid Fusion Pack

This LlamaPack provides an example of our hybrid fusion retriever method.

This specific template fuses results from our vector retriever and bm25 retriever; of course, you can provide any template you want.

Check out the [notebook here](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/fusion_retriever/hybrid_fusion/hybrid_fusion.ipynb).

### CLI Usage

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

```bash
llamaindex-cli download-llamapack HybridFusionRetrieverPack --download-dir ./hybrid_fusion_pack
```

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

### Code Usage

You can download the pack to a the `./hybrid_fusion_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
HybridFusionRetrieverPack = download_llama_pack(
    "HybridFusionRetrieverPack", "./hybrid_fusion_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./hybrid_fusion_pack`.

Then, you can set up the pack like so:

```python
# create the pack
hybrid_fusion_pack = HybridFusionRetrieverPack(
    nodes, chunk_size=256, vector_similarity_top_k=2, bm25_similarity_top_k=2
)
```

The `run()` function is a light wrapper around `query_engine.query()`.

```python
response = hybrid_fusion_pack.run("Tell me about a Music celebritiy.")
```

You can also use modules individually.

```python
# use the fusion retriever
nodes = hybrid_fusion_pack.fusion_retriever.retrieve("query_str")

# use the vector retriever
nodes = hybrid_fusion_pack.vector_retriever.retrieve("query_str")
# use the bm25 retriever
nodes = hybrid_fusion_pack.bm25_retriever.retrieve("query_str")

# get the query engine
query_engine = hybrid_fusion_pack.query_engine
```

## Query Rewriting Retriever Pack

This LlamaPack provides an example of query rewriting through our fusion retriever.

This specific template takes in a single retriever, and generates multiple queries against the retriever, and then fuses the results together.

Check out the [notebook here](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/fusion_retriever/query_rewrite/query_rewrite.ipynb).

### CLI Usage

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

```bash
llamaindex-cli download-llamapack QueryRewritingRetrieverPack --download-dir ./query_rewriting_pack
```

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

### Code Usage

You can download the pack to a the `./query_rewriting_pack` directory:

```python
from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
QueryRewritingRetrieverPack = download_llama_pack(
    "QueryRewritingRetrieverPack", "./query_rewriting_pack"
)
```

From here, you can use the pack, or inspect and modify the pack in `./query_rewriting_pack`.

Then, you can set up the pack like so:

```python
# create the pack
query_rewriting_pack = QueryRewritingRetrieverPack(
    nodes,
    chunk_size=256,
    vector_similarity_top_k=2,
)
```

The `run()` function is a light wrapper around `query_engine.query()`.

```python
response = query_rewriting_pack.run("Tell me a bout a Music celebritiy.")
```

You can also use modules individually.

```python
# use the fusion retriever
nodes = query_rewriting_pack.fusion_retriever.retrieve("query_str")

# use the vector retriever
nodes = query_rewriting_pack.vector_retriever.retrieve("query_str")

# get the query engine
query_engine = query_rewriting_pack.query_engine
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-packs-fusion-retriever",
    "maintainer": "jerryjliu",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "fusion, hybrid, query, retriever, rewriting",
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/40/42/83977f637ce266237bdf7ae36a4208a046ed2b4deb81def5b55a0126c0cb/llama_index_packs_fusion_retriever-0.4.0.tar.gz",
    "platform": null,
    "description": "# Fusion Retriever Packs\n\n## Hybrid Fusion Pack\n\nThis LlamaPack provides an example of our hybrid fusion retriever method.\n\nThis specific template fuses results from our vector retriever and bm25 retriever; of course, you can provide any template you want.\n\nCheck out the [notebook here](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/fusion_retriever/hybrid_fusion/hybrid_fusion.ipynb).\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 HybridFusionRetrieverPack --download-dir ./hybrid_fusion_pack\n```\n\nYou can then inspect the files at `./hybrid_fusion_pack` and use them as a template for your own project.\n\n### Code Usage\n\nYou can download the pack to a the `./hybrid_fusion_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nHybridFusionRetrieverPack = download_llama_pack(\n    \"HybridFusionRetrieverPack\", \"./hybrid_fusion_pack\"\n)\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./hybrid_fusion_pack`.\n\nThen, you can set up the pack like so:\n\n```python\n# create the pack\nhybrid_fusion_pack = HybridFusionRetrieverPack(\n    nodes, chunk_size=256, vector_similarity_top_k=2, bm25_similarity_top_k=2\n)\n```\n\nThe `run()` function is a light wrapper around `query_engine.query()`.\n\n```python\nresponse = hybrid_fusion_pack.run(\"Tell me about a Music celebritiy.\")\n```\n\nYou can also use modules individually.\n\n```python\n# use the fusion retriever\nnodes = hybrid_fusion_pack.fusion_retriever.retrieve(\"query_str\")\n\n# use the vector retriever\nnodes = hybrid_fusion_pack.vector_retriever.retrieve(\"query_str\")\n# use the bm25 retriever\nnodes = hybrid_fusion_pack.bm25_retriever.retrieve(\"query_str\")\n\n# get the query engine\nquery_engine = hybrid_fusion_pack.query_engine\n```\n\n## Query Rewriting Retriever Pack\n\nThis LlamaPack provides an example of query rewriting through our fusion retriever.\n\nThis specific template takes in a single retriever, and generates multiple queries against the retriever, and then fuses the results together.\n\nCheck out the [notebook here](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/fusion_retriever/query_rewrite/query_rewrite.ipynb).\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 QueryRewritingRetrieverPack --download-dir ./query_rewriting_pack\n```\n\nYou can then inspect the files at `./query_rewriting_pack` and use them as a template for your own project.\n\n### Code Usage\n\nYou can download the pack to a the `./query_rewriting_pack` directory:\n\n```python\nfrom llama_index.core.llama_pack import download_llama_pack\n\n# download and install dependencies\nQueryRewritingRetrieverPack = download_llama_pack(\n    \"QueryRewritingRetrieverPack\", \"./query_rewriting_pack\"\n)\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./query_rewriting_pack`.\n\nThen, you can set up the pack like so:\n\n```python\n# create the pack\nquery_rewriting_pack = QueryRewritingRetrieverPack(\n    nodes,\n    chunk_size=256,\n    vector_similarity_top_k=2,\n)\n```\n\nThe `run()` function is a light wrapper around `query_engine.query()`.\n\n```python\nresponse = query_rewriting_pack.run(\"Tell me a bout a Music celebritiy.\")\n```\n\nYou can also use modules individually.\n\n```python\n# use the fusion retriever\nnodes = query_rewriting_pack.fusion_retriever.retrieve(\"query_str\")\n\n# use the vector retriever\nnodes = query_rewriting_pack.vector_retriever.retrieve(\"query_str\")\n\n# get the query engine\nquery_engine = query_rewriting_pack.query_engine\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index packs fusion_retriever integration",
    "version": "0.4.0",
    "project_urls": null,
    "split_keywords": [
        "fusion",
        " hybrid",
        " query",
        " retriever",
        " rewriting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21ee3febc245e3217cb162e627fcb9a9053b224d4e2e86c5e7156a8c2abf72c4",
                "md5": "879063becc664f7c021b5404f3543bd2",
                "sha256": "b74eb326e1fe71348203b2ab1ed729cf03a1e7beb107792935c1577088ab545d"
            },
            "downloads": -1,
            "filename": "llama_index_packs_fusion_retriever-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "879063becc664f7c021b5404f3543bd2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 5134,
            "upload_time": "2024-11-18T00:55:56",
            "upload_time_iso_8601": "2024-11-18T00:55:56.798598Z",
            "url": "https://files.pythonhosted.org/packages/21/ee/3febc245e3217cb162e627fcb9a9053b224d4e2e86c5e7156a8c2abf72c4/llama_index_packs_fusion_retriever-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "404283977f637ce266237bdf7ae36a4208a046ed2b4deb81def5b55a0126c0cb",
                "md5": "a849be38e1d59ef338b73c652b95aeee",
                "sha256": "d98b30b066b780afe2278fe9a9093013dee7ddf3ccda0270dc4312bf2a231664"
            },
            "downloads": -1,
            "filename": "llama_index_packs_fusion_retriever-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a849be38e1d59ef338b73c652b95aeee",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 3612,
            "upload_time": "2024-11-18T00:55:58",
            "upload_time_iso_8601": "2024-11-18T00:55:58.280284Z",
            "url": "https://files.pythonhosted.org/packages/40/42/83977f637ce266237bdf7ae36a4208a046ed2b4deb81def5b55a0126c0cb/llama_index_packs_fusion_retriever-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-18 00:55:58",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-packs-fusion-retriever"
}
        
Elapsed time: 0.32927s