@devilsdev/rag-pipeline-utils 2.4.4 → 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/.ragrc.schema.json
CHANGED
|
@@ -1,218 +1,109 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://raw.githubusercontent.com/DevilsDev/rag-pipeline-utils/main/.ragrc.schema.json",
|
|
4
|
-
"title": "
|
|
5
|
-
"description": "Configuration
|
|
4
|
+
"title": "rag-pipeline configuration (.ragrc.json)",
|
|
5
|
+
"description": "Configuration read by the rag-pipeline CLI and loadRagConfig() in @devilsdev/rag-pipeline-utils. Each pipeline entry names a built-in component, a custom module under \"plugins\", or a plugin registered on pluginRegistry.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": ["
|
|
7
|
+
"required": ["pipeline"],
|
|
8
8
|
"properties": {
|
|
9
|
-
"
|
|
9
|
+
"$schema": { "type": "string" },
|
|
10
|
+
"namespace": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"default": "default",
|
|
14
|
+
"description": "Logical name for this configuration."
|
|
15
|
+
},
|
|
16
|
+
"metadata": {
|
|
10
17
|
"type": "object",
|
|
11
|
-
"description": "
|
|
12
|
-
"required": ["loader", "embedder", "retriever", "llm"],
|
|
18
|
+
"description": "Free-form information about the configuration.",
|
|
13
19
|
"properties": {
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"oneOf": [
|
|
20
|
-
{ "type": "string" },
|
|
21
|
-
{
|
|
22
|
-
"type": "object",
|
|
23
|
-
"required": ["name"],
|
|
24
|
-
"properties": {
|
|
25
|
-
"name": { "type": "string" },
|
|
26
|
-
"version": { "type": "string" },
|
|
27
|
-
"source": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"enum": ["registry", "local", "git", "npm"]
|
|
30
|
-
},
|
|
31
|
-
"path": { "type": "string" },
|
|
32
|
-
"config": { "type": "object" },
|
|
33
|
-
"enabled": { "type": "boolean" }
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"embedder": {
|
|
40
|
-
"type": "object",
|
|
41
|
-
"description": "Text embedding plugins",
|
|
42
|
-
"minProperties": 1,
|
|
43
|
-
"additionalProperties": {
|
|
44
|
-
"oneOf": [
|
|
45
|
-
{ "type": "string" },
|
|
46
|
-
{
|
|
47
|
-
"type": "object",
|
|
48
|
-
"required": ["name"],
|
|
49
|
-
"properties": {
|
|
50
|
-
"name": { "type": "string" },
|
|
51
|
-
"version": { "type": "string" },
|
|
52
|
-
"source": {
|
|
53
|
-
"type": "string",
|
|
54
|
-
"enum": ["registry", "local", "git", "npm"]
|
|
55
|
-
},
|
|
56
|
-
"path": { "type": "string" },
|
|
57
|
-
"config": { "type": "object" },
|
|
58
|
-
"enabled": { "type": "boolean" }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"retriever": {
|
|
65
|
-
"type": "object",
|
|
66
|
-
"description": "Vector retrieval plugins",
|
|
67
|
-
"minProperties": 1,
|
|
68
|
-
"additionalProperties": {
|
|
69
|
-
"oneOf": [
|
|
70
|
-
{ "type": "string" },
|
|
71
|
-
{
|
|
72
|
-
"type": "object",
|
|
73
|
-
"required": ["name"],
|
|
74
|
-
"properties": {
|
|
75
|
-
"name": { "type": "string" },
|
|
76
|
-
"version": { "type": "string" },
|
|
77
|
-
"source": {
|
|
78
|
-
"type": "string",
|
|
79
|
-
"enum": ["registry", "local", "git", "npm"]
|
|
80
|
-
},
|
|
81
|
-
"path": { "type": "string" },
|
|
82
|
-
"config": { "type": "object" },
|
|
83
|
-
"enabled": { "type": "boolean" }
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"llm": {
|
|
90
|
-
"type": "object",
|
|
91
|
-
"description": "Language model plugins",
|
|
92
|
-
"minProperties": 1,
|
|
93
|
-
"additionalProperties": {
|
|
94
|
-
"oneOf": [
|
|
95
|
-
{ "type": "string" },
|
|
96
|
-
{
|
|
97
|
-
"type": "object",
|
|
98
|
-
"required": ["name"],
|
|
99
|
-
"properties": {
|
|
100
|
-
"name": { "type": "string" },
|
|
101
|
-
"version": { "type": "string" },
|
|
102
|
-
"source": {
|
|
103
|
-
"type": "string",
|
|
104
|
-
"enum": ["registry", "local", "git", "npm"]
|
|
105
|
-
},
|
|
106
|
-
"path": { "type": "string" },
|
|
107
|
-
"config": { "type": "object" },
|
|
108
|
-
"enabled": { "type": "boolean" }
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
]
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
"reranker": {
|
|
115
|
-
"type": "object",
|
|
116
|
-
"description": "Result reranking plugins (optional)",
|
|
117
|
-
"minProperties": 1,
|
|
118
|
-
"additionalProperties": {
|
|
119
|
-
"oneOf": [
|
|
120
|
-
{ "type": "string" },
|
|
121
|
-
{
|
|
122
|
-
"type": "object",
|
|
123
|
-
"required": ["name"],
|
|
124
|
-
"properties": {
|
|
125
|
-
"name": { "type": "string" },
|
|
126
|
-
"version": { "type": "string" },
|
|
127
|
-
"source": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"enum": ["registry", "local", "git", "npm"]
|
|
130
|
-
},
|
|
131
|
-
"path": { "type": "string" },
|
|
132
|
-
"config": { "type": "object" },
|
|
133
|
-
"enabled": { "type": "boolean" }
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"additionalProperties": false
|
|
20
|
+
"name": { "type": "string" },
|
|
21
|
+
"version": { "type": "string" },
|
|
22
|
+
"description": { "type": "string" },
|
|
23
|
+
"createdAt": { "type": "string" }
|
|
24
|
+
}
|
|
141
25
|
},
|
|
142
26
|
"pipeline": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"description": "Components in pipeline order. At least an embedder and a retriever are needed for ingest and query.",
|
|
29
|
+
"items": { "$ref": "#/definitions/pipelineEntry" }
|
|
30
|
+
},
|
|
31
|
+
"plugins": {
|
|
143
32
|
"type": "object",
|
|
144
|
-
"description": "
|
|
145
|
-
"
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
"items": {
|
|
150
|
-
"type": "string",
|
|
151
|
-
"enum": ["loader", "embedder", "retriever", "llm", "reranker"]
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
"mode": {
|
|
33
|
+
"description": "Custom plugin modules by stage and name. Paths are relative to the configuration file; the module exports a class (constructed with the entry's config) or an object.",
|
|
34
|
+
"propertyNames": { "$ref": "#/definitions/stage" },
|
|
35
|
+
"additionalProperties": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"additionalProperties": {
|
|
155
38
|
"type": "string",
|
|
156
|
-
"description": "
|
|
157
|
-
"enum": ["sequential", "parallel", "dag"],
|
|
158
|
-
"default": "sequential"
|
|
39
|
+
"description": "Path to the plugin module, e.g. \"./plugins/my-llm.js\"."
|
|
159
40
|
}
|
|
160
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"examples": [{ "llm": { "my-llm": "./plugins/my-llm.js" } }]
|
|
161
43
|
},
|
|
162
44
|
"performance": {
|
|
163
45
|
"type": "object",
|
|
164
|
-
"description": "
|
|
165
|
-
"properties": {
|
|
166
|
-
"parallel": {
|
|
167
|
-
"type": "object",
|
|
168
|
-
"properties": {
|
|
169
|
-
"enabled": { "type": "boolean", "default": false },
|
|
170
|
-
"maxConcurrency": { "type": "number", "default": 5 },
|
|
171
|
-
"batchSize": { "type": "number", "default": 10 }
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
"streaming": {
|
|
175
|
-
"type": "object",
|
|
176
|
-
"properties": {
|
|
177
|
-
"enabled": { "type": "boolean", "default": false },
|
|
178
|
-
"maxMemoryMB": { "type": "number", "default": 512 },
|
|
179
|
-
"bufferSize": { "type": "number", "default": 100 }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
46
|
+
"description": "Optional performance settings, preserved for plugins and tooling."
|
|
183
47
|
},
|
|
184
48
|
"observability": {
|
|
185
49
|
"type": "object",
|
|
186
|
-
"description": "
|
|
50
|
+
"description": "Optional logging and metrics settings, preserved for plugins and tooling."
|
|
51
|
+
},
|
|
52
|
+
"cache": { "type": "object" },
|
|
53
|
+
"limits": { "type": "object" },
|
|
54
|
+
"storage": { "type": "object" }
|
|
55
|
+
},
|
|
56
|
+
"definitions": {
|
|
57
|
+
"stage": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"enum": ["loader", "embedder", "retriever", "reranker", "llm"]
|
|
60
|
+
},
|
|
61
|
+
"pipelineEntry": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"required": ["stage", "name"],
|
|
187
64
|
"properties": {
|
|
188
|
-
"
|
|
189
|
-
|
|
190
|
-
"
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"
|
|
197
|
-
|
|
65
|
+
"stage": { "$ref": "#/definitions/stage" },
|
|
66
|
+
"name": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"minLength": 1,
|
|
69
|
+
"description": "Built-in names: loader \"auto\"; embedder \"local\", \"openai\", \"ollama\", \"cohere\"; retriever \"file-store\", \"memory\"; llm \"openai\", \"anthropic\", \"ollama\"; reranker \"scoring\". Any other name must be declared under \"plugins\" or registered on pluginRegistry.",
|
|
70
|
+
"examples": [
|
|
71
|
+
"auto",
|
|
72
|
+
"local",
|
|
73
|
+
"openai",
|
|
74
|
+
"ollama",
|
|
75
|
+
"cohere",
|
|
76
|
+
"file-store",
|
|
77
|
+
"memory",
|
|
78
|
+
"anthropic",
|
|
79
|
+
"scoring"
|
|
80
|
+
]
|
|
198
81
|
},
|
|
199
|
-
"
|
|
82
|
+
"version": { "type": "string" },
|
|
83
|
+
"config": {
|
|
200
84
|
"type": "object",
|
|
201
|
-
"
|
|
202
|
-
"enabled": { "type": "boolean", "default": false },
|
|
203
|
-
"exportFormat": {
|
|
204
|
-
"type": "string",
|
|
205
|
-
"enum": ["prometheus", "json", "statsd"],
|
|
206
|
-
"default": "json"
|
|
207
|
-
}
|
|
208
|
-
}
|
|
85
|
+
"description": "Options passed to the component's constructor, e.g. { \"model\": \"gpt-4o-mini\" } or { \"path\": \".rag/index.json\" } for file-store. Do not put API keys here; use environment variables."
|
|
209
86
|
}
|
|
210
87
|
}
|
|
211
|
-
},
|
|
212
|
-
"namespace": {
|
|
213
|
-
"type": "string",
|
|
214
|
-
"description": "Configuration namespace for isolation"
|
|
215
88
|
}
|
|
216
89
|
},
|
|
217
|
-
"
|
|
90
|
+
"examples": [
|
|
91
|
+
{
|
|
92
|
+
"namespace": "default",
|
|
93
|
+
"pipeline": [
|
|
94
|
+
{ "stage": "loader", "name": "auto" },
|
|
95
|
+
{ "stage": "embedder", "name": "local" },
|
|
96
|
+
{
|
|
97
|
+
"stage": "retriever",
|
|
98
|
+
"name": "file-store",
|
|
99
|
+
"config": { "path": ".rag/index.json" }
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"stage": "llm",
|
|
103
|
+
"name": "openai",
|
|
104
|
+
"config": { "model": "gpt-4o-mini" }
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
218
109
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,350 @@ Older history (pre-2.4.0) is preserved in the
|
|
|
9
9
|
[GitHub releases](https://github.com/DevilsDev/rag-pipeline-utils/releases)
|
|
10
10
|
page.
|
|
11
11
|
|
|
12
|
+
## [2.5.0] - 2026-10-28
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Cancellation**: `createRagPipeline` creates an AbortController per run
|
|
17
|
+
and passes its signal to every component (`retriever.retrieve({ signal })`,
|
|
18
|
+
`embedder.embedQuery/embed(text, { signal })`, `reranker.rerank(q, docs,
|
|
19
|
+
{ signal })`, `llm.generate(q, docs, { signal })`); a new `options.signal`
|
|
20
|
+
lets callers cancel. All built-in connectors and rerankers honour it.
|
|
21
|
+
`AgenticPipeline` and `IterativeRetriever` propagate it too.
|
|
22
|
+
- `QueryPlanner.plan(query, { llm, signal })`: LLM-proposed sub-queries with
|
|
23
|
+
strict JSON validation and heuristic fallback (returns a Promise);
|
|
24
|
+
`AgenticPipeline` option `enableLlmPlanning` (default `false`).
|
|
25
|
+
- `checkNumericConsistency`, `extractNumbers`, `detectInjection` and
|
|
26
|
+
`PRICING_METADATA` exports.
|
|
27
|
+
- Opt-in `detectInjection` on `RetrievalGuard` to scan retrieved documents for
|
|
28
|
+
indirect prompt injection.
|
|
29
|
+
- `CostCalculator`: pricing provenance (`source`, `asOf`, `verified`), a
|
|
30
|
+
`pricing` override, one-time unknown-model warnings
|
|
31
|
+
(`RAG_UNKNOWN_MODEL_PRICING`), longest-match model resolution.
|
|
32
|
+
- `EmbeddingReranker` `cacheSize` (LRU of document embeddings) and
|
|
33
|
+
`concurrency` options; `MemoryRetriever` `eviction: 'fifo'` option.
|
|
34
|
+
- Plugin signatures: `computeContentDigest()`, a signed `contentDigest` that
|
|
35
|
+
binds plugin code, opt-in `requireContentDigest` and `requireSignedPlugins`,
|
|
36
|
+
and `register()`'s optional `{ content }` argument.
|
|
37
|
+
- `JWTValidator` options `singleUseTokens` (default `true`) and
|
|
38
|
+
`maxTrackedJtis` (default 100000).
|
|
39
|
+
- `AuditLogger` reads its key from `encryptionKey` or
|
|
40
|
+
`RAG_AUDIT_ENCRYPTION_KEY`; `requireEncryption: true` makes a missing key an
|
|
41
|
+
error.
|
|
42
|
+
- `.env.example` for `docker compose`.
|
|
43
|
+
- `npm run test:serial` and `npm run format:check`.
|
|
44
|
+
- **Working CLI workflow**: `rag-pipeline init`, `ingest <path>`, `query
|
|
45
|
+
<question>` and `run` now do real work against a persistent local index.
|
|
46
|
+
`init` writes a pipeline of built-in components (`--template local |
|
|
47
|
+
openai | ollama | anthropic`, or interactive prompts in a terminal).
|
|
48
|
+
- **`FileVectorStore`** (exported): JSON-file vector index with atomic
|
|
49
|
+
writes, embedder/dimension tracking and per-source re-ingestion.
|
|
50
|
+
- **`.ragrc.json` pipeline resolution**: entries `{ stage, name, config }`
|
|
51
|
+
resolve to built-in components, custom plugin modules under `plugins`, or
|
|
52
|
+
plugins registered on `pluginRegistry`.
|
|
53
|
+
- **`rag-pipeline serve`** and a working **`DevServer`**: local HTTP API
|
|
54
|
+
(`GET /health`, `POST /query`) bound to 127.0.0.1, JSON only, 64 KB body
|
|
55
|
+
limit, no CORS.
|
|
56
|
+
- `LocalEmbedder.getState()` / `setState()`.
|
|
57
|
+
- **`rag-pipeline hub install <source>`** installs plugins from a local
|
|
58
|
+
directory, `.tgz`, single `.js` file, `npm:<package>` or a registry
|
|
59
|
+
(sha256-verified). It contains extraction to `.rag/plugins`, runs a static
|
|
60
|
+
security scan (high-risk findings block unless `--allow-risky`), checks the
|
|
61
|
+
stage contract in a separate process, and registers the plugin in
|
|
62
|
+
`.ragrc.json`. `PluginHub.installPlugin()` uses the same installer.
|
|
63
|
+
- **`rag-pipeline hub certify submit|check <path>`** scores a local plugin
|
|
64
|
+
from its files (contract, security scan, tests, documentation) against the
|
|
65
|
+
BASIC/VERIFIED/ENTERPRISE automated thresholds.
|
|
66
|
+
- **`rag-pipeline hub list`** lists plugins registered in the config.
|
|
67
|
+
- **`rag-pipeline init` setup wizard**: chooses the embedder, LLM, retriever and an optional reranker, using only built-ins or custom plugin modules. Connector options are pre-filled with the connector defaults. Each custom plugin is loaded and its stage method checked before it is accepted. The wizard reports which API key environment variables are missing, can run a connection test on request, and previews the JSON before writing.
|
|
68
|
+
- **`rag-pipeline ai`**, built on the configured pipeline and index:
|
|
69
|
+
`ai train embedding [path]` refits the `local` TF-IDF embedder and
|
|
70
|
+
re-embeds the index; `ai benchmark` reports measured p50/p95/mean latency
|
|
71
|
+
per stage; `ai feedback <question> <docId> --rating up|down` stores votes in
|
|
72
|
+
`.rag/feedback.json` and `ai search` applies them as a capped,
|
|
73
|
+
explained score adjustment; `ai multimodal process <path>` reports type,
|
|
74
|
+
characters and chunks for text files (images exit 1: no built-in connector
|
|
75
|
+
accepts image input).
|
|
76
|
+
|
|
77
|
+
### Deprecated
|
|
78
|
+
|
|
79
|
+
- **Experimental modules moved to `@devilsdev/rag-pipeline-utils/experimental`**:
|
|
80
|
+
`ModelTrainingOrchestrator`, `FederatedLearningCoordinator`,
|
|
81
|
+
`MultiModalProcessor`, `AdaptiveRetrievalEngine`, `SSOManager`,
|
|
82
|
+
`SAMLProvider`, `OAuth2Provider`, `ActiveDirectoryProvider`, `OIDCProvider`,
|
|
83
|
+
`TenantManager`, `ResourceMonitor`, `DataGovernanceManager` /
|
|
84
|
+
`DataGovernance`, `PluginSandbox` and `PluginCertification`. They are
|
|
85
|
+
simulated or incomplete (random metrics, SSO that accepts any code outside
|
|
86
|
+
production and does not verify SAML or OIDC tokens, random quotas, erasure
|
|
87
|
+
that deletes nothing, a non-functional sandbox, fixed certification
|
|
88
|
+
scores); see the Experimental docs page. Their main-entry exports still
|
|
89
|
+
work but emit a one-time `DeprecationWarning` (`RAG_DEP_*` codes) when
|
|
90
|
+
used, are marked `@deprecated` in the types, and will be removed from the
|
|
91
|
+
main entry in the next major release. The same classes are shared by both
|
|
92
|
+
entries, so `instanceof` checks keep working.
|
|
93
|
+
|
|
94
|
+
### Removed
|
|
95
|
+
|
|
96
|
+
- Unused CLI config templates under `src/cli/templates/` (old format,
|
|
97
|
+
referenced a schema path that did not exist).
|
|
98
|
+
- Ten unreachable duplicate modules under `src/ai/` and the internal
|
|
99
|
+
`src/dag/enhanced-dag-engine.js` (never reachable from the package entries;
|
|
100
|
+
the exported classes are unchanged).
|
|
101
|
+
- semantic-release configuration and dependencies (releases use
|
|
102
|
+
`npm publish --provenance` from the release workflow), duplicate
|
|
103
|
+
`.eslintrc.json` and `.babelrc`, about 50 one-off fix scripts and their
|
|
104
|
+
`ci:*` npm scripts, the tracked `junit.xml`, and 14 test suites that never
|
|
105
|
+
exercised `src/` (fake pipelines, mocks, empty timing loops).
|
|
106
|
+
- CLI placeholders that printed success without doing anything (`ingest`,
|
|
107
|
+
`query`, `doctor`, `validate`, `plugin search|install|publish`) and
|
|
108
|
+
options that had no effect (`--trace`, `--stats`, `--parallel`,
|
|
109
|
+
`--streaming`, `--max-memory`, `--preview`, `--validate`, `--explain`,
|
|
110
|
+
`--abort-timeout`, `--quiet`, `config show --format`).
|
|
111
|
+
- The interactive wizard built on hard-coded mock registry data.
|
|
112
|
+
- The unregistered `src/cli/commands/ai-ml*` command modules: federated
|
|
113
|
+
learning, LLM fine-tuning, `ai train status|deploy`, `ai dashboard`,
|
|
114
|
+
adaptive profiles and multimodal `search`/`describe`. They called methods
|
|
115
|
+
missing from the `src/ai` engines, exited 0 on failure and printed
|
|
116
|
+
hard-coded or simulated numbers. The `src/ai` library modules are unchanged.
|
|
117
|
+
- Unreachable modules that were never exported or registered: `src/dx/`
|
|
118
|
+
(including a realtime debugger exposing an unauthenticated WebSocket),
|
|
119
|
+
`src/cli/commands/{dx,docs}.js`, `src/cli/input-sanitization-middleware.js`,
|
|
120
|
+
`src/cli/plugin-marketplace-commands.js`, `src/query.js`, `src/ingest.js`,
|
|
121
|
+
`src/pipeline/pipeline.js`, `src/core/pipeline-factory.js`. The package
|
|
122
|
+
`exports` map only exposes `.` and `./cli`, so these were never public.
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- **`evaluateRagDataset`** scores the generated answer; it scored the
|
|
127
|
+
retrieved documents, so every case failed with zero scores.
|
|
128
|
+
- **`RetrievalGuard`** with `enforceACL` also reads a top-level `acl` /
|
|
129
|
+
`requiredRole` on results that have `metadata` (it read only `metadata`
|
|
130
|
+
then).
|
|
131
|
+
- **`createRagPipeline`**: timeouts now cancel work and no stage starts after
|
|
132
|
+
an abort (a timeout still resolves `{ success: false, error: 'Execution
|
|
133
|
+
timeout' }`; a caller abort resolves `'Execution aborted'`). Without an llm
|
|
134
|
+
it runs retrieval only and returns `answer: null` instead of `'ok'`. Stream
|
|
135
|
+
mode with `citations` or `evaluate` ends with one `{ token: '', done: true,
|
|
136
|
+
citations, evaluation }` chunk. The artificial 5 ms delay is removed.
|
|
137
|
+
- **Connectors** retry only transient failures (network, 408/409/425/429/5xx)
|
|
138
|
+
with exponential backoff, jitter and `Retry-After`; SDK-internal retries are
|
|
139
|
+
disabled. API keys are read at construction, and calls without a key fail
|
|
140
|
+
fast with `MISSING_API_KEY`.
|
|
141
|
+
- **`MemoryRetriever`** enforces `maxDocuments` and rejects mismatched vector
|
|
142
|
+
dimensions instead of truncating them.
|
|
143
|
+
- **`AuditLogger`** no longer encrypts with a random per-process key that made
|
|
144
|
+
logs unreadable after a restart; legacy `createCipher` records decrypt on
|
|
145
|
+
Node 22+.
|
|
146
|
+
- **`JWTValidator` / `jwt-config`** honour an explicit `clockTolerance` /
|
|
147
|
+
`notBeforeTolerance` of 0 (it became 30); the expired-token test is enabled.
|
|
148
|
+
- **`loadPluginsFromJson`** awaits registration and verifies signed manifests
|
|
149
|
+
and plugin files before importing them.
|
|
150
|
+
- **`rag-pipeline init`**: the connection test aborts its calls after the 15 s
|
|
151
|
+
timeout and the CLI exits afterwards.
|
|
152
|
+
- **Benchmarks** accept `--iterations=N`, no longer abort on the retry
|
|
153
|
+
benchmarks' deliberate warm-up failures, and exit when done.
|
|
154
|
+
- **Docs generation** no longer hangs: the JSDoc regex backtracked
|
|
155
|
+
exponentially on an unterminated `/**`.
|
|
156
|
+
- **Tests** run in parallel again (a suite destroyed the Jest worker's own
|
|
157
|
+
stdio streams), no longer rewrite tracked fixtures, and coverage works on
|
|
158
|
+
Windows (the test setup no longer patches `path.resolve`).
|
|
159
|
+
- **Package import**: `require()` / `import` of 2.4.5 failed in every clean
|
|
160
|
+
install with `Cannot find module 'isolated-vm'`. `isolated-vm` is now
|
|
161
|
+
loaded only when `PluginSandbox` runs and is an optional peer dependency;
|
|
162
|
+
`pino-pretty` is an optional peer as well. Added the missing `ajv-formats`
|
|
163
|
+
and `marked` dependencies, pinned `chalk` to 4.x (5.x is ESM-only), removed
|
|
164
|
+
unused `dotenv`. Importing the bundle no longer prints "Missing Contract"
|
|
165
|
+
warnings. A tarball smoke test (`npm run smoke:pack`) now runs in CI and
|
|
166
|
+
before publish.
|
|
167
|
+
- **`createRagPipeline`**: the `embedder` result was computed and discarded,
|
|
168
|
+
so vector retrievers never received a `queryVector`. Plugins registered on
|
|
169
|
+
the exported `pluginRegistry` are now resolvable by name, and the timeout
|
|
170
|
+
timer is cleared when a run finishes.
|
|
171
|
+
- **`MemoryRetriever`** throws a clear error when no `queryVector` is given
|
|
172
|
+
instead of crashing inside cosine similarity.
|
|
173
|
+
- **README / docs quick start** now passes an `embedder`; as previously
|
|
174
|
+
written it could not retrieve anything from `MemoryRetriever`.
|
|
175
|
+
- **Citations** with zero retrieved documents no longer fail the run; every
|
|
176
|
+
sentence is reported as unsupported.
|
|
177
|
+
- **`HybridRetriever`** passes the full request (including `queryVector`) to
|
|
178
|
+
`retrieve()`, so vector results are no longer silently dropped, and throws
|
|
179
|
+
when every retriever fails.
|
|
180
|
+
- **Guardrails**: the retrieval guard (ACL, relevance, freshness) now runs
|
|
181
|
+
before generation via the new `options.filterResults` hook; removed
|
|
182
|
+
documents are reported by id only; strict-mode blocks no longer return the
|
|
183
|
+
raw answer; PII is redacted in citations and evaluation details too.
|
|
184
|
+
- **`AuditLogger`**: tenant/user/action filters never matched, so queries and
|
|
185
|
+
compliance reports returned every tenant's records. Encryption now uses
|
|
186
|
+
`createCipheriv` with a random IV per field (it threw on Node 22 and reused
|
|
187
|
+
the nonce on Node 18/20). The integrity hash now covers action and tenant.
|
|
188
|
+
- **`InputSanitizer`**: a regex state bug let command-injection payloads
|
|
189
|
+
through after a previously blocked input.
|
|
190
|
+
- **`LLMReranker`** sends an actual ranking prompt instead of the raw
|
|
191
|
+
question, keeps documents the LLM omits, and honours `topK`.
|
|
192
|
+
- **Agentic RAG**: with an `embedder`, each sub-query and refined query is
|
|
193
|
+
embedded on its own instead of reusing the original query vector.
|
|
194
|
+
- **TypeScript**: 52 runtime exports (citations, guardrails, hybrid
|
|
195
|
+
retrieval, agentic RAG, connectors, rerankers, GraphRAG, ...) had no
|
|
196
|
+
declarations. They are now generated from JSDoc at build time into
|
|
197
|
+
`dist/types/` and re-exported from `dist/index.d.ts`; the build fails if
|
|
198
|
+
any export is undeclared, and the smoke test compiles a TypeScript consumer.
|
|
199
|
+
- **`doctor` / `validate`** report real findings (unknown components,
|
|
200
|
+
missing stages, missing API keys, broken custom plugins) and exit 1 on
|
|
201
|
+
errors. `doctor --auto-fix` no longer lets callers re-enable a shell, no
|
|
202
|
+
longer strips Windows path separators, and runs npm on Windows.
|
|
203
|
+
- **`hub`** (alias `plugin`) commands are registered. There is no default
|
|
204
|
+
registry (the old default host does not exist): pass `--registry <url>` or
|
|
205
|
+
set `RAG_PLUGIN_REGISTRY` for registry operations.
|
|
206
|
+
- **Hot reload** ignore patterns work again (chokidar 4 dropped glob support)
|
|
207
|
+
and only JavaScript changes trigger a reload.
|
|
208
|
+
- `loadRagConfig()` accepts a config file path as well as a directory and no
|
|
209
|
+
longer logs to stdout.
|
|
210
|
+
- `LocalEmbedder` produced all-zero vectors for corpora of two or fewer
|
|
211
|
+
documents (IDF is now smoothed).
|
|
212
|
+
- **Logger**: console-style calls such as `logger.error("Failed:", msg)` no
|
|
213
|
+
longer log the message as one key per character.
|
|
214
|
+
|
|
215
|
+
### Changed
|
|
216
|
+
|
|
217
|
+
- **Documentation**: the README is rewritten with use cases whose code runs
|
|
218
|
+
in CI (`__tests__/docs/readme-examples.test.js` executes every README
|
|
219
|
+
example), and `.ragrc.json`'s JSON schema (`.ragrc.schema.json`, shipped in
|
|
220
|
+
the package) now describes the `pipeline` + `plugins` format the CLI and
|
|
221
|
+
`loadRagConfig()` actually use.
|
|
222
|
+
- **Metric changes**:
|
|
223
|
+
- Context recall now measures how much of a reference (ground-truth) answer
|
|
224
|
+
the retrieved documents support. Pass it via
|
|
225
|
+
`PipelineEvaluator.evaluate(result, { referenceAnswer })` or
|
|
226
|
+
`run({ options: { evaluate: true, referenceAnswer } })`. Without one,
|
|
227
|
+
`scores.contextRecall` is omitted, `details.contextRecall` is
|
|
228
|
+
`{ score: null, skipped: true, reason }`, and `metadata.metricsSkipped`
|
|
229
|
+
lists it.
|
|
230
|
+
- `computeGroundedness` is a weighted mean over the available components;
|
|
231
|
+
without a reference it is `(0.4 * faithfulness + 0.3 * contextPrecision)
|
|
232
|
+
/ 0.7`.
|
|
233
|
+
- Claim support checks numbers: a sentence whose numbers (digits, decimals,
|
|
234
|
+
percentages, number words) are not in the source scores below 0.4 and is
|
|
235
|
+
not grounded. This affects citations, faithfulness, recall,
|
|
236
|
+
`PostGenerationGuard` and `SelfCritiqueChecker`. "20" equals "twenty".
|
|
237
|
+
- **`createRagPipeline`** results always include `answer` when an llm is
|
|
238
|
+
configured.
|
|
239
|
+
- **`QueryPlanner`** splits only at clause or question boundaries, keeps
|
|
240
|
+
"salt and pepper"-style phrases intact, and expands comparisons into one
|
|
241
|
+
sub-query per entity plus the comparison; results carry `source`.
|
|
242
|
+
- **Prompts**: built-in connectors put retrieved context in the user message
|
|
243
|
+
as delimited, untrusted reference data, with a system prompt telling the
|
|
244
|
+
model to treat it as data. Answers may differ.
|
|
245
|
+
- **`PreRetrievalGuard`** returns the query unchanged (no partial deletion) and
|
|
246
|
+
reports detections in `injection`; strict mode still blocks. Detection
|
|
247
|
+
normalises input first. To cut false positives, bare "act as", "jailbreak",
|
|
248
|
+
uppercase "DAN", mid-line "system:" and "you are now ready" are no longer
|
|
249
|
+
flagged; chat role markers, prompt-exfiltration phrasing and normalisation
|
|
250
|
+
bypasses now are.
|
|
251
|
+
- **`CostCalculator`** prices `gpt-4o-mini-*` and `claude-3-5-sonnet-*`
|
|
252
|
+
correctly (previously gpt-4 pricing and $0); `customPricing` entries without
|
|
253
|
+
`unit` default to per-1000 tokens. Built-in prices are marked unverified:
|
|
254
|
+
their `asOf` is when they were added, not when they were checked.
|
|
255
|
+
- **`EmbeddingReranker`** limits concurrency to 4 by default; call
|
|
256
|
+
`clearCache()` after retraining an embedder.
|
|
257
|
+
- **`AuditLogger`** with encryption enabled and no key now disables
|
|
258
|
+
encryption with a warning instead of using a throwaway key.
|
|
259
|
+
- **Plugin trust store** is empty by default (the placeholder key is gone).
|
|
260
|
+
- **`docker compose`** requires `POSTGRES_PASSWORD`, `REDIS_PASSWORD` and
|
|
261
|
+
`GRAFANA_ADMIN_PASSWORD`, publishes ports on 127.0.0.1 only, and drops the
|
|
262
|
+
debugger port and the Prometheus lifecycle API; the image build fails on
|
|
263
|
+
critical runtime vulnerabilities.
|
|
264
|
+
- **CI**: one `ci.yml` workflow (required checks `Test & Lint (18|20|22)`)
|
|
265
|
+
that also enforces `format:check` and the tarball smoke test, and runs for
|
|
266
|
+
pull requests into any branch. `npm test` runs Jest in parallel.
|
|
267
|
+
- **`DevServer`** now really listens: `start()` binds port 3000 by default
|
|
268
|
+
(pass `port: 0` for a free port), so existing callers may see
|
|
269
|
+
`EADDRINUSE`. Default host is `127.0.0.1` (was `localhost`), default
|
|
270
|
+
`watchPaths` is `[]` (was `./src/plugins`, `./src/mocks`), and requests
|
|
271
|
+
must use a loopback `Host` header while bound to loopback.
|
|
272
|
+
- **`loadRagConfig()`** error messages now include details
|
|
273
|
+
(`Config validation failed: ...`, `Invalid JSON in config file <path>: ...`)
|
|
274
|
+
and it no longer logs.
|
|
275
|
+
- **`rag-pipeline plugin` / `hub`** registry operations require
|
|
276
|
+
`--registry <url>` or `RAG_PLUGIN_REGISTRY`. `hub certify submit` takes a
|
|
277
|
+
local plugin path and reports computed scores; it previously issued
|
|
278
|
+
certificates from fixed placeholder scores. `PluginHub.installPlugin()` now
|
|
279
|
+
installs into `<project>/.rag/plugins` and registers the plugin in the
|
|
280
|
+
config (it previously only wrote `metadata.json` to `localCacheDir`), and
|
|
281
|
+
`getInstalledPlugins()` reads the config.
|
|
282
|
+
- **`FileVectorStore`** index files store mostly-zero vectors sparsely and
|
|
283
|
+
round values to 7 significant digits (about 10x smaller for the `local`
|
|
284
|
+
embedder).
|
|
285
|
+
|
|
286
|
+
- **Grounding scores** (citations, faithfulness, context precision/recall,
|
|
287
|
+
groundedness, `PostGenerationGuard`, `SelfCritiqueChecker`) now measure the
|
|
288
|
+
share of a sentence's content words found in a document, optionally
|
|
289
|
+
IDF-weighted. They previously used Jaccard similarity against the whole
|
|
290
|
+
document, which shrinks with document length: an answer copied verbatim
|
|
291
|
+
from a ~70-word chunk scored 0. Scores will be noticeably higher for
|
|
292
|
+
grounded answers.
|
|
293
|
+
- Default per-sentence similarity threshold raised from 0.3 to 0.5
|
|
294
|
+
(`CitationTracker.similarityThreshold`, `PipelineEvaluator.threshold`,
|
|
295
|
+
faithfulness/recall/hallucination-detector `threshold`). Aggregate
|
|
296
|
+
thresholds (`groundednessThreshold`, `approvalThreshold`) are unchanged.
|
|
297
|
+
- The tokenizer keeps non-ASCII letters (`Política` no longer becomes
|
|
298
|
+
`poltica`) and splits on newlines and hyphens instead of gluing words
|
|
299
|
+
together. This also affects BM25, BLEU/ROUGE and the scoring reranker.
|
|
300
|
+
- `RetrievalGuard` with `enforceACL` now fails closed when
|
|
301
|
+
`context.userPermissions` is missing.
|
|
302
|
+
- `CitationTracker.track()` non-array error message is now
|
|
303
|
+
"retrievedDocs must be an array".
|
|
304
|
+
|
|
305
|
+
### Security
|
|
306
|
+
|
|
307
|
+
- Production dependencies: `npm audit --omit=dev` reports no high or critical
|
|
308
|
+
findings (axios ^1.21.0; overrides for fast-uri, follow-redirects,
|
|
309
|
+
form-data, ws and zod).
|
|
310
|
+
- Experimental SSO: the development bypass that accepted any authorization
|
|
311
|
+
code requires `devBypass: true` and a non-production `NODE_ENV` and is
|
|
312
|
+
refused in production; OIDC id_tokens are validated (JWKS signature, iss,
|
|
313
|
+
aud, exp, nonce); OAuth2/OIDC use PKCE (S256); `redirect_uri` comes only
|
|
314
|
+
from configuration; callbacks must match the stored login request's
|
|
315
|
+
provider.
|
|
316
|
+
- Plugin signatures: Ed25519 verification works (`crypto.verify` with
|
|
317
|
+
KeyObjects); a signed `contentDigest` binds plugin code and is always
|
|
318
|
+
enforced when present.
|
|
319
|
+
- `AuditLogger` compares HMAC signatures in constant time; `JWTValidator`'s
|
|
320
|
+
replay store is bounded and expires entries.
|
|
321
|
+
- Retrieved documents are no longer placed in the LLM system role; prompt
|
|
322
|
+
injection detection normalises homoglyphs, leetspeak and zero-width
|
|
323
|
+
characters.
|
|
324
|
+
- `.secrets` is no longer tracked in git (rotate anything it held) and is
|
|
325
|
+
excluded from Docker builds.
|
|
326
|
+
|
|
327
|
+
### Known limitations
|
|
328
|
+
|
|
329
|
+
- Grounding is lexical plus a numeric-consistency check. Not checked:
|
|
330
|
+
negation ("not twenty days"), units ("20 hours" vs "20 days"), ordinals, a
|
|
331
|
+
lone "one", differently split decimals, and claims that combine facts from
|
|
332
|
+
several documents. Document-side matching is lenient ("twenty-five" in a
|
|
333
|
+
source also supports "twenty" or "five").
|
|
334
|
+
- The `openai` SDK stays on 4.x: newer majors need Node 20+ and will come with
|
|
335
|
+
3.0. `csv-parse` has one moderate advisory whose fix is a major release.
|
|
336
|
+
- Experimental SSO cannot refresh OIDC sessions, and `SAMLProvider` refuses
|
|
337
|
+
to authenticate.
|
|
338
|
+
- `AuditLogger`'s HMAC signing key is random per process unless `signingKey`
|
|
339
|
+
is passed, so `verifyIntegrity` flags records written before a restart.
|
|
340
|
+
|
|
341
|
+
## [2.4.5] - 2026-04-19
|
|
342
|
+
|
|
343
|
+
### Changed
|
|
344
|
+
|
|
345
|
+
- **Supply chain**: first release published via GitHub Actions OIDC trusted
|
|
346
|
+
publishing with `--provenance` attached. Tarball now ships with a SLSA
|
|
347
|
+
build provenance attestation signed via Sigstore; consumers can verify
|
|
348
|
+
the git-commit → tarball-bytes chain with `npm audit signatures`. No
|
|
349
|
+
long-lived `NPM_TOKEN` involved.
|
|
350
|
+
- Publish workflow (`.github/workflows/release.yml`): switched from
|
|
351
|
+
`NODE_AUTH_TOKEN` to OIDC, upgraded npm CLI to 11.5.1+ at job start,
|
|
352
|
+
added `--provenance` and `--ignore-scripts` to the publish step.
|
|
353
|
+
|
|
354
|
+
No API, behavior, or documented-surface changes from 2.4.4.
|
|
355
|
+
|
|
12
356
|
## [2.4.4] - 2026-04-16
|
|
13
357
|
|
|
14
358
|
### Added
|
|
@@ -124,6 +468,7 @@ First public release on the 2.4 line, introducing the v2.4 feature set.
|
|
|
124
468
|
For release notes prior to v2.4.0, see
|
|
125
469
|
[github.com/DevilsDev/rag-pipeline-utils/releases](https://github.com/DevilsDev/rag-pipeline-utils/releases).
|
|
126
470
|
|
|
471
|
+
[2.4.5]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.4.5
|
|
127
472
|
[2.4.4]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.4.4
|
|
128
473
|
[2.4.3]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.4.3
|
|
129
474
|
[2.4.2]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.4.2
|