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
Hashes for llama_index_packs_auto_merging_retriever-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbf191a5bc22955640625ef0f60832cca5fb1bc046493923c664041ceb2b8dd0 |
|
MD5 | 0d442fd18ef09e4b5a0169f05ed09cf7 |
|
BLAKE2b-256 | b688e40a8f1f2f55a59ae9162c95bf2ca5dc724711ad1e48698826b1397185ca |
Hashes for llama_index_packs_auto_merging_retriever-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6010cc1f553015287824bfce74925801fa60621c453fa8444e5237b42bfdc86a |
|
MD5 | dcaf696f4bcb2c56ec27a9a3287d7737 |
|
BLAKE2b-256 | c6f0cc7b39c4f3038ed8ae398b35374aa78b46b0eef8addfddde94f32d4dd14f |