Package: llama-index-packs-recursive-retriever
Recursive Retriever PacksEmbedded Tables Retriever Pack w/ Unstructured.ioThis 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 thenotebook here.CLI UsageYou can download llamapacks directly usingllamaindex-cli, which comes installed with thellama-indexpython package:llamaindex-clidownload-llamapackEmbeddedTablesUnstructuredRetrieverPack--download-dir./embedded_tables_unstructured_packYou can then inspect the files at./embedded_tables_unstructured_packand use them as a template for your own project.Code UsageYou can download the pack to a the./embedded_tables_unstructured_packdirectory:fromllama_index.core.llama_packimportdownload_llama_pack# download and install dependenciesEmbeddedTablesUnstructuredRetrieverPack=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 loaderembedded_tables_unstructured_pack=EmbeddedTablesUnstructuredRetrieverPack("tesla_2021_10k.htm",)Therun()function is a light wrapper aroundquery_engine.query().response=embedded_tables_unstructured_pack.run("What was the revenue in 2020?")You can also use modules individually.# get the node parsernode_parser=embedded_tables_unstructured_pack.node_parser# get the retrieverretriever=embedded_tables_unstructured_pack.recursive_retriever# get the query enginequery_engine=embedded_tables_unstructured_pack.query_engineRecursive Retriever - Small-to-big retrievalThis 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 thenotebook here.CLI UsageYou can download llamapacks directly usingllamaindex-cli, which comes installed with thellama-indexpython package:llamaindex-clidownload-llamapackRecursiveRetrieverSmallToBigPack--download-dir./recursive_retriever_stb_packYou can then inspect the files at./recursive_retriever_stb_packand use them as a template for your own project.Code UsageYou can download the pack to a the./recursive_retriever_stb_packdirectory:fromllama_index.core.llama_packimportdownload_llama_pack# download and install dependenciesRecursiveRetrieverSmallToBigPack=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 loaderrecursive_retriever_stb_pack=RecursiveRetrieverSmallToBigPack(documents,)Therun()function is a light wrapper aroundquery_engine.query().response=recursive_retriever_stb_pack.run("Tell me a bout a Music celebritiy.")You can also use modules individually.# get the recursive retrieverrecursive_retriever=recursive_retriever_stb_pack.recursive_retriever# get the query enginequery_engine=recursive_retriever_stb_pack.query_engine