Skip to main content

Packages

@devilsdev/rag-pipeline-utils is made of four packages. Install the full package for everything, or only the parts you use:

PackageWhat it hasInstalls
@devilsdev/rag-corecreateRagPipeline, MemoryRetriever, hybrid search, the rerankers, caches, CostCalculator, CostTracker, createModelRouterajv, pino
@devilsdev/rag-connectorsOpenAIConnector, AnthropicConnector, CohereConnector, OllamaConnector, LocalEmbedder, QdrantRetriever, PgVectorRetriever, createAiSdkAdapterrag-core, axios
@devilsdev/rag-evalThe evaluation metrics, datasets and reports, evaluateRagDataset, checkAnswer, CitationTracker, hallucination detectionrag-core
@devilsdev/rag-guardrailsdetectInjection, GuardrailsPipeline and the pre-retrieval, retrieval and post-generation guardsrag-core

Evaluating answers from another framework needs only rag-eval, about 6 MB installed. All four together are about 10 MB. The full package, at about 33 MB, adds the document loaders, .ragrc.json configuration, the CLI and the rest.

npm install @devilsdev/rag-eval
const { computeFaithfulness, checkAnswer } = require("@devilsdev/rag-eval");
npm install @devilsdev/rag-core @devilsdev/rag-connectors
const { createRagPipeline, MemoryRetriever } = require("@devilsdev/rag-core");
const {
AnthropicConnector,
LocalEmbedder,
} = require("@devilsdev/rag-connectors");

How they fit together​

  • The same objects. The full package re-exports the four packages, and they share one copy of rag-core. require("@devilsdev/rag-pipeline-utils").CitationTracker is require("@devilsdev/rag-eval").CitationTracker. You can mix imports from the full package and the scoped ones, and instanceof works across them.
  • One version. All five packages release together with the same version number. Keep them on the same version, since each depends on the others at exactly that version.
  • Types. Each package has TypeScript declarations. rag-core carries the shared ones (PipelineRunResult, RetrieverPlugin and the rest) at @devilsdev/rag-core/all-types.
  • Only in the full package: the CLI, document loaders, loadRagConfig and the plugin registry, FileVectorStore, the /edge, /testing and /experimental entries, and the development, enterprise and dashboard tools.