llama-index packs auto_merging_retriever integration
Project description
Auto Merging Retriever Pack
This LlamaPack provides an example of our auto-merging retriever.
This specific template shows the e2e process of building this. It loads a document, builds a hierarchical node graph (with bigger parent nodes and smaller child nodes).
Check out the notebook here.
CLI Usage
You can download llamapacks directly using llamaindex-cli
, which comes installed with the llama-index
python package:
llamaindex-cli download-llamapack AutoMergingRetrieverPack --download-dir ./auto_merging_retriever_pack
You can then inspect the files at ./auto_merging_retriever_pack
and use them as a template for your own project.
Code Usage
You can download the pack to a the ./auto_merging_retriever_pack
directory:
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
AutoMergingRetrieverPack = download_llama_pack(
"AutoMergingRetrieverPack", "./auto_merging_retriever_pack"
)
From here, you can use the pack, or inspect and modify the pack in ./auto_merging_retriever_pack
.
Then, you can set up the pack like so:
# create the pack
# get documents from any data loader
auto_merging_retriever_pack = AutoMergingRetrieverPack(
documents,
)
The run()
function is a light wrapper around query_engine.query()
.
response = auto_merging_retriever_pack.run(
"Tell me about what the author did growing up."
)
You can also use modules individually.
# get the node parser
node_parser = auto_merging_retriever_pack.node_parser
# get the retriever
retriever = auto_merging_retriever_pack.retriever
# get the query engine
query_engine = auto_merging_retriever_pack.query_engine
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
File details
Details for the file llama_index_packs_auto_merging_retriever-0.4.0.tar.gz
.
File metadata
- Download URL: llama_index_packs_auto_merging_retriever-0.4.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80cb293b795ab2e0cb60d2f31542d8dfc7b3d874d8e044fc071e0a593f9b329d |
|
MD5 | a8375623fc2b3e08eee2fd5a6c99795c |
|
BLAKE2b-256 | 158cd4318b6ee6d9c60cf9af6e5dd278be4334c901bcd3479516589db60769e3 |
File details
Details for the file llama_index_packs_auto_merging_retriever-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_auto_merging_retriever-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d3c3b42bf7a65abeb2b5b7af72c0b10874b7e0e0db96ae81f9f46ce317c27b6 |
|
MD5 | ccf37d7001269fca6feda26750f28854 |
|
BLAKE2b-256 | c603ed38270c10ab9d4ce970f6ed38a313ff4d7c854a0f84e0ad2070eb9e94c6 |