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.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

llama_index_packs_query-0.3.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_packs_query-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5b3ee6b6bde2d51dc29f12f7a3c7b6c44acf759fe2ec84dfaddde01115a83f85
MD5 ae772c2ac26cf4092e51e7dd03fdf096
BLAKE2b-256 0d94f11935b4a44a0ed776d6c9ae9f2d77c674dcd7643f91b1df124a94ec1fb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_packs_query-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9f0e3dd6b04aec44afb832469de4125d0a0c1e2daf3d4e06b5998b199451eb
MD5 b98c97aae12ff740cfca937a40ca2fab
BLAKE2b-256 03dcc07c658e847d981a666ea24ef87afe589acc99ebb56a68d8567ce6edf328

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