Home Machine Learning Leap-start Your RAG Pipelines with Superior Retrieval LlamaPacks and Benchmark with Lighthouz AI | by Wenqi Glantz | Jan, 2024

Leap-start Your RAG Pipelines with Superior Retrieval LlamaPacks and Benchmark with Lighthouz AI | by Wenqi Glantz | Jan, 2024

0
Leap-start Your RAG Pipelines with Superior Retrieval LlamaPacks and Benchmark with Lighthouz AI | by Wenqi Glantz | Jan, 2024

[ad_1]

Exploring strong RAG growth with LlamaPacks, Lighthouz AI, and Llama Guard

Picture generated by DALL-E 3 by the writer

Because the launch in late November 2023, LlamaPacks has curated over 50 packs to assist jump-start your RAG pipeline growth. Amongst these, many superior retrieval packs emerged. On this article, let’s dive into seven superior retrieval packs; see the diagram beneath.

Picture supply: LlamaIndex X put up on seven superior retrieval LlamaPacks

We’ll carry out two steps:

  • Given a use case, we’ll generate the benchmarks utilizing Lighthouz AutoBench and consider the packs with Lighthouz Eval Studio to find out which most closely fits our use case.
  • As soon as the successful pack is recognized, we’ll add Llama Guard to the RAG pipeline, tweak its customized taxonomy, re-evaluate it with Eval Studio, and observe how the analysis rating for classes similar to immediate injection adjustments.

First, let’s take a look at these seven superior retrieval LlamaPacks to see how they work below the hood.

Hybrid Fusion

This pack ensembles the vector retrievers and BM25 (Greatest Match 25) retrievers utilizing fusion. BM25 estimates the relevance of paperwork to a given search question, serving to rank paperwork so as of probably relevance to the person’s wants.

Hybrid Fusion fuses outcomes from the vector retriever and BM25 retriever out of the field; you may present different retriever templates you need by customizing this pack.

paperwork = SimpleDirectoryReader(RAG_DIRECTORY).load_data()
node_parser = SimpleNodeParser.from_defaults()
nodes = node_parser.get_nodes_from_documents(paperwork)

# obtain and set up dependencies
HybridFusionRetrieverPack = download_llama_pack(
"HybridFusionRetrieverPack", "./hybrid_fusion_pack"
)

# create the pack
hybrid_fusion_pack = HybridFusionRetrieverPack(
nodes,
chunk_size=256,
vector_similarity_top_k=2,
bm25_similarity_top_k=2
)



[ad_2]