█

AI/TLDR

Invítame a un café
Invítame un café

fastRAG

El framework de investigación de Intel Labs para pipelines RAG eficientes, creado como componentes de Haystack y optimizado para hardware de Intel

RAG Frameworks & PlatformsCódigo abierto
Idioma
Python
Licencia
Apache-2.0
$pip install fastrag
EN BREVE

What is fastRAG?

fastRAG es un framework de investigación en Python de Intel Labs para crear pipelines de generación aumentada por recuperación (RAG) eficientes y optimizados. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed Apache-2.0. To get started: instalar fastRAG.

Resumen

fastRAG es un framework de investigación en Python de Intel Labs para crear pipelines de generación aumentada por recuperación (RAG) eficientes y optimizados. Está construido sobre Haystack y Hugging Face, y cada componente de fastRAG es totalmente compatible con Haystack, así que puedes armar pipelines combinando los retrievers, rankers y generadores de fastRAG con piezas estándar de Haystack, ya sea en código Python o en el formato YAML de pipelines de Haystack.

Su foco es la eficiencia de cómputo. La biblioteca incluye componentes orientados a RAG, como la recuperación con ColBERT v2 y el motor de indexación PLAID, Fusion-in-Decoder y REPLUG, que recupera varios documentos, ejecuta cada uno junto con el prompt en paralelo y combina (ensemble) las probabilidades de tokens resultantes, de modo que se pueden usar más documentos sin verse limitado por la ventana de contexto del LLM. También incluye embedders int8 optimizados y rankers cross-encoder optimizados o dispersos.

Diagram of REPLUG: a retriever fetches several documents for the test context, each document is prepended to the input and run through a black-box LM, and the output distributions are ensembled into one prediction
REPLUG runs each retrieved document with the prompt in parallel and combines the token probabilities.fastRAG components overview ↗

En la parte de generación, fastRAG puede ejecutar LLM en procesadores Intel Xeon mediante Intel Extension for PyTorch, Optimum Intel, ONNX Runtime y OpenVINO; en aceleradores Intel Gaudi mediante Optimum Habana; o con un backend de llama.cpp. Intel ha archivado el repositorio: ya no acepta parches y Intel no ofrece más mantenimiento, así que a los equipos que dependen de él se les recomienda mantener su propio fork.

Qué hace

Diagram of ColBERT late interaction: a query encoder and a document encoder produce per-token vectors, MaxSim operations match each query token to document tokens, and the results are summed into a score, with document encoding done offline
ColBERT keeps a vector per token and scores documents with MaxSim late interaction.fastRAG components overview ↗
  • Recuperación con ColBERT v2 mediante el motor PLAID a través de PLAIDDocumentStore y ColBERTRetriever, además de un IndexUpdater para añadir y eliminar documentos de un índice existente
  • Inferencia con ensamblado REPLUG (ReplugGenerator) y Fusion-in-Decoder para leer muchos documentos recuperados a la vez
  • Backends LLM optimizados para Intel: aceleradores Gaudi, modelos cuantizados en ONNX Runtime u OpenVINO, y un backend de llama.cpp
  • Embedders bi-encoder int8 optimizados y rerankers cross-encoder optimizados o dispersos
  • Componentes compatibles con Haystack, pipelines definidos en Python o en el formato YAML de Haystack, y cuadernos de ejemplo sobre PLAID, REPLUG, Gaudi, OpenVINO y compresión de prompts
  • Demos de chat con Chainlit: un chat de pipeline RAG y un agente ReAct multimodal que elige entre retrievers

Primeros pasos

fastRAG necesita Python 3.8+ y PyTorch 2.0+. Instálalo desde PyPI (preferiblemente en un entorno virtual nuevo), añade los extras para los backends que necesites y luego ejecuta las demos de Chainlit desde un clon del repositorio.

Instalar fastRAG

Instala el paquete desde PyPI, o clona el repositorio y ejecuta pip install . para la versión de código fuente.

bashbash
pip install fastrag

Añade los extras que necesites

Los extras opcionales incorporan backends optimizados para Intel, almacenes de documentos y el motor ColBERT/PLAID.

bashbash
pip install fastrag[intel]      # Intel optimized backend [Optimum-intel, IPEX]
pip install fastrag[openvino]   # Intel optimized backend using OpenVINO
pip install fastrag[qdrant]     # Support for Qdrant store
pip install fastrag[colbert]    # Support for ColBERT+PLAID; requires FAISS
pip install fastrag[faiss-cpu]  # CPU-based Faiss library

Clona el repo para configs y demos

Las configuraciones de pipelines, los cuadernos de ejemplo y las demos de Chainlit están en el repositorio, así que clónalo e instala desde el código fuente.

bashbash
git clone https://github.com/IntelLabs/fastRAG.git
cd fastRAG
pip install .

Inicia un chat sencillo

config/regular_chat.yaml carga un LLM de Hugging Face para generación de texto; ejecútalo con la app de Chainlit sin RAG.

bashbash
CONFIG=config/regular_chat.yaml chainlit run fastrag/ui/chainlit_no_rag.py
The fastRAG chat demo in Chainlit: the chatbot shows a retrieved Forrest Gump poster, the agent describes the image and answers follow-up questions, and a retrieved text document about Jenny's last name is displayed
The Chainlit chat demo answering follow-up questions from a retrieved image and a retrieved document.fastRAG demo docs ↗

Chatea con un pipeline RAG

Lanza el chat RAG con una configuración que enumere las herramientas de recuperación que el modelo de chat puede llamar, cada una respaldada por un pipeline YAML de Haystack.

bashbash
CONFIG=config/rag_pipeline_chat.yaml chainlit run fastrag/ui/chainlit_pipeline.py

Prueba el agente multimodal

La demo multimodal usa prompting ReAct para que un agente basado en LLaVA decida qué retriever llamar. La carpeta de ejemplos tiene el cuaderno correspondiente que lo construye paso a paso.

bashbash
CONFIG=config/visual_chat_agent.yaml chainlit run fastrag/ui/chainlit_multi_modal_agent.py

Commands and code are distilled from the project's own documentation — always check the repositorio oficial para lo último.

Cuándo usarlo

  • Investigar y comparar técnicas eficientes de RAG, como la recuperación con ColBERT/PLAID, Fusion-in-Decoder y REPLUG, dentro de un mismo pipeline de Haystack
  • Ejecutar pipelines RAG con LLM cuantizados en CPU Intel Xeon o en aceleradores Intel Gaudi
  • Añadir retrievers, rankers o generadores optimizados a un pipeline de Haystack existente sin reescribirlo
  • Prototipar un asistente de chat o un agente multimodal que recupere documentos e imágenes para responder preguntas
The fastRAG multi-modal ReAct agent in Chainlit reasoning in steps, choosing an imageRetriever tool and then a finishAnswer tool before replying that the image of a man on a bench is from the movie Forrest Gump
The multi-modal agent demo picks a retriever tool, observes the result and composes a final answer.fastRAG demo docs ↗

How fastRAG compares

fastRAG alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.

HerramientaEstrellasQué hace
Dify★ 162kAn open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code.
graphify★ 155kTurns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store.
RAGFlow★ 95kA RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer.
Context7★ 65.7kContext7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server.
Pathway★ 61.9kA Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes.
LightRAG★ 41kA graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates.
PageIndex★ 40.8kPageIndex turns long PDFs into a table-of-contents tree and uses LLM reasoning to retrieve relevant sections, with no vector database and no chunking.
fastRAG★ 1.8kEl framework de investigación de Intel Labs para pipelines RAG eficientes, creado como componentes de Haystack y optimizado para hardware de Intel