# RAG Pipeline Utils > Composable retrieval-augmented generation (RAG) for Node.js: grounded citations, evaluation, guardrails, hybrid retrieval and a CLI. Composable RAG for Node.js. Install with `npm install @devilsdev/rag-pipeline-utils`. The package is CommonJS and ESM with TypeScript types; classes under `@devilsdev/rag-pipeline-utils/experimental` are simulated or incomplete and not for production. ## Table of Contents - [Introduction](https://devilsdev.github.io/rag-pipeline-utils/docs/Introduction): Welcome to **@devilsdev/rag-pipeline-utils**, a modular Node.js toolkit for building Retrieval-Augmented Generation (RAG) systems. It provides comp... - [Usage Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Usage): This guide covers how to use **@devilsdev/rag-pipeline-utils** programmatically via the JavaScript/TypeScript API and through the command-line inte... - [API Reference](https://devilsdev.github.io/rag-pipeline-utils/docs/API-Reference): Reference documentation for the public API of `@devilsdev/rag-pipeline-utils`. The version selector in the navigation bar shows which release this ... - [CLI Reference](https://devilsdev.github.io/rag-pipeline-utils/docs/CLI): The `rag-pipeline` command builds a local index from your documents and answers questions against it, using the pipeline described in `.ragrc.json`... - [Connectors: providers and stores](https://devilsdev.github.io/rag-pipeline-utils/docs/Concepts-Connectors): Provider integrations for embedders, vector stores, and LLMs. Swappable, contract-validated, and isolatable from your pipeline orchestration. - [Core: pipeline and contracts](https://devilsdev.github.io/rag-pipeline-utils/docs/Concepts-Core): The pipeline orchestrator, plugin registry, and primitive contracts. The minimal surface you need to run a RAG query end-to-end. - [Evaluation and citations](https://devilsdev.github.io/rag-pipeline-utils/docs/Concepts-Evaluation): Faithfulness, relevance, citation tracking, and groundedness scoring. The pieces that turn a working pipeline into one you can trust in production. - [Guardrails](https://devilsdev.github.io/rag-pipeline-utils/docs/Concepts-Guardrails): Three-layer defense — prompt-injection detection pre-retrieval, relevance gating during retrieval, PII and groundedness checks post-generation. - [Evaluation Framework](https://devilsdev.github.io/rag-pipeline-utils/docs/Evaluation): **@devilsdev/rag-pipeline-utils** ships a set of lexical evaluation metrics for RAG output: answer-level scores (BLEU, ROUGE), grounding metrics (f... - [Plugin Development Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Plugins): Every stage of a **@devilsdev/rag-pipeline-utils** pipeline is a plugin: a plain object or class instance with the method(s) its stage requires. Th... - [Code Examples](https://devilsdev.github.io/rag-pipeline-utils/docs/Examples): Examples of common RAG Pipeline Utils use cases. They use the package's real exports; replace the provider connectors with the ones you use. - [Real-World Use Cases](https://devilsdev.github.io/rag-pipeline-utils/docs/Use-Cases): This project goes beyond traditional RAG tools — it’s a **developer-focused modular framework**. Here's how it’s used: - [Security Capabilities](https://devilsdev.github.io/rag-pipeline-utils/docs/Security-Capabilities): An honest matrix of what's implemented and battle-tested vs. what's recommended practice vs. what ships as example code requiring further hardening. - [Security Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Security): This comprehensive security guide covers best practices, threat mitigation, and security configurations for **@devilsdev/rag-pipeline-utils**. From... - [Experimental modules](https://devilsdev.github.io/rag-pipeline-utils/docs/Experimental): Some classes in this package are simulations or are incomplete. They now live in a separate entry point so you can tell them apart from the support... - [Migration Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Migration): This guide helps you upgrade between versions of **@devilsdev/rag-pipeline-utils** and move from other RAG frameworks. The full list of changes in ... - [Troubleshooting Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Troubleshooting): This comprehensive troubleshooting guide helps you diagnose and resolve common issues with **@devilsdev/rag-pipeline-utils**. From installation pro... - [FAQ](https://devilsdev.github.io/rag-pipeline-utils/docs/FAQ): Yes. Write a retriever plugin that implements `store(docs)` and `retrieve({ query, queryVector, topK, signal })`, then either pass an instance to... - [Architecture](https://devilsdev.github.io/rag-pipeline-utils/docs/Architecture): This guide outlines the internal architecture of @devilsdev/rag-pipeline-utils: the pipeline factory, the plugin contracts and registry, the guardr... - [Benchmarks & Methodology](https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks): How we measure performance, how you reproduce the numbers, and how to benchmark your own end-to-end RAG pipeline honestly. - [Caching](https://devilsdev.github.io/rag-pipeline-utils/docs/Caching): Cache query embeddings, retrieval results and answers in memory or Redis, with invalidation when your index, embedder or model changes. - [Changelog](https://devilsdev.github.io/rag-pipeline-utils/docs/Changelog): Every release of @devilsdev/rag-pipeline-utils, from CHANGELOG.md in the repository. - [Comparison vs Other Frameworks](https://devilsdev.github.io/rag-pipeline-utils/docs/Comparison): Honest, up-to-date comparison of @devilsdev/rag-pipeline-utils against LangChain.js and LlamaIndex.TS — including where we lose. - [AWS Deployment Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Deployment-AWS): Deploy RAG Pipeline Utils on AWS using ECS, EKS, or Lambda with production-grade configurations, auto-scaling, and AWS service integrations. - [Azure Deployment Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Deployment-Azure): Deploy RAG Pipeline Utils on Microsoft Azure using Container Instances, AKS, or Azure Functions with enterprise-grade security and monitoring. - [Docker Deployment Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Deployment-Docker): Deploy RAG Pipeline Utils in production using Docker containers with optimized configurations, security best practices, and scalability patterns. - [GCP Deployment Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Deployment-GCP): Deploy RAG Pipeline Utils on Google Cloud Platform using Cloud Run, GKE, or Cloud Functions with enterprise-grade scalability and monitoring. - [Kubernetes Deployment Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Deployment-Kubernetes): Deploy RAG Pipeline Utils on Kubernetes with production-grade configurations, Helm charts, auto-scaling, and comprehensive monitoring. - [Enterprise Features](https://devilsdev.github.io/rag-pipeline-utils/docs/Enterprise): > **Experimental:** SSO (SAML/OAuth2/OIDC/Active Directory), multi-tenancy, data governance, model training, federated learning, multimodal process... - [Use with other frameworks](https://devilsdev.github.io/rag-pipeline-utils/docs/Integrations): Use the Vercel AI SDK as an embedder and LLM, and check answers from LangChain, LlamaIndex, Mastra or your own code for citations and groundedness. - [Observability & Monitoring](https://devilsdev.github.io/rag-pipeline-utils/docs/Observability): **@devilsdev/rag-pipeline-utils** ships small, dependency-free observability helpers: a structured logger, in-process metrics primitives, an execut... - [Performance Optimization Guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Performance): This guide covers the performance controls that **@devilsdev/rag-pipeline-utils** actually provides: per-run timeouts and cancellation, batched and... - [Testing your RAG code](https://devilsdev.github.io/rag-pipeline-utils/docs/Testing): Deterministic, offline test helpers from @devilsdev/rag-pipeline-utils/testing - a hash embedder, an echo LLM, fixtures and a ready test pipeline. - [Tutorials & Onboarding](https://devilsdev.github.io/rag-pipeline-utils/docs/Tutorials): Welcome to the **RAG Pipeline Utils** tutorial section. These guides will help developers quickly onboard, integrate, and extend the modular RAG sy... - [Introduction](https://devilsdev.github.io/rag-pipeline-utils/docs/intro): Welcome to RAG Pipeline Utils! This is the starting point for your documentation.