Framework

LlamaIndex

RAG-first: retrieval primitives, query engines, eval.

8 patterns supported.

Patterns this framework supports natively

  • Agentic RAGReplace static retrieve-then-generate with autonomous agents that plan, choose sources, retrieve iteratively, reflect, and re-query.
  • Naive RAGCondition the generator on top-k chunks retrieved from an external dense index so knowledge lives outside parameters.
  • Hybrid SearchCombine sparse lexical retrieval (BM25) with dense vector retrieval and fuse the results.
  • Cross-Encoder RerankingAfter cheap bi-encoder or BM25 retrieval, rescore top-N candidates with a cross-encoder that jointly attends over (query, candidate).
  • Contextual RetrievalPrepend a short LLM-generated description to each chunk before embedding so the chunk carries its situating context.
  • HyDEHave the LLM write a hypothetical answer document, embed it, and use it as the retrieval query.
  • Citation StreamingStream citations alongside generated text so the UI can render source links in place as content appears.
  • Eval HarnessRun a held-out dataset against agent versions to detect regressions and measure improvement.