@devilsdev/rag-pipeline-utils 2.4.5 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ragrc.schema.json +83 -192
- package/CHANGELOG.md +345 -0
- package/README.md +418 -117
- package/SECURITY.md +5 -5
- package/dist/experimental.cjs +2 -0
- package/dist/experimental.d.ts +1 -0
- package/dist/experimental.mjs +5 -0
- package/dist/index.cjs +4992 -1242
- package/dist/index.d.ts +80 -2
- package/dist/index.mjs +1 -1
- package/dist/types/agentic/agentic-pipeline.d.ts +103 -0
- package/dist/types/agentic/iterative-retriever.d.ts +85 -0
- package/dist/types/agentic/query-planner.d.ts +145 -0
- package/dist/types/agentic/self-critique.d.ts +45 -0
- package/dist/types/ai/adaptive-retrieval.d.ts +44 -0
- package/dist/types/ai/federation/federated-learning-coordinator.d.ts +62 -0
- package/dist/types/ai/multimodal-processing.d.ts +32 -0
- package/dist/types/ai/multimodal.d.ts +39 -0
- package/dist/types/ai/retrieval-engine.d.ts +37 -0
- package/dist/types/ai/training/model-training-orchestrator.d.ts +31 -0
- package/dist/types/chunking/chunking-engine.d.ts +70 -0
- package/dist/types/chunking/strategies/fixed-size.d.ts +17 -0
- package/dist/types/chunking/strategies/recursive.d.ts +20 -0
- package/dist/types/chunking/strategies/semantic.d.ts +19 -0
- package/dist/types/chunking/strategies/sentence.d.ts +13 -0
- package/dist/types/chunking/strategies/structure-aware.d.ts +19 -0
- package/dist/types/citation/citation-tracker.d.ts +64 -0
- package/dist/types/citation/hallucination-detector.d.ts +40 -0
- package/dist/types/citation/source-mapper.d.ts +37 -0
- package/dist/types/connectors/anthropic-connector.d.ts +92 -0
- package/dist/types/connectors/base-connector.d.ts +87 -0
- package/dist/types/connectors/cohere-connector.d.ts +89 -0
- package/dist/types/connectors/connector-utils.d.ts +110 -0
- package/dist/types/connectors/local-embedder.d.ts +86 -0
- package/dist/types/connectors/memory-retriever.d.ts +91 -0
- package/dist/types/connectors/ollama-connector.d.ts +110 -0
- package/dist/types/connectors/openai-connector.d.ts +114 -0
- package/dist/types/connectors/rag-prompt.d.ts +40 -0
- package/dist/types/cost/cost-calculator.d.ts +152 -0
- package/dist/types/cost/cost-tracker.d.ts +126 -0
- package/dist/types/cost/token-budget.d.ts +110 -0
- package/dist/types/dag/core/error-context.d.ts +239 -0
- package/dist/types/dag/core/execution-scheduler.d.ts +191 -0
- package/dist/types/dag/core/topology-validation.d.ts +226 -0
- package/dist/types/dag/dag-engine.d.ts +156 -0
- package/dist/types/dag/dag-node.d.ts +37 -0
- package/dist/types/dashboard/dashboard-generator.d.ts +127 -0
- package/dist/types/dashboard/metrics-aggregator.d.ts +218 -0
- package/dist/types/debug/execution-tracer.d.ts +57 -0
- package/dist/types/debug/trace-inspector.d.ts +31 -0
- package/dist/types/ecosystem/plugin-certification.d.ts +169 -0
- package/dist/types/enterprise/data-governance.d.ts +203 -0
- package/dist/types/enterprise/multi-tenancy.d.ts +137 -0
- package/dist/types/enterprise/sso-integration.d.ts +420 -0
- package/dist/types/evaluate/context-metrics.d.ts +55 -0
- package/dist/types/evaluate/faithfulness.d.ts +41 -0
- package/dist/types/evaluate/groundedness.d.ts +60 -0
- package/dist/types/evaluate/pipeline-evaluator.d.ts +88 -0
- package/dist/types/evaluate/relevance.d.ts +21 -0
- package/dist/types/evaluate/scoring.d.ts +123 -0
- package/dist/types/experimental.d.ts +15 -0
- package/dist/types/graph/entity-extractor.d.ts +84 -0
- package/dist/types/graph/graph-index.d.ts +49 -0
- package/dist/types/graph/graph-retriever.d.ts +81 -0
- package/dist/types/graph/knowledge-graph.d.ts +129 -0
- package/dist/types/guardrails/guardrails-pipeline.d.ts +63 -0
- package/dist/types/guardrails/injection-detector.d.ts +47 -0
- package/dist/types/guardrails/post-generation-guard.d.ts +61 -0
- package/dist/types/guardrails/pre-retrieval-guard.d.ts +64 -0
- package/dist/types/guardrails/retrieval-guard.d.ts +57 -0
- package/dist/types/mcp/mcp-server.d.ts +85 -0
- package/dist/types/mcp/mcp-tool-builder.d.ts +55 -0
- package/dist/types/reranker/cascade-reranker.d.ts +40 -0
- package/dist/types/reranker/embedding-reranker.d.ts +77 -0
- package/dist/types/reranker/scoring-reranker.d.ts +41 -0
- package/dist/types/retrieval/bm25-search.d.ts +43 -0
- package/dist/types/retrieval/file-vector-store.d.ts +87 -0
- package/dist/types/retrieval/hybrid-retriever.d.ts +35 -0
- package/dist/types/retrieval/rank-fusion.d.ts +10 -0
- package/dist/types/security/jwt-config.d.ts +80 -0
- package/dist/types/security/jwt-validator.d.ts +195 -0
- package/dist/types/security/plugin-sandbox.d.ts +158 -0
- package/dist/types/security/plugin-signature-verifier.d.ts +139 -0
- package/dist/types/security/validator.d.ts +5 -0
- package/dist/types/streaming/embedding-stream.d.ts +65 -0
- package/dist/types/streaming/sse-adapter.d.ts +59 -0
- package/dist/types/streaming/stream-router.d.ts +88 -0
- package/dist/types/streaming/streaming-embedder.d.ts +99 -0
- package/dist/types/streaming/websocket-adapter.d.ts +71 -0
- package/dist/types/templates/scaffold.d.ts +55 -0
- package/dist/types/templates/template-registry.d.ts +63 -0
- package/dist/types/utils/embed-query.d.ts +20 -0
- package/dist/types/utils/logger.d.ts +50 -0
- package/dist/types/utils/rate-limiter.d.ts +66 -0
- package/dist/types/utils/retry.d.ts +27 -0
- package/dist/types/utils/run-abort.d.ts +34 -0
- package/dist/types/utils/secure-logging.d.ts +51 -0
- package/dist/types/utils/structured-logger.d.ts +126 -0
- package/package.json +53 -29
- package/src/agentic/agentic-pipeline.js +75 -7
- package/src/agentic/iterative-retriever.js +47 -10
- package/src/agentic/query-planner.js +329 -78
- package/src/citation/citation-tracker.js +6 -4
- package/src/citation/hallucination-detector.js +2 -2
- package/src/citation/source-mapper.js +15 -28
- package/src/cli/commands/ai.js +101 -0
- package/src/cli/commands/plugin-hub/event-handlers.js +6 -0
- package/src/cli/commands/plugin-hub/hub-commands.js +0 -74
- package/src/cli/commands/plugin-hub/local-commands.js +143 -0
- package/src/cli/commands/plugin-hub.js +96 -36
- package/src/cli/diagnostics/config-checker.js +76 -63
- package/src/cli/diagnostics/environment-checker.js +62 -31
- package/src/cli/diagnostics/plugin-checker.js +36 -89
- package/src/cli/doctor-command.js +39 -5
- package/src/cli/enhanced-cli-commands.js +72 -217
- package/src/cli/handlers/ai-handler.js +364 -0
- package/src/cli/handlers/diagnostics-handler.js +78 -31
- package/src/cli/handlers/ingest-handler.js +28 -22
- package/src/cli/handlers/init-handler.js +148 -25
- package/src/cli/handlers/query-handler.js +41 -26
- package/src/cli/handlers/run-handler.js +16 -167
- package/src/cli/handlers/serve-handler.js +60 -0
- package/src/cli/services/bench-stats.js +54 -0
- package/src/cli/services/benchmark.js +161 -0
- package/src/cli/services/feedback.js +155 -0
- package/src/cli/services/rag-service.js +322 -0
- package/src/cli/shared/cli-utils.js +24 -7
- package/src/cli/shared/config-context.js +21 -0
- package/src/cli/wizard/config-builder.js +81 -0
- package/src/cli/wizard/init-wizard.js +617 -0
- package/src/config/component-factory.js +125 -0
- package/src/config/load-config.js +29 -10
- package/src/config/load-plugin-config.js +46 -2
- package/src/connectors/anthropic-connector.js +93 -55
- package/src/connectors/base-connector.js +74 -19
- package/src/connectors/cohere-connector.js +88 -32
- package/src/connectors/connector-utils.js +302 -0
- package/src/connectors/local-embedder.js +43 -5
- package/src/connectors/memory-retriever.js +108 -15
- package/src/connectors/ollama-connector.js +83 -49
- package/src/connectors/openai-connector.js +108 -44
- package/src/connectors/rag-prompt.js +88 -0
- package/src/core/create-pipeline.js +209 -60
- package/src/core/plugin-registry.js +87 -11
- package/src/cost/cost-calculator.js +205 -32
- package/src/dev/dev-server.js +166 -11
- package/src/dev/hot-reload.js +40 -1
- package/src/ecosystem/plugin-checks.js +181 -0
- package/src/ecosystem/plugin-hub.js +50 -125
- package/src/ecosystem/plugin-installer.js +298 -0
- package/src/ecosystem/plugin-probe.js +127 -0
- package/src/ecosystem/plugin-scanner.js +185 -0
- package/src/ecosystem/tar-extract.js +114 -0
- package/src/enterprise/audit-logging.js +158 -29
- package/src/enterprise/sso-integration.js +715 -228
- package/src/evaluate/context-metrics.js +28 -16
- package/src/evaluate/evaluator.js +3 -3
- package/src/evaluate/faithfulness.js +18 -14
- package/src/evaluate/groundedness.js +43 -12
- package/src/evaluate/pipeline-evaluator.js +35 -8
- package/src/evaluate/scoring.js +251 -3
- package/src/experimental.js +71 -0
- package/src/guardrails/guardrails-pipeline.js +69 -7
- package/src/guardrails/injection-detector.js +283 -0
- package/src/guardrails/post-generation-guard.js +19 -0
- package/src/guardrails/pre-retrieval-guard.js +36 -36
- package/src/guardrails/retrieval-guard.js +58 -8
- package/src/index.js +36 -1
- package/src/loader/document-reader.js +91 -0
- package/src/reranker/cascade-reranker.js +3 -0
- package/src/reranker/embedding-reranker.js +136 -21
- package/src/reranker/llm-reranker.js +79 -12
- package/src/reranker/scoring-reranker.js +3 -0
- package/src/retrieval/bm25-search.js +12 -6
- package/src/retrieval/file-vector-store.js +212 -0
- package/src/retrieval/hybrid-retriever.js +22 -19
- package/src/security/jwt-config.js +13 -2
- package/src/security/jwt-validator.js +134 -30
- package/src/security/plugin-sandbox.js +18 -1
- package/src/security/plugin-signature-verifier.js +245 -70
- package/src/utils/deprecate.js +69 -0
- package/src/utils/embed-query.js +33 -0
- package/src/utils/input-sanitizer.js +19 -4
- package/src/utils/logger.js +34 -4
- package/src/utils/run-abort.js +102 -0
- package/src/ai/federated-learning.js +0 -211
- package/src/ai/federation.js +0 -71
- package/src/ai/index.js +0 -22
- package/src/ai/model-trainer.js +0 -217
- package/src/ai/model-training.js +0 -202
- package/src/ai/multimodal/multi-modal-processor.js +0 -345
- package/src/ai/orchestrator.js +0 -65
- package/src/ai/retrieval/adaptive-retrieval-engine.js +0 -398
- package/src/cli/commands/ai-ml/adaptive-commands.js +0 -178
- package/src/cli/commands/ai-ml/federated-commands.js +0 -207
- package/src/cli/commands/ai-ml/index.js +0 -17
- package/src/cli/commands/ai-ml/multimodal-commands.js +0 -187
- package/src/cli/commands/ai-ml/shared.js +0 -51
- package/src/cli/commands/ai-ml/training-commands.js +0 -228
- package/src/cli/commands/ai-ml.js +0 -386
- package/src/cli/commands/docs.js +0 -228
- package/src/cli/commands/dx.js +0 -538
- package/src/cli/commands/wizard.js +0 -627
- package/src/cli/input-sanitization-middleware.js +0 -356
- package/src/cli/interactive-wizard.js +0 -373
- package/src/cli/templates/development.template.json +0 -64
- package/src/cli/templates/minimal.template.json +0 -33
- package/src/cli/templates/production.template.json +0 -104
- package/src/cli/templates/testing.template.json +0 -45
- package/src/cli/wizard/configuration.js +0 -148
- package/src/cli/wizard/observability.js +0 -79
- package/src/cli/wizard/performance.js +0 -76
- package/src/cli/wizard/plugin-selection.js +0 -297
- package/src/cli/wizard/preview-save.js +0 -172
- package/src/cli/wizard/project-setup.js +0 -66
- package/src/core/pipeline-factory.js +0 -59
- package/src/dag/enhanced-dag-engine.js +0 -894
- package/src/dx/index.js +0 -40
- package/src/dx/integration-templates.js +0 -662
- package/src/dx/performance-profiler.js +0 -968
- package/src/dx/realtime-debugger.js +0 -755
- package/src/dx/visual-pipeline-builder.js +0 -578
- package/src/ingest.js +0 -59
- package/src/pipeline/pipeline.js +0 -18
- package/src/query.js +0 -117
package/README.md
CHANGED
|
@@ -1,14 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://cdn.jsdelivr.net/gh/DevilsDev/rag-pipeline-utils@main/assets/banner.svg" alt="rag-pipeline-utils: composable RAG for Node.js with grounded citations, evaluation, guardrails and a working CLI" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils"><img src="https://img.shields.io/npm/v/@devilsdev/rag-pipeline-utils.svg" alt="npm version"></a>
|
|
7
|
+
<a href="https://github.com/DevilsDev/rag-pipeline-utils/actions/workflows/ci.yml"><img src="https://github.com/DevilsDev/rag-pipeline-utils/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils"><img src="https://img.shields.io/npm/dm/@devilsdev/rag-pipeline-utils.svg" alt="Downloads"></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils"><img src="https://img.shields.io/npm/types/@devilsdev/rag-pipeline-utils.svg" alt="TypeScript types"></a>
|
|
10
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/@devilsdev/rag-pipeline-utils.svg" alt="Node.js version"></a>
|
|
11
|
+
<a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="#quick-start">Quick start</a> ·
|
|
16
|
+
<a href="#use-cases">Use cases</a> ·
|
|
17
|
+
<a href="#how-it-compares">How it compares</a> ·
|
|
18
|
+
<a href="https://devilsdev.github.io/rag-pipeline-utils/">Documentation</a> ·
|
|
19
|
+
<a href="https://github.com/DevilsDev/rag-pipeline-utils/tree/main/examples">Examples</a>
|
|
20
|
+
</p>
|
|
4
21
|
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils)
|
|
7
|
-
[](https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils)
|
|
8
|
-
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
[](https://nodejs.org/)
|
|
22
|
+
# rag-pipeline-utils
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
`rag-pipeline-utils` gives you the building blocks of a RAG system as small, replaceable parts: an embedder, a retriever, an optional reranker and an LLM, wired together by one `createRagPipeline()` call. Evaluation, per-sentence citations, guardrails and agentic retrieval are opt-in layers on top. Every part follows a plain JavaScript contract, so you can swap a built-in connector for your own code without touching the rest.
|
|
25
|
+
|
|
26
|
+
- **Grounded by default.** Answers come back with the passages they were built from, sentence-level citations and a groundedness score, including a check that numbers in the answer appear in the sources.
|
|
27
|
+
- **Provider-neutral.** OpenAI, Anthropic, Cohere and Ollama connectors are built in, plus an offline TF-IDF embedder. Anything with an `embed()` or `generate()` method works too.
|
|
28
|
+
- **Production behaviour.** AbortSignal cancellation and timeouts, retries only on transient errors, ACL filtering before generation, PII redaction, typed exports for ESM, CommonJS and TypeScript.
|
|
29
|
+
- **A CLI that does real work.** `init`, `ingest`, `query` and `serve` run against a persistent local index, fully offline if you want.
|
|
30
|
+
|
|
31
|
+
## Contents
|
|
32
|
+
|
|
33
|
+
- [Installation](#installation)
|
|
34
|
+
- [Quick start](#quick-start)
|
|
35
|
+
- [Command line](#command-line)
|
|
36
|
+
- [Use cases](#use-cases)
|
|
37
|
+
- [How it works](#how-it-works)
|
|
38
|
+
- [Capabilities](#capabilities)
|
|
39
|
+
- [How it compares](#how-it-compares)
|
|
40
|
+
- [Connectors and plugins](#connectors-and-plugins)
|
|
41
|
+
- [Experimental modules](#experimental-modules)
|
|
42
|
+
- [Compatibility](#compatibility)
|
|
43
|
+
- [Documentation](#documentation)
|
|
44
|
+
- [Security](#security)
|
|
45
|
+
- [Contributing](#contributing)
|
|
12
46
|
|
|
13
47
|
## Installation
|
|
14
48
|
|
|
@@ -16,169 +50,436 @@ Start small with three core primitives — **pipeline**, **plugin**, **connector
|
|
|
16
50
|
npm install @devilsdev/rag-pipeline-utils
|
|
17
51
|
```
|
|
18
52
|
|
|
19
|
-
|
|
53
|
+
Requires Node.js 18 or later. The package ships CommonJS, ESM and TypeScript declarations.
|
|
20
54
|
|
|
21
|
-
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
This example runs offline: it uses the built-in TF-IDF embedder and an in-memory vector store.
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import {
|
|
61
|
+
createRagPipeline,
|
|
62
|
+
LocalEmbedder,
|
|
63
|
+
MemoryRetriever,
|
|
64
|
+
} from "@devilsdev/rag-pipeline-utils";
|
|
65
|
+
|
|
66
|
+
const docs = [
|
|
67
|
+
{
|
|
68
|
+
id: "vacation",
|
|
69
|
+
content:
|
|
70
|
+
"Full-time employees receive twenty days of paid vacation per year.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "remote",
|
|
74
|
+
content: "Remote work is allowed two days per week with manager approval.",
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
// 1. Fit the embedder to your corpus and index the documents.
|
|
79
|
+
const embedder = new LocalEmbedder();
|
|
80
|
+
embedder.train(docs.map((doc) => doc.content));
|
|
81
|
+
|
|
82
|
+
const retriever = new MemoryRetriever();
|
|
83
|
+
await retriever.store(
|
|
84
|
+
docs.map((doc) => ({ ...doc, vector: embedder.embed(doc.content) })),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
// 2. Build the pipeline and ask a question.
|
|
88
|
+
const pipeline = createRagPipeline({ embedder, retriever });
|
|
89
|
+
const result = await pipeline.run({
|
|
90
|
+
query: "How many vacation days do I get?",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
console.log(result.results[0].id); // "vacation"
|
|
94
|
+
console.log(result.answer); // null: no LLM configured, so retrieval only
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
To generate answers, add an LLM. The same connector can also embed:
|
|
98
|
+
|
|
99
|
+
```js
|
|
22
100
|
import {
|
|
23
101
|
createRagPipeline,
|
|
24
102
|
OpenAIConnector,
|
|
25
103
|
MemoryRetriever,
|
|
26
104
|
} from "@devilsdev/rag-pipeline-utils";
|
|
27
105
|
|
|
106
|
+
const openai = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
107
|
+
|
|
108
|
+
const retriever = new MemoryRetriever();
|
|
109
|
+
const policy =
|
|
110
|
+
"Full-time employees receive twenty days of paid vacation per year.";
|
|
111
|
+
await retriever.store([
|
|
112
|
+
{ id: "vacation", content: policy, vector: await openai.embed(policy) },
|
|
113
|
+
]);
|
|
114
|
+
|
|
28
115
|
const pipeline = createRagPipeline({
|
|
29
|
-
|
|
30
|
-
|
|
116
|
+
embedder: openai,
|
|
117
|
+
retriever,
|
|
118
|
+
llm: openai,
|
|
31
119
|
});
|
|
32
|
-
|
|
33
120
|
const result = await pipeline.run({
|
|
34
|
-
query: "
|
|
121
|
+
query: "How many vacation days do I get?",
|
|
35
122
|
options: { citations: true, evaluate: true },
|
|
36
123
|
});
|
|
37
124
|
|
|
38
|
-
console.log(result.
|
|
39
|
-
console.log(result.citations.groundednessScore); // 0
|
|
40
|
-
console.log(result.evaluation.scores); // { faithfulness, relevance,
|
|
125
|
+
console.log(result.answer);
|
|
126
|
+
console.log(result.citations.groundednessScore); // 0..1, share of grounded sentences
|
|
127
|
+
console.log(result.evaluation.scores); // { faithfulness, relevance, contextPrecision, groundedness }
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Command line
|
|
131
|
+
|
|
132
|
+
The `rag-pipeline` CLI builds a local index from your files and answers questions against it.
|
|
133
|
+
|
|
134
|
+
<p align="center">
|
|
135
|
+
<img src="https://cdn.jsdelivr.net/gh/DevilsDev/rag-pipeline-utils@main/assets/demo.gif" alt="Terminal recording: rag-pipeline init, ingest ./docs, then a query that returns the vacation policy as the top passage" width="720">
|
|
136
|
+
</p>
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx rag-pipeline init # writes .ragrc.json (interactive in a terminal)
|
|
140
|
+
npx rag-pipeline ingest ./docs # indexes .md, .html, .csv and .txt files
|
|
141
|
+
npx rag-pipeline query "What is the remote work policy?"
|
|
142
|
+
npx rag-pipeline serve --port 3000 # local HTTP API: GET /health, POST /query
|
|
143
|
+
npx rag-pipeline doctor # checks config, API keys, plugins and the index
|
|
41
144
|
```
|
|
42
145
|
|
|
43
|
-
|
|
146
|
+
The default `local` template needs no API keys. Use `init --template openai`, `anthropic` or `ollama` to generate answers with a model. Other commands include `validate`, `hub install` for plugins and `ai benchmark` for measured latency. See the [CLI reference](https://devilsdev.github.io/rag-pipeline-utils/docs/CLI).
|
|
44
147
|
|
|
45
|
-
##
|
|
148
|
+
## Use cases
|
|
46
149
|
|
|
47
|
-
|
|
150
|
+
### Answer questions with sources your users can check
|
|
48
151
|
|
|
49
|
-
|
|
50
|
-
- **Modular architecture** that doesn't lock them into a single provider
|
|
51
|
-
- **Operational discipline** — tracing, metrics, cost controls, guardrails
|
|
52
|
-
- **A stable foundation** with clear plugin contracts that outlast any vendor
|
|
152
|
+
Citations map every sentence of the answer to the passages that support it. A sentence whose facts or numbers are missing from the sources is reported as ungrounded.
|
|
53
153
|
|
|
54
|
-
|
|
154
|
+
```js
|
|
155
|
+
import { CitationTracker } from "@devilsdev/rag-pipeline-utils";
|
|
55
156
|
|
|
56
|
-
|
|
157
|
+
const sources = [
|
|
158
|
+
{
|
|
159
|
+
id: "policy",
|
|
160
|
+
content: "Employees receive twenty days of paid vacation per year.",
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
const tracker = new CitationTracker();
|
|
57
164
|
|
|
58
|
-
|
|
165
|
+
const good = tracker.track(
|
|
166
|
+
"Employees receive twenty days of paid vacation per year.",
|
|
167
|
+
sources,
|
|
168
|
+
);
|
|
169
|
+
const wrong = tracker.track(
|
|
170
|
+
"Employees receive thirty days of paid vacation per year.",
|
|
171
|
+
sources,
|
|
172
|
+
);
|
|
59
173
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
174
|
+
console.log(good.groundednessScore); // 1
|
|
175
|
+
console.log(wrong.groundednessScore); // 0: the number does not match the source
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Measure answer quality in CI
|
|
179
|
+
|
|
180
|
+
`PipelineEvaluator` scores faithfulness, relevance, context precision and, when you supply a reference answer, context recall. Run it over a fixed question set and fail the build when scores drop.
|
|
181
|
+
|
|
182
|
+
```js
|
|
183
|
+
import { PipelineEvaluator } from "@devilsdev/rag-pipeline-utils";
|
|
184
|
+
|
|
185
|
+
const evaluator = new PipelineEvaluator();
|
|
186
|
+
const report = evaluator.evaluate(
|
|
187
|
+
{
|
|
188
|
+
query: "How many vacation days do employees get?",
|
|
189
|
+
answer: "Employees receive twenty days of paid vacation per year.",
|
|
190
|
+
results: [
|
|
191
|
+
{ content: "Employees receive twenty days of paid vacation per year." },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{ referenceAnswer: "Twenty days of paid vacation per year." },
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
console.log(report.scores); // includes contextRecall because a reference was given
|
|
198
|
+
if (report.scores.faithfulness < 0.8) process.exitCode = 1;
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Protect an internal assistant
|
|
202
|
+
|
|
203
|
+
`GuardrailsPipeline` wraps any pipeline. Access control runs before the LLM sees a document, prompt-injection detection runs on the query, and PII is redacted from the answer, its citations and its evaluation details.
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
import {
|
|
207
|
+
createRagPipeline,
|
|
208
|
+
GuardrailsPipeline,
|
|
209
|
+
OpenAIConnector,
|
|
210
|
+
} from "@devilsdev/rag-pipeline-utils";
|
|
211
|
+
|
|
212
|
+
const openai = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
213
|
+
const retriever = {
|
|
214
|
+
// Any object with retrieve() works; requiredRole drives access control.
|
|
215
|
+
async retrieve() {
|
|
216
|
+
return [
|
|
217
|
+
{
|
|
218
|
+
id: "handbook",
|
|
219
|
+
content: "The handbook covers vacation.",
|
|
220
|
+
metadata: {},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "salaries",
|
|
224
|
+
content: "Executive salaries ...",
|
|
225
|
+
metadata: { requiredRole: "exec" },
|
|
226
|
+
},
|
|
227
|
+
];
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const assistant = new GuardrailsPipeline(
|
|
232
|
+
createRagPipeline({ retriever, llm: openai }),
|
|
233
|
+
{
|
|
234
|
+
preRetrieval: { enableInjectionDetection: true },
|
|
235
|
+
retrieval: { enforceACL: true },
|
|
236
|
+
postGeneration: { enablePIIDetection: true },
|
|
237
|
+
strict: true, // block instead of warn
|
|
238
|
+
},
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
const result = await assistant.run({
|
|
242
|
+
query: "What does the handbook cover?",
|
|
243
|
+
context: { userPermissions: ["employee"] }, // "salaries" never reaches the LLM
|
|
64
244
|
});
|
|
65
|
-
|
|
245
|
+
console.log(result.guardrails.retrieval.removed); // [{ id: "salaries" }]
|
|
66
246
|
```
|
|
67
247
|
|
|
68
|
-
###
|
|
248
|
+
### Combine keyword and vector search
|
|
69
249
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
250
|
+
`HybridRetriever` merges any retrievers with Reciprocal Rank Fusion. BM25 finds exact terms such as product codes; vectors find paraphrases.
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
import {
|
|
254
|
+
BM25Search,
|
|
255
|
+
HybridRetriever,
|
|
256
|
+
LocalEmbedder,
|
|
257
|
+
MemoryRetriever,
|
|
258
|
+
} from "@devilsdev/rag-pipeline-utils";
|
|
259
|
+
|
|
260
|
+
const docs = [
|
|
261
|
+
{
|
|
262
|
+
id: "err-4012",
|
|
263
|
+
content: "Error E4012 means the API token expired. Generate a new token.",
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
id: "billing",
|
|
267
|
+
content: "Invoices are emailed on the first business day of each month.",
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
|
|
271
|
+
const bm25 = new BM25Search();
|
|
272
|
+
bm25.index(docs);
|
|
273
|
+
|
|
274
|
+
const embedder = new LocalEmbedder();
|
|
275
|
+
embedder.train(docs.map((doc) => doc.content));
|
|
276
|
+
const vectors = new MemoryRetriever();
|
|
277
|
+
await vectors.store(
|
|
278
|
+
docs.map((doc) => ({ ...doc, vector: embedder.embed(doc.content) })),
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
const hybrid = new HybridRetriever([
|
|
282
|
+
{ retriever: bm25, weight: 1, name: "bm25" },
|
|
283
|
+
{ retriever: vectors, weight: 1, name: "vectors" },
|
|
284
|
+
]);
|
|
285
|
+
const results = await hybrid.retrieve({
|
|
286
|
+
query: "what does E4012 mean",
|
|
287
|
+
queryVector: embedder.embed("what does E4012 mean"),
|
|
288
|
+
topK: 2,
|
|
74
289
|
});
|
|
75
|
-
|
|
76
|
-
// Alert when faithfulness drops below threshold in production
|
|
290
|
+
console.log(results[0].id); // "err-4012"
|
|
77
291
|
```
|
|
78
292
|
|
|
79
|
-
###
|
|
293
|
+
### Answer multi-part questions
|
|
294
|
+
|
|
295
|
+
`AgenticPipeline` splits compound questions into sub-queries, retrieves for each, and self-checks the answer against the sources before returning it.
|
|
296
|
+
|
|
297
|
+
```js
|
|
298
|
+
import {
|
|
299
|
+
AgenticPipeline,
|
|
300
|
+
MemoryRetriever,
|
|
301
|
+
OpenAIConnector,
|
|
302
|
+
} from "@devilsdev/rag-pipeline-utils";
|
|
303
|
+
|
|
304
|
+
const openai = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
305
|
+
const retriever = new MemoryRetriever();
|
|
306
|
+
const policies = [
|
|
307
|
+
"Full-time employees receive twenty days of paid vacation per year.",
|
|
308
|
+
"Remote work is allowed two days per week with manager approval.",
|
|
309
|
+
];
|
|
310
|
+
await retriever.store(
|
|
311
|
+
await Promise.all(
|
|
312
|
+
policies.map(async (content, i) => ({
|
|
313
|
+
id: `p${i}`,
|
|
314
|
+
content,
|
|
315
|
+
vector: await openai.embed(content),
|
|
316
|
+
})),
|
|
317
|
+
),
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
const agent = new AgenticPipeline();
|
|
321
|
+
const result = await agent.run({
|
|
322
|
+
query: "How much vacation do I get, and can I work from home?",
|
|
323
|
+
retriever,
|
|
324
|
+
llm: openai,
|
|
325
|
+
embedder: openai, // each sub-query gets its own embedding
|
|
326
|
+
});
|
|
327
|
+
console.log(result.subQueries.map((q) => q.subQuery));
|
|
328
|
+
console.log(result.answer);
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Keep request latency bounded
|
|
332
|
+
|
|
333
|
+
Every run accepts a timeout and an `AbortSignal`. The signal is passed to the embedder, retriever, reranker and LLM, so cancelled work stops instead of running in the background.
|
|
334
|
+
|
|
335
|
+
```js
|
|
336
|
+
import {
|
|
337
|
+
createRagPipeline,
|
|
338
|
+
OpenAIConnector,
|
|
339
|
+
MemoryRetriever,
|
|
340
|
+
} from "@devilsdev/rag-pipeline-utils";
|
|
80
341
|
|
|
81
|
-
|
|
82
|
-
|
|
342
|
+
const openai = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
343
|
+
const pipeline = createRagPipeline({
|
|
344
|
+
embedder: openai,
|
|
345
|
+
retriever: new MemoryRetriever(),
|
|
346
|
+
llm: openai,
|
|
347
|
+
});
|
|
83
348
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
349
|
+
const controller = new AbortController(); // e.g. aborted when the HTTP client disconnects
|
|
350
|
+
const result = await pipeline.run({
|
|
351
|
+
query: "Summarise the travel policy",
|
|
352
|
+
options: { timeout: 10_000, signal: controller.signal },
|
|
88
353
|
});
|
|
354
|
+
if (!result.success) console.error(result.error); // "Execution timeout" or "Execution aborted"
|
|
89
355
|
```
|
|
90
356
|
|
|
91
|
-
|
|
357
|
+
### Run fully local
|
|
92
358
|
|
|
359
|
+
Pair the `LocalEmbedder` or Ollama embeddings with an Ollama model and `FileVectorStore` for a private, offline setup. The CLI's `local` and `ollama` templates set this up for you:
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
npx rag-pipeline init --no-interactive --template ollama
|
|
363
|
+
npx rag-pipeline ingest ./docs
|
|
364
|
+
npx rag-pipeline serve
|
|
93
365
|
```
|
|
94
|
-
Ingestion: Documents → Chunking → Embedder → Vector Store
|
|
95
366
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
↓
|
|
104
|
-
Reranker → BM25 / embedding / cascade
|
|
105
|
-
↓
|
|
106
|
-
LLM → generates answer from context
|
|
107
|
-
↓
|
|
108
|
-
Citation Tracker → maps sentences to sources
|
|
109
|
-
↓
|
|
110
|
-
Evaluator → scores faithfulness & groundedness
|
|
111
|
-
↓
|
|
112
|
-
Response { answer, citations, evaluation }
|
|
367
|
+
## How it works
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
┌──────────────── GuardrailsPipeline (optional) ─────────────────┐
|
|
371
|
+
query ──▶ │ injection check ─▶ embed ─▶ retrieve ─▶ ACL / relevance filter │
|
|
372
|
+
│ ─▶ rerank ─▶ LLM ─▶ citations ─▶ evaluation ─▶ PII redaction │ ──▶ result
|
|
373
|
+
└────────────────────────────────────────────────────────────────┘
|
|
113
374
|
```
|
|
114
375
|
|
|
115
|
-
Each stage
|
|
376
|
+
`createRagPipeline()` runs embed → retrieve → rerank → generate, then citations and evaluation when requested. Each stage receives the run's `AbortSignal`, and a timeout or abort stops the remaining stages. `GuardrailsPipeline`, `AgenticPipeline` and `HybridRetriever` compose around or inside it; they are not hidden steps of the default pipeline.
|
|
116
377
|
|
|
117
|
-
|
|
378
|
+
The result of `run()` is:
|
|
118
379
|
|
|
119
|
-
|
|
380
|
+
```ts
|
|
381
|
+
{
|
|
382
|
+
success: boolean;
|
|
383
|
+
query: string;
|
|
384
|
+
results: Array<{ id; content; score; metadata }>;
|
|
385
|
+
answer: string | null; // null when no LLM is configured
|
|
386
|
+
citations?: { citations; groundednessScore; hallucinationReport };
|
|
387
|
+
evaluation?: { scores; details; metadata };
|
|
388
|
+
error?: string; // set when success is false
|
|
389
|
+
}
|
|
390
|
+
```
|
|
120
391
|
|
|
121
|
-
|
|
122
|
-
| -------------- | ------------------------------------------------------------------------ |
|
|
123
|
-
| **Chunking** | 5 strategies: sentence, fixed-size, recursive, semantic, structure-aware |
|
|
124
|
-
| **Retrieval** | Hybrid vector + BM25 with Reciprocal Rank Fusion |
|
|
125
|
-
| **Reranking** | LLM, BM25 scoring, embedding similarity, or cascade |
|
|
126
|
-
| **Evaluation** | Faithfulness, relevance, context precision/recall, groundedness |
|
|
127
|
-
| **Citation** | Per-sentence source attribution, hallucination detection |
|
|
128
|
-
| **Agentic** | Query planning, iterative retrieval, self-critique |
|
|
129
|
-
| **Guardrails** | Injection detection, PII filtering, ACL-aware access control |
|
|
130
|
-
| **GraphRAG** | Knowledge graph construction with entity extraction |
|
|
131
|
-
| **Streaming** | SSE and WebSocket adapters with backpressure control |
|
|
132
|
-
| **Cost** | Token tracking, budget enforcement, provider pricing |
|
|
133
|
-
| **Debugging** | Execution tracing, bottleneck detection |
|
|
134
|
-
| **MCP** | Expose pipelines as Model Context Protocol tools |
|
|
135
|
-
| **Enterprise** | Multi-tenancy, SSO (SAML/OAuth2/AD/OIDC), audit logs |
|
|
392
|
+
## Capabilities
|
|
136
393
|
|
|
137
|
-
|
|
394
|
+
| Area | What you get |
|
|
395
|
+
| -------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
396
|
+
| **Chunking** | `ChunkingEngine` with sentence, fixed-size, recursive, semantic and structure-aware strategies |
|
|
397
|
+
| **Retrieval** | `MemoryRetriever`, persistent `FileVectorStore`, `BM25Search`, `HybridRetriever` (Reciprocal Rank Fusion) |
|
|
398
|
+
| **Reranking** | `ScoringReranker`, `EmbeddingReranker` (cached), `CascadeReranker` |
|
|
399
|
+
| **Citations** | Per-sentence source mapping, hallucination report, numeric-consistency check |
|
|
400
|
+
| **Evaluation** | Faithfulness, relevance, context precision, context recall (with a reference), groundedness, BLEU/ROUGE |
|
|
401
|
+
| **Guardrails** | Injection detection with input normalisation, ACL and relevance filtering before generation, PII redaction |
|
|
402
|
+
| **Agentic** | `QueryPlanner`, `IterativeRetriever`, `SelfCritiqueChecker`, `AgenticPipeline` |
|
|
403
|
+
| **GraphRAG** | `KnowledgeGraph`, `EntityExtractor`, `GraphRetriever` |
|
|
404
|
+
| **Streaming** | Token streaming with a final chunk carrying citations and evaluation; `SSEAdapter`, `WebSocketAdapter` |
|
|
405
|
+
| **Cost** | `CostTracker`, `TokenBudget`, `CostCalculator` with sourced, overridable pricing |
|
|
406
|
+
| **Operations** | `DevServer` HTTP API, `ExecutionTracer`, `AuditLogger`, MCP tool server (`MCPServer`) |
|
|
407
|
+
|
|
408
|
+
## How it compares
|
|
409
|
+
|
|
410
|
+
A short summary of the [comparison page](https://devilsdev.github.io/rag-pipeline-utils/docs/Comparison) (competitor details as of April 2026). The other libraries are broader frameworks; this one is narrower on purpose.
|
|
411
|
+
|
|
412
|
+
| | rag-pipeline-utils | LangChain.js | LlamaIndex.TS |
|
|
413
|
+
| ---------------- | ------------------------------------------------------- | ------------------------------------- | ------------------------------------ |
|
|
414
|
+
| Focus | RAG pipelines for Node.js services | General-purpose LLM orchestration | Indexing-first RAG |
|
|
415
|
+
| Evaluation | Built in: faithfulness, relevance, context P/R | Via LangSmith (separate, paid option) | Some metrics, evolving |
|
|
416
|
+
| Citations | Built in: per-sentence, with groundedness score | Possible, wired up by hand | Possible, wired up by hand |
|
|
417
|
+
| Guardrails | Built in: pre-retrieval, retrieval, post-generation | Via integrations (Guardrails AI etc.) | Via integrations |
|
|
418
|
+
| Vector stores | Memory and file-backed, plus a plugin contract | 50+ integrations | Many integrations and native indexes |
|
|
419
|
+
| LLM providers | OpenAI, Anthropic, Cohere, Ollama, plus plugins | Largest ecosystem | Large ecosystem |
|
|
420
|
+
| Agents and tools | Query planning and iterative retrieval | Mature agent framework | Agent framework |
|
|
421
|
+
| Packaging | One package, dual ESM and CommonJS | Many packages, mostly ESM | One package, mostly ESM |
|
|
422
|
+
| Stability | Documented [SEMVER policy](SEMVER.md) with deprecations | Versioned per package | Versioned |
|
|
423
|
+
|
|
424
|
+
Choose LangChain.js for the widest integration catalogue or work that goes well beyond RAG, and LlamaIndex.TS for rich index types and structured data sources. Choose this library when evaluation, citations and guardrails are requirements and you want a small surface to review.
|
|
425
|
+
3
|
|
426
|
+
|
|
427
|
+
## Connectors and plugins
|
|
428
|
+
|
|
429
|
+
| Connector | Embeddings | Generation | Notes |
|
|
430
|
+
| -------------------- | :--------: | :--------: | ------------------------------------------ |
|
|
431
|
+
| `OpenAIConnector` | ✓ | ✓ | `OPENAI_API_KEY` |
|
|
432
|
+
| `AnthropicConnector` | | ✓ | `ANTHROPIC_API_KEY` |
|
|
433
|
+
| `CohereConnector` | ✓ | | Embeddings and reranking, `COHERE_API_KEY` |
|
|
434
|
+
| `OllamaConnector` | ✓ | ✓ | Local models, no key |
|
|
435
|
+
| `LocalEmbedder` | ✓ | | Offline TF-IDF, fitted to your corpus |
|
|
436
|
+
|
|
437
|
+
Connectors read API keys when they are created, retry only transient failures (network errors, 429, 5xx) with backoff, and send retrieved documents to the model as clearly delimited, untrusted reference data rather than as instructions.
|
|
438
|
+
|
|
439
|
+
A plugin is any object with the method its stage needs: `embed()`, `retrieve()`/`store()`, `generate()`, `rerank()` or `load()`. Reference your own modules from `.ragrc.json`, or install packaged plugins with checksum verification and a static security scan:
|
|
138
440
|
|
|
139
|
-
|
|
441
|
+
```bash
|
|
442
|
+
npx rag-pipeline hub install ./my-llm-plugin # also .tgz files, npm:<package> or a registry
|
|
443
|
+
npx rag-pipeline hub certify check ./my-llm-plugin # scores contract, security, tests and docs
|
|
444
|
+
```
|
|
140
445
|
|
|
141
|
-
|
|
446
|
+
## Experimental modules
|
|
142
447
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
CohereConnector, // Embed + Rerank
|
|
148
|
-
OllamaConnector, // Llama 3, Mistral (local, offline)
|
|
149
|
-
LocalEmbedder, // TF-IDF (offline, no API)
|
|
150
|
-
MemoryRetriever, // In-memory cosine similarity
|
|
151
|
-
} from "@devilsdev/rag-pipeline-utils";
|
|
448
|
+
Simulated or incomplete modules live under a separate entry point and are not covered by the stability guarantees in [SEMVER.md](SEMVER.md): model training, federated learning, multimodal processing, adaptive retrieval, SSO providers, multi-tenancy, data governance, the plugin sandbox and the plugin certification class.
|
|
449
|
+
|
|
450
|
+
```js
|
|
451
|
+
import { TenantManager } from "@devilsdev/rag-pipeline-utils/experimental";
|
|
152
452
|
```
|
|
153
453
|
|
|
154
|
-
|
|
454
|
+
They are still exported from the main entry in 2.5 with a one-time deprecation warning, and will be removed from it in 3.0. Do not use them for authentication, tenant isolation or compliance. The [Experimental modules](https://devilsdev.github.io/rag-pipeline-utils/docs/Experimental) page describes what each one really does.
|
|
155
455
|
|
|
156
|
-
|
|
157
|
-
- **[Architecture](https://devilsdev.github.io/rag-pipeline-utils/docs/Architecture)** — plugin contracts, pipeline internals
|
|
158
|
-
- **[API reference](https://devilsdev.github.io/rag-pipeline-utils/docs/API-Reference)** — complete export index
|
|
159
|
-
- **[Examples](https://devilsdev.github.io/rag-pipeline-utils/docs/Examples)** — chatbot, Q&A, code search, support
|
|
160
|
-
- **[Comparison vs LangChain.js / LlamaIndex.TS](https://devilsdev.github.io/rag-pipeline-utils/docs/Comparison)** — honest decision framework
|
|
161
|
-
- **[Runnable demo](examples/fastify-rag-demo)** — Fastify + OpenAI + guardrails, deployable in one command
|
|
162
|
-
- **[Benchmarks & methodology](BENCHMARKS.md)** — how we measure, how you reproduce
|
|
163
|
-
- **[Security policy](SECURITY.md)** — responsible disclosure, supported versions
|
|
164
|
-
- **[Security capability matrix](https://devilsdev.github.io/rag-pipeline-utils/docs/Security-Capabilities)** — what's battle-tested vs. recommended vs. example
|
|
165
|
-
- **[API stability policy (SEMVER.md)](SEMVER.md)** — what counts as breaking, deprecation windows
|
|
166
|
-
- **[Changelog](CHANGELOG.md)** — release history
|
|
456
|
+
## Compatibility
|
|
167
457
|
|
|
168
|
-
|
|
458
|
+
| | |
|
|
459
|
+
| -------------- | ------------------------------------------------------------------------- |
|
|
460
|
+
| Node.js | 18, 20, 22 (Node 18 support ends with 3.0) |
|
|
461
|
+
| Module formats | CommonJS (`require`) and ESM (`import`) |
|
|
462
|
+
| TypeScript | Declarations for every export, including `/experimental` |
|
|
463
|
+
| Versioning | Semantic versioning with a deprecation window, see [SEMVER.md](SEMVER.md) |
|
|
464
|
+
| Supply chain | Published from GitHub Actions with npm provenance |
|
|
465
|
+
|
|
466
|
+
## Documentation
|
|
169
467
|
|
|
170
|
-
|
|
468
|
+
- [Documentation site](https://devilsdev.github.io/rag-pipeline-utils/): guides, API reference and deployment
|
|
469
|
+
- [CLI reference](https://devilsdev.github.io/rag-pipeline-utils/docs/CLI)
|
|
470
|
+
- [API reference](https://devilsdev.github.io/rag-pipeline-utils/docs/API-Reference)
|
|
471
|
+
- [Evaluation guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Evaluation)
|
|
472
|
+
- [Examples](examples/): basic pipeline, OpenAI with Pinecone, and a deployable Fastify service
|
|
473
|
+
- [Changelog](CHANGELOG.md) and [benchmarks methodology](BENCHMARKS.md)
|
|
171
474
|
|
|
172
|
-
|
|
475
|
+
## Security
|
|
173
476
|
|
|
174
|
-
|
|
477
|
+
Report vulnerabilities privately as described in [SECURITY.md](SECURITY.md). The [security capability matrix](https://devilsdev.github.io/rag-pipeline-utils/docs/Security-Capabilities) lists what is hardened, what is recommended configuration, and what is an example only.
|
|
175
478
|
|
|
176
|
-
##
|
|
479
|
+
## Contributing
|
|
177
480
|
|
|
178
|
-
|
|
179
|
-
- **[Issues](https://github.com/DevilsDev/rag-pipeline-utils/issues)** — report bugs, request features
|
|
180
|
-
- **[Contributing guide](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/docs/CONTRIBUTING.md)**
|
|
481
|
+
Issues and pull requests are welcome. Start with the [contributing guide](docs/CONTRIBUTING.md), and use [GitHub Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions) for questions and ideas. Run `npm test` and `npm run lint` before opening a pull request.
|
|
181
482
|
|
|
182
483
|
## License
|
|
183
484
|
|
|
184
|
-
MIT
|
|
485
|
+
[MIT](LICENSE)
|
package/SECURITY.md
CHANGED
|
@@ -8,11 +8,11 @@ Only the latest minor release line receives security patches. When a new
|
|
|
8
8
|
minor version ships, the previous line receives one more patch window of
|
|
9
9
|
30 days before support ends.
|
|
10
10
|
|
|
11
|
-
| Version | Supported
|
|
12
|
-
| ------- |
|
|
13
|
-
| 2.
|
|
14
|
-
| 2.
|
|
15
|
-
| < 2.
|
|
11
|
+
| Version | Supported |
|
|
12
|
+
| ------- | ------------------------------------------------------------ |
|
|
13
|
+
| 2.5.x | :white_check_mark: |
|
|
14
|
+
| 2.4.x | Security fixes for 30 days after the 2.5.0 release, then :x: |
|
|
15
|
+
| < 2.4 | :x: |
|
|
16
16
|
|
|
17
17
|
## Reporting a Vulnerability
|
|
18
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types/experimental";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
const mod = require('./experimental.cjs');
|
|
4
|
+
export const { MultiModalProcessor, AdaptiveRetrievalEngine, FederatedLearningCoordinator, ModelTrainingOrchestrator, DataGovernanceManager, DataGovernance, TenantManager, ResourceMonitor, SSOManager, SAMLProvider, OAuth2Provider, ActiveDirectoryProvider, OIDCProvider, PluginSandbox, PluginCertification } = mod;
|
|
5
|
+
export default mod;
|