Skip to main content

llama-index packs recursive_retriever integration

Project description

Recursive Retriever Packs

Embedded Tables Retriever Pack w/ Unstructured.io

This LlamaPack provides an example of our embedded tables 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 EmbeddedTablesUnstructuredRetrieverPack --download-dir ./embedded_tables_unstructured_pack

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

Code Usage

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

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
EmbeddedTablesUnstructuredRetrieverPack = download_llama_pack(
    "EmbeddedTablesUnstructuredRetrieverPack",
    "./embedded_tables_unstructured_pack",
)

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

Then, you can set up the pack like so:

# create the pack
# get documents from any data loader
embedded_tables_unstructured_pack = EmbeddedTablesUnstructuredRetrieverPack(
    "tesla_2021_10k.htm",
)

The run() function is a light wrapper around query_engine.query().

response = embedded_tables_unstructured_pack.run(
    "What was the revenue in 2020?"
)

You can also use modules individually.

# get the node parser
node_parser = embedded_tables_unstructured_pack.node_parser

# get the retriever
retriever = embedded_tables_unstructured_pack.recursive_retriever

# get the query engine
query_engine = embedded_tables_unstructured_pack.query_engine

Recursive Retriever - Small-to-big retrieval

This LlamaPack provides an example of our recursive retriever (small-to-big).

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 RecursiveRetrieverSmallToBigPack --download-dir ./recursive_retriever_stb_pack

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

Code Usage

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

from llama_index.core.llama_pack import download_llama_pack

# download and install dependencies
RecursiveRetrieverSmallToBigPack = download_llama_pack(
    "RecursiveRetrieverSmallToBigPack", "./recursive_retriever_stb_pack"
)

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

Then, you can set up the pack like so:

# create the pack
# get documents from any data loader
recursive_retriever_stb_pack = RecursiveRetrieverSmallToBigPack(
    documents,
)

The run() function is a light wrapper around query_engine.query().

response = recursive_retriever_stb_pack.run(
    "Tell me a bout a Music celebrity."
)

You can also use modules individually.

# get the recursive retriever
recursive_retriever = recursive_retriever_stb_pack.recursive_retriever

# get the query engine
query_engine = recursive_retriever_stb_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

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

File details

Details for the file llama_index_packs_recursive_retriever-0.8.1.tar.gz.

File metadata

  • Download URL: llama_index_packs_recursive_retriever-0.8.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_recursive_retriever-0.8.1.tar.gz
Algorithm Hash digest
SHA256 431406633a8c1829526e9915f8103c4c9301027046d39c1e5a378e871b3db92e
MD5 0b738dd4c833c7745171b57c4c2d3600
BLAKE2b-256 2b8845993a224c9851102dcf55ba8e352e3d1d9b940901839484972af9b2e2e7

See more details on using hashes here.

File details

Details for the file llama_index_packs_recursive_retriever-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: llama_index_packs_recursive_retriever-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_packs_recursive_retriever-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aef436196db0fd6e50e10dd88cc7252181a4bbfb2dee79efce7a1d6517639427
MD5 86649b2d2bff2e95f8bb957444bb9ff2
BLAKE2b-256 948c33d07c4e99f4ff6e9b435f34232e907d0fd782758f6c57c87a0dcb3a8cf5

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