9 RAG Patterns in awesome-llm-apps: From Basic Vector Search to Knowledge Graphs
The awesome-llm-apps repository curates nine distinct retrieval-augmented generation (RAG) patterns—from basic vector-store retrieval to advanced Tree-of-Thought and Knowledge Graph architectures—each demonstrated through linked external projects cataloged in the central README.md.
The Shubhamsaboo/awesome-llm-apps repository serves as a comprehensive index of open-source LLM applications, with particular emphasis on RAG patterns that enhance large language models through external knowledge retrieval. Unlike traditional frameworks that provide centralized implementations, this curated collection links to individual projects demonstrating specific retrieval strategies, making it an authoritative reference for architects comparing RAG methodologies.
Foundational Retrieval Patterns
Basic Vector-Store RAG
This is the canonical implementation where queries are embedded and matched against a vector store such as Pinecone, Weaviate, or Milvus. According to the repository's README.md, representative examples include "LangChain-based RAG with Pinecone" and "LLM-Chatbot with Weaviate." The pattern typically involves initializing a retriever from the vector store and passing retrieved chunks as context to the LLM.
from langchain.vectorstores import Pinecone
from langchain.llms import OpenAI
vectorstore = Pinecone.from_existing_index(
index_name="my-index",
embedding=OpenAIEmbeddings()
)
retriever = vectorstore.as_retriever()
answer = OpenAI().call(
retriever.get_relevant_documents(query="What is RAG?")
)
Hybrid Search RAG
This pattern combines lexical BM25 scoring with semantic vector similarity to improve recall and precision. The repository highlights "Hybrid RAG with Elasticsearch + OpenAI embeddings" as a key example. By merging sparse and dense retrieval methods, this approach captures both exact keyword matches and conceptual similarities.
from elasticsearch import Elasticsearch
from langchain.retrievers import ElasticsearchRetriever
es = Elasticsearch()
retriever = ElasticsearchRetriever(
es,
index_name="docs",
search_type="hybrid"
)
docs = retriever.get_relevant_documents("Explain RAG")
Conversational RAG
This pattern maintains chat history and continuously refines retrieval queries based on dialogue context. The repository references "Chat-RAG with LangChain Memory" as an implementation example. By incorporating conversation buffer memory, the system resolves ambiguous references and maintains context across multi-turn interactions.
from langchain.memory import ConversationBufferMemory
memory = ConversationBufferMemory()
answer = chain.run(input=question, memory=memory)
Advanced Multi-Step Retrieval
Multi-hop RAG
This strategy performs a chain of retrieval steps, where the result of one retrieval informs the next query. The repository lists "Multi-hop Retrieval with LangChain Agents" as a representative project. This pattern is essential for answering complex questions that require connecting information across multiple documents.
retriever1 = vectorstore.as_retriever()
step1 = retriever1.get_relevant_documents(q1)
retriever2 = SomeOtherStore.as_retriever()
step2 = retriever2.get_relevant_documents(step1[0].page_content)
Knowledge Graph RAG
This pattern retrieves structured triples from a graph database (Neo4j, GraphDB) and injects them as context. The repository highlights "Graph-RAG for product recommendation" as an example. By leveraging entity relationships and graph traversal, this approach provides precise, structured context that vector similarity alone cannot capture.
from py2neo import Graph
graph = Graph("bolt://localhost:7687", auth=("neo4j", "pwd"))
result = graph.run(
"MATCH (n:Article {title: $title}) RETURN n",
title="RAG Patterns"
).data()
Agentic RAG Architectures
ReAct and Tool-Use RAG
This architecture treats the LLM as an agent that can invoke retrieval tools (search, database queries) repeatedly while reasoning through steps. The repository references "ReAct-style Agent for Wikipedia lookup" as a key example. By combining reasoning traces with action steps, this pattern enables dynamic, iterative information gathering.
from langchain.agents import initialize_agent, Tool
def search_tool(query):
# Retrieval implementation
pass
tools = [
Tool(
name="search",
func=search_tool,
description="Web search"
)
]
agent = initialize_agent(tools, OpenAI(), agent="react")
answer = agent.run("Who invented RAG?")
Self-Ask RAG
This pattern prompts the model to generate intermediate sub-questions, retrieve answers for each, then compose the final response. The repository lists "Self-Ask with Cohere embeddings" as a representative implementation. By explicitly decomposing complex queries, this approach improves accuracy on multi-faceted questions.
prompt = """Answer the question. If you need external info, first ask a sub-question.
Q: {q}
A:"""
Tree-of-Thought RAG
This advanced pattern explores multiple retrieval paths in a tree structure, scoring each branch before selecting the best answer. The repository highlights "Tree-of-Thought Retrieval for scholarly articles" as an example. By maintaining parallel search trajectories and evaluating them against reasoning steps, this method optimizes for comprehensive coverage of complex research queries.
candidates = []
for step in range(depth):
docs = retriever.search(query)
candidates.append(docs)
# later rank candidates and pick best answer
Prompt-Centric Approaches
Prompt-Engineering-Only RAG
This minimalist approach uses clever prompting—few-shot examples and "retrieval-augmented prompts"—without relying on an external vector store. The repository references "Prompt-only Retrieval with GPT-4" as an example. By embedding knowledge directly into the context window through sophisticated prompt design, this pattern eliminates infrastructure overhead for simple use cases.
prompt = """You are an expert. Use the following facts to answer: {facts}.
Question: {q}"""
Summary
- The awesome-llm-apps repository catalogs nine distinct RAG patterns in its
README.md, ranging from foundational vector-store retrieval to advanced agentic architectures. - Basic Vector-Store and Hybrid Search patterns provide the foundation for most production RAG systems, while Knowledge Graph and Multi-hop methods handle complex, structured queries.
- Agentic patterns including ReAct, Self-Ask, and Tree-of-Thought enable dynamic, reasoning-driven retrieval for research and analytical tasks.
- The repository functions as a curated index linking to external implementations rather than a monolithic codebase, making it a reference architecture guide for RAG practitioners.
Frequently Asked Questions
What is the difference between Basic Vector-Store RAG and Hybrid Search RAG?
Basic Vector-Store RAG relies solely on semantic similarity through dense embeddings stored in vector databases like Pinecone or Weaviate, which excels at conceptual matching but may miss exact keyword matches. Hybrid Search RAG combines these dense vector similarities with sparse lexical BM25 scoring—typically through Elasticsearch—to capture both semantic meaning and precise keyword matches, significantly improving recall on technical terminology and rare entities.
How does Multi-hop RAG differ from Agentic RAG patterns like ReAct?
Multi-hop RAG follows a predefined pipeline where the output of one retrieval step sequentially feeds into the next query formulation, creating a linear chain of retrievals to connect disparate information. In contrast, ReAct and other Agentic RAG patterns treat the LLM as an autonomous agent that decides when to retrieve information based on reasoning traces, allowing for dynamic tool selection, iterative refinement, and the ability to backtrack or explore alternative retrieval paths based on intermediate findings.
Does the awesome-llm-apps repository contain actual code implementations or just links to external projects?
The repository functions as a curated catalog rather than a monolithic codebase. The central README.md indexes external GitHub repositories, demos, and tutorials that demonstrate each RAG pattern, linking to projects like "LangChain-based RAG with Pinecone" or "Graph-RAG for product recommendation." While the repository itself does not house the implementation files, it provides the definitive reference architecture for understanding how these patterns are constructed in production environments.
Which RAG pattern is best for structured data containing complex relationships?
For structured data with complex entity relationships, Knowledge Graph RAG is the optimal choice. This pattern retrieves structured triples from graph databases like Neo4j or GraphDB, leveraging relationship traversals and entity connections that vector similarity alone cannot capture. Unlike flat vector stores that treat documents as isolated embeddings, Knowledge Graph RAG maintains the semantic structure between entities, making it ideal for product recommendations, biomedical relationships, and enterprise knowledge bases where connection topology matters as much as content similarity.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →