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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_packs_auto_merging_retriever-0.5.0.tar.gz.
File metadata
- Download URL: llama_index_packs_auto_merging_retriever-0.5.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab6fafd3b5fcd1b3d4eed89d43afce3786bc51dffd98faad155f7043ed2e7ed4
|
|
| MD5 |
792fbb1a2a63931a56b9cf4ab8d7c330
|
|
| BLAKE2b-256 |
4931d7a79a6e700189436e7ed22af9df380ea9f79b4aeacc4c079555a397c053
|
File details
Details for the file llama_index_packs_auto_merging_retriever-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_packs_auto_merging_retriever-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58907f50c1d3efefe9ba1c2b69feb5a908be90460c267348b4733baec1d0993c
|
|
| MD5 |
646231321c9faf3d409a94f016b09500
|
|
| BLAKE2b-256 |
cc96ba93ad07227e99dbe1fd37ec09a339c528a84163245b3e3708631d2987d3
|