Advanced RAG – Composable Retrieval with LlamaIndex

Advanced RAG - Composable Retrieval with LlamaIndex

LlamaIndex is a simple and flexible data framework that connects custom data sources with large language models.

LlamaIndex provides comprehensive support for RAG.

Advanced RAG (Retrieval-Augmented Generation) techniques can be modeled using a composable hierarchical abstraction. The retrieved text can be linked to the following elements:

  • Retriever

  • Text

  • Pipeline

  • Query Engine

The retrieval of RAG can be divided into the following scenarios:

  1. Small-to-large retrieval: Retrieve small texts linked to larger texts

  2. Embedded data tables: Retrieve titles linked to underlying database tables (as text, text-to-SQL engine, etc.)

  3. Hybrid retrieval: Combine dense retrieval with sparse retrieval (e.g., bm25, vector retrieval)

  4. Multi-document agents: Set up agents for retrieval for each document, linking to those agents

  5. Hierarchical structured retrieval: Retrieve structured metadata dictionaries linked to underlying documents.

  6. Multimodal RAG: Retrieve text titles linked to underlying images

LlamaIndex has integrated these technologies into a Composable Retrieval Interface, allowing developers to easily link any retriever to any other retriever or pipeline!

To define a link, simply define an IndexNode that links to other modules.

This pattern also offers many benefits:

✅ Simplifies the writing of advanced RAG interfaces (just define IndexNode)

✅ Creates retrievers of arbitrary hierarchies

✅ Defines custom retrievers that can easily overlay on other retrievers

Advanced RAG - Composable Retrieval with LlamaIndex

How to use? Please refer to the official documentation example:

https://docs.llamaindex.ai/en/stable/examples/retrievers/composable_retrievers.html

More technical details will be shared in future updates. Stay tuned!

📝 Recommended Reading

[Preparing for Gemini] Introduction to Google Vertex AI API and LangChain Integration

Google releases the strongest model Gemini – Bard integrates with Gemini Pro, API integration interface to be released on December 13

[Privacy First] Achieve 100% localized RAG with Llama 2 + GPT4All + Chroma

[Spark API Gateway] iFLYTEK’s Xinghuo model seamlessly replaces OpenAI GPT4-Vision

Create OpenAI Assistants applications without writing a line of code – [Zero-Code Platform Flowise Practical]

[Stylish RAG] 03 Multi-document-based agents

[Stylish RAG] 02 Multimodal RAG

[Stylish RAG] 01 RAG on semi-structured data

Leave a Comment