Skip to main content

llama-index packs query integration

Project description

RAG Fusion Pipeline Llama Pack

This LlamaPack creates the RAG Fusion Query Pipeline, which runs multiple retrievers in parallel (with varying chunk sizes), and aggregates the results in the end with reciprocal rank fusion.

You can run it out of the box, but we also encourage you to inspect the code to take a look at how our QueryPipeline syntax works. More details on query pipelines can be found here: https://docs.llamaindex.ai/en/stable/module_guides/querying/pipeline/root.html.

Check out our notebook guide as well.

CLI Usage

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

llamaindex-cli download-llamapack RAGFusionPipelinePack --download-dir ./rag_fusion_pipeline_pack

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

Code Usage

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

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
RAGFusionPipelinePack = download_llama_pack(
    "RAGFusionPipelinePack", "./rag_fusion_pipeline_pack"
)

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

Then, you can set up the pack like so:

# create the pack
pack = RAGFusionPipelinePack(docs, llm=OpenAI(model="gpt-3.5-turbo"))

The run() function is a light wrapper around query_pipeline.run(*args, **kwargs).

response = pack.run(input="What did the author do during his time in YC?")

You can also use modules individually.

# get query pipeline directly
pack.query_pipeline

# get retrievers for each chunk size
pack.retrievers

# get query engines for each chunk size
pack.query_engines

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

llama_index_packs_query-0.3.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

llama_index_packs_query-0.3.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_packs_query-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_packs_query-0.3.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0

File hashes

Hashes for llama_index_packs_query-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b2c3a088d1d00492fb8f0be6f6ae155d86596ab928554cc32ab72a4f4c3a17e4
MD5 417e8a574af255d72b3aa0f729712e94
BLAKE2b-256 85c447ff7b2dfa415a4197bc27a34bd768134e64685c7d1915ee05266c63a75d

See more details on using hashes here.

File details

Details for the file llama_index_packs_query-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_query-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 164e3d0c395fcb87230824515eefe8aa6f9979845188f721f49368c232e7eac7
MD5 544d451f24af437b009e12da86bb3e7b
BLAKE2b-256 e71a5d8cc6d3e725f2b2072ee54872861b4e5efb61cdc51b696b63c1f4ddfdc3

See more details on using hashes here.

Supported by

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