Packages
@devilsdev/rag-pipeline-utils is made of four packages. Install the full package for everything, or only the parts you use:
| Package | What it has | Installs |
|---|---|---|
@devilsdev/rag-core | createRagPipeline, MemoryRetriever, hybrid search, the rerankers, caches, CostCalculator, CostTracker, createModelRouter | ajv, pino |
@devilsdev/rag-connectors | OpenAIConnector, AnthropicConnector, CohereConnector, OllamaConnector, LocalEmbedder, QdrantRetriever, PgVectorRetriever, createAiSdkAdapter | rag-core, axios |
@devilsdev/rag-eval | The evaluation metrics, datasets and reports, evaluateRagDataset, checkAnswer, CitationTracker, hallucination detection | rag-core |
@devilsdev/rag-guardrails | detectInjection, GuardrailsPipeline and the pre-retrieval, retrieval and post-generation guards | rag-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").CitationTrackerisrequire("@devilsdev/rag-eval").CitationTracker. You can mix imports from the full package and the scoped ones, andinstanceofworks 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-corecarries the shared ones (PipelineRunResult,RetrieverPluginand the rest) at@devilsdev/rag-core/all-types. - Only in the full package: the CLI, document loaders,
loadRagConfigand the plugin registry,FileVectorStore, the/edge,/testingand/experimentalentries, and the development, enterprise and dashboard tools.