@devilsdev/rag-pipeline-utils 2.6.2 → 2.7.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/BENCHMARKS.md +7 -1
- package/CHANGELOG.md +121 -0
- package/README.md +35 -24
- package/dist/index.cjs +4164 -1825
- package/dist/index.d.ts +265 -256
- package/dist/index.mjs +1 -1
- package/dist/types/cache/memory-cache.d.ts +4 -1
- package/dist/types/cache/redis-cache.d.ts +4 -1
- package/dist/types/cli/services/instrument.d.ts +14 -0
- package/dist/types/cli/services/rag-service.d.ts +140 -0
- package/dist/types/cli/shared/config-context.d.ts +9 -0
- package/dist/types/config/component-factory.d.ts +57 -0
- package/dist/types/config/enhanced-ragrc-schema.d.ts +648 -0
- package/dist/types/config/load-config.d.ts +18 -0
- package/dist/types/config/normalize-config.d.ts +9 -0
- package/dist/types/core/observability/event-logger.d.ts +211 -0
- package/dist/types/core/observability/metrics.d.ts +585 -0
- package/dist/types/core/performance/parallel-processor.d.ts +92 -0
- package/dist/types/core/plugin-registry.d.ts +5 -0
- package/dist/types/dag/core/execution-scheduler.d.ts +3 -1
- package/dist/types/dag/dag-engine.d.ts +15 -2
- package/dist/types/dev/dev-server.d.ts +136 -0
- package/dist/types/dev/hot-reload.d.ts +226 -0
- package/dist/types/ecosystem/plugin-analytics-dashboard.d.ts +141 -0
- package/dist/types/ecosystem/plugin-hub.d.ts +161 -0
- package/dist/types/ecosystem/plugin-installer.d.ts +40 -0
- package/dist/types/ecosystem/plugin-probe.d.ts +21 -0
- package/dist/types/ecosystem/plugin-scanner.d.ts +30 -0
- package/dist/types/ecosystem/tar-extract.d.ts +24 -0
- package/dist/types/enterprise/audit-logging.d.ts +217 -0
- package/dist/types/evaluate/compare.d.ts +140 -0
- package/dist/types/evaluate/dataset.d.ts +43 -0
- package/dist/types/evaluate/evaluator.d.ts +14 -0
- package/dist/types/evaluate/report.d.ts +56 -0
- package/dist/types/evaluate/synthetic.d.ts +64 -0
- package/dist/types/loader/csv-loader.d.ts +10 -0
- package/dist/types/loader/document-reader.d.ts +18 -0
- package/dist/types/loader/html-loader.d.ts +21 -0
- package/dist/types/loader/markdown-loader.d.ts +21 -0
- package/dist/types/retrieval/bm25-search.d.ts +4 -0
- package/dist/types/retrieval/file-vector-store.d.ts +4 -1
- package/dist/types/retrieval/hybrid-retriever.d.ts +4 -0
- package/dist/types/retrieval/pgvector-retriever.d.ts +123 -0
- package/dist/types/retrieval/qdrant-retriever.d.ts +106 -0
- package/dist/types/security/validator.d.ts +11 -1
- package/dist/types/testing.d.ts +2 -0
- package/dist/types/utils/batch-processor.d.ts +205 -0
- package/dist/types/utils/connection-pool.d.ts +158 -0
- package/dist/types/utils/error-formatter.d.ts +312 -0
- package/dist/types/utils/logger.d.ts +29 -4
- package/dist/types/utils/rate-limiter.d.ts +13 -8
- package/dist/types/utils/retry.d.ts +10 -0
- package/package.json +12 -2
- package/src/cache/memory-cache.js +4 -1
- package/src/cache/redis-cache.js +4 -1
- package/src/cli/enhanced-cli-commands.js +79 -0
- package/src/cli/handlers/ai-handler.js +2 -2
- package/src/cli/handlers/eval-handler.js +201 -0
- package/src/cli/handlers/generate-handler.js +103 -0
- package/src/cli/services/benchmark.js +2 -2
- package/src/cli/services/rag-service.js +59 -10
- package/src/cli/shared/cli-utils.js +40 -1
- package/src/config/component-factory.js +32 -0
- package/src/connectors/local-embedder.js +20 -13
- package/src/core/observability/event-logger.js +135 -1
- package/src/core/observability/metrics.js +223 -5
- package/src/core/performance/parallel-processor.js +2 -0
- package/src/core/plugin-registry.js +5 -1
- package/src/dag/core/execution-scheduler.js +2 -0
- package/src/dag/dag-engine.js +13 -0
- package/src/dev/dev-server.js +6 -0
- package/src/ecosystem/plugin-hub.js +4 -0
- package/src/enterprise/audit-logging.js +5 -0
- package/src/evaluate/compare.js +395 -0
- package/src/evaluate/dataset.js +207 -0
- package/src/evaluate/report.js +350 -0
- package/src/evaluate/synthetic.js +246 -0
- package/src/index.js +17 -0
- package/src/retrieval/bm25-search.js +4 -0
- package/src/retrieval/file-vector-store.js +4 -1
- package/src/retrieval/hybrid-retriever.js +4 -0
- package/src/retrieval/pgvector-retriever.js +420 -0
- package/src/retrieval/qdrant-retriever.js +361 -0
- package/src/security/validator.js +8 -0
- package/src/testing.js +2 -0
- package/src/utils/batch-processor.js +7 -3
- package/src/utils/error-formatter.js +48 -20
- package/src/utils/logger.js +31 -1
- package/src/utils/rate-limiter.js +9 -4
- package/src/utils/retry.js +10 -1
package/BENCHMARKS.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This document describes **how we measure** performance in
|
|
4
4
|
`@devilsdev/rag-pipeline-utils` and **how you reproduce the numbers**
|
|
5
|
-
yourself.
|
|
5
|
+
yourself.
|
|
6
|
+
|
|
7
|
+
**Published results:** pipeline overhead and vector store latency and
|
|
8
|
+
recall (`benchmarks/speed.js`, run in CI against pgvector and Qdrant) are
|
|
9
|
+
on the [Benchmarks page](https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks),
|
|
10
|
+
generated from `benchmarks/results/`. The rest of this document covers the
|
|
11
|
+
engine micro-benchmark suite and benchmarking your own stack.
|
|
6
12
|
|
|
7
13
|
## Philosophy
|
|
8
14
|
|
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,126 @@ page.
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [2.7.0] - 2026-10-30
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`validateDataset(dataset, { requireExpected, requireSourceIds })`**
|
|
19
|
+
checks an evaluation test set before it runs and reports every problem
|
|
20
|
+
with its case index, id and field, without throwing. A dataset is an
|
|
21
|
+
array of `{ prompt, expected, sourceIds, id, tags }` cases or
|
|
22
|
+
`{ cases: [...] }`; `question` and `referenceAnswer` are accepted as
|
|
23
|
+
aliases, and the `{ prompt, expected }` shape `evaluateRagDataset` reads
|
|
24
|
+
is valid unchanged. Valid datasets come back normalised in `cases`.
|
|
25
|
+
- **`runEvaluation(dataset, pipeline)`** runs every case with citations and
|
|
26
|
+
evaluation on and returns a JSON report: per-case answers, retrieved ids,
|
|
27
|
+
scores (faithfulness, relevance, context precision and recall,
|
|
28
|
+
groundedness, citation coverage, and `sourceRecall` against the case's
|
|
29
|
+
`sourceIds`) and per-metric means. Failed cases are recorded, not thrown;
|
|
30
|
+
options for `concurrency`, a per-case `timeout`, `signal` and `onCase`.
|
|
31
|
+
Reports record the `libraryVersion`, and `compareConfigurations` warns
|
|
32
|
+
when two runs used different versions, since scoring can change between
|
|
33
|
+
releases.
|
|
34
|
+
- **`compareConfigurations(dataset, { baseline, candidate })`** compares two
|
|
35
|
+
runs, where each side is a pipeline or a saved report, and reports
|
|
36
|
+
`regressed`, per-metric deltas, and the cases that now fail or dropped by
|
|
37
|
+
more than `caseTolerance`. `tolerance` (default 0.02) sets the allowed
|
|
38
|
+
drop in a metric's mean.
|
|
39
|
+
- **`generateSyntheticDataset(documents, { llm, count })`** drafts a test set:
|
|
40
|
+
an LLM writes question and answer pairs about one document at a time, and
|
|
41
|
+
each case records the document in `sourceIds`. Answers their document
|
|
42
|
+
doesn't support (by `computeFaithfulness`), repeated questions, malformed
|
|
43
|
+
replies and short documents are skipped and listed with a reason. Cases
|
|
44
|
+
are tagged `synthetic` and marked `reviewed: false`.
|
|
45
|
+
- **`rag-pipeline generate-dataset --output <file>`** does the same from the
|
|
46
|
+
index with the configured `llm`, and won't overwrite a file without
|
|
47
|
+
`--force`.
|
|
48
|
+
- **`PgVectorRetriever`** stores and searches documents in PostgreSQL with
|
|
49
|
+
the pgvector extension: cosine similarity, upserts in one transaction, an
|
|
50
|
+
HNSW index with an `efSearch` option for recall, and `removeBySource`, `delete`, `clear`, `size` and `list` for
|
|
51
|
+
the CLI. Pass a `pg` Pool, or a connection string with `pg` installed (an
|
|
52
|
+
optional peer dependency, loaded only when used). In `.ragrc.json` it is
|
|
53
|
+
the `pgvector` retriever and reads its connection string from
|
|
54
|
+
`DATABASE_URL`. It isn't cached unless you give it a `cacheKey`.
|
|
55
|
+
- **`QdrantRetriever`** stores and searches documents in a Qdrant
|
|
56
|
+
collection through its REST API, with no client package. Document ids map
|
|
57
|
+
to stable UUIDs, with the original id kept in the payload; writes wait
|
|
58
|
+
until Qdrant applies them. In `.ragrc.json` it is the `qdrant` retriever,
|
|
59
|
+
reading `QDRANT_URL` and `QDRANT_API_KEY`. Tested against Qdrant 1.20.
|
|
60
|
+
- **`rag-pipeline eval <dataset>`** runs a `.json` or `.jsonl` test set
|
|
61
|
+
through the configured pipeline and exits 1 when a case fails, a metric
|
|
62
|
+
is below its `--min metric=value`, or the run regressed from a
|
|
63
|
+
`--baseline` report. `--output` saves the run as a baseline, `--report`
|
|
64
|
+
writes a standalone HTML page (`.html`) or a Markdown summary for a pull
|
|
65
|
+
request comment, and `--json` prints the verdict. Also `--tolerance`,
|
|
66
|
+
`--case-tolerance`, `--concurrency`, `--timeout` and `--top-k`.
|
|
67
|
+
- **[`DevilsDev/rag-eval-action`](https://github.com/DevilsDev/rag-eval-action)**,
|
|
68
|
+
a GitHub Action that runs `rag-pipeline eval` on pull requests, compares
|
|
69
|
+
them with the default branch's report from the Actions cache, posts a
|
|
70
|
+
summary comment that later runs update, and fails the check when scores
|
|
71
|
+
drop. Its `v1` is published with this release.
|
|
72
|
+
- **`renderEvaluationReport`** (Markdown or HTML) and
|
|
73
|
+
**`evaluationVerdict`** for the same reports in code.
|
|
74
|
+
- `sourceIds` match a retrieved result's `id` or its `metadata.source`, so
|
|
75
|
+
a case can name a file when the index stores chunks of it.
|
|
76
|
+
- **A generated API reference** on the docs site: a page for every export,
|
|
77
|
+
with its methods, options and types, built from the published type
|
|
78
|
+
declarations by `npm run docs:api`. CI fails when it is out of date.
|
|
79
|
+
- **Published speed benchmarks** on the docs site: pipeline overhead, and
|
|
80
|
+
ingest throughput, query latency and recall@10 for `MemoryRetriever`,
|
|
81
|
+
`FileVectorStore`, `PgVectorRetriever` and `QdrantRetriever`, measured in
|
|
82
|
+
CI against real pgvector and Qdrant (`npm run bench:speed`), and
|
|
83
|
+
retrieval quality (nDCG@10, recall, MRR) of the offline retrievers on
|
|
84
|
+
BEIR SciFact (`npm run bench:quality`), where `BM25Search` matches the
|
|
85
|
+
published BM25 baseline. The tables are generated from the committed
|
|
86
|
+
reports in `benchmarks/results/`.
|
|
87
|
+
- `logger.info()`, `.warn()`, `.error()` and `.debug()` log through the
|
|
88
|
+
shared logger. The `logger` export is the logger module, so these were
|
|
89
|
+
undefined; `logger.logger.info()` keeps working.
|
|
90
|
+
|
|
91
|
+
### Fixed
|
|
92
|
+
|
|
93
|
+
- **`LocalEmbedder` ignored most words on a large corpus.** When a corpus
|
|
94
|
+
had more distinct tokens than `maxVocabularySize` (10,000), `train()`
|
|
95
|
+
kept the rarest ones, mostly words that occur in a single document, so
|
|
96
|
+
most queries embedded to all zeros. It now keeps the most common tokens.
|
|
97
|
+
On BEIR SciFact nDCG@10 rose from 0.12 to 0.47. Indexes built before
|
|
98
|
+
keep their saved vocabulary until you ingest again; re-run `ingest` to
|
|
99
|
+
benefit.
|
|
100
|
+
- **The TypeScript declarations for the core API didn't match the code.**
|
|
101
|
+
Plugins written to them failed at runtime. `RetrieverPlugin.retrieve`
|
|
102
|
+
takes one `{ query, queryVector, topK, signal }` object,
|
|
103
|
+
`RerankerPlugin.rerank` takes `(query, documents)`, and `LLMPlugin.generate`
|
|
104
|
+
takes `(query, documents, options)` and must return the answer text: an
|
|
105
|
+
`LLMResponse` object became the answer `"[object Object]"`.
|
|
106
|
+
`PipelineRunResult` now has `answer`, `citations` and `evaluation`, and
|
|
107
|
+
`run()` with `options: { stream: true }` is typed to resolve a stream.
|
|
108
|
+
The
|
|
109
|
+
declarations of `loadConfig` (synchronous, takes a path), `validateRagrc`,
|
|
110
|
+
`normalizeConfig`, `pluginRegistry`, `createError` and `wrapError`,
|
|
111
|
+
`computeBLEU`, `computeROUGE` and `scoreAnswer` (token arrays,
|
|
112
|
+
`(actual, expected)`), `retry`, `withRetry`, `RateLimiter`,
|
|
113
|
+
`BatchProcessor`, `ConnectionPoolManager`, `JWTValidator`,
|
|
114
|
+
`PluginSignatureVerifier`, `validateInput`, `DAG`, `evaluateRagDataset`,
|
|
115
|
+
`HotReloadManager`, `DevServer`, `AuditLogger`, `PluginHub`, `metrics`,
|
|
116
|
+
`eventLogger` and `ParallelProcessor` are now generated from the source,
|
|
117
|
+
so they describe what each one does. A call that matched an old
|
|
118
|
+
declaration but not the code, such as `rerank(results, query)` or
|
|
119
|
+
`await loadConfig({ configPath })`, may no longer compile; it didn't
|
|
120
|
+
work when run.
|
|
121
|
+
`LLMResponse`, `LoadConfigOptions`, `DAGNode`, `DAGOptions`,
|
|
122
|
+
`ErrorFormatter` and `EvalResult` are deprecated.
|
|
123
|
+
|
|
124
|
+
- **The CLI didn't wait for retrievers whose methods are async**, as a
|
|
125
|
+
remote vector store's are: `ingest` didn't wait for `removeBySource`, so
|
|
126
|
+
re-ingesting a file could keep its old chunks or delete the new ones, and `generate-dataset`,
|
|
127
|
+
`ai feedback` and `ai benchmark` failed on `list()`. Every retriever call
|
|
128
|
+
is now awaited. The fitted `local` embedder with a store that can't save
|
|
129
|
+
its state now stops with a message instead of embedding queries with an
|
|
130
|
+
empty vocabulary.
|
|
131
|
+
- A bad option value (`--top-k 0`, `--min speed=1`) printed a stack trace;
|
|
132
|
+
the CLI now prints a one-line error naming the option and exits 1.
|
|
133
|
+
|
|
14
134
|
## [2.6.2] - 2026-10-29
|
|
15
135
|
|
|
16
136
|
### Fixed
|
|
@@ -580,6 +700,7 @@ First public release on the 2.4 line, introducing the v2.4 feature set.
|
|
|
580
700
|
For release notes prior to v2.4.0, see
|
|
581
701
|
[github.com/DevilsDev/rag-pipeline-utils/releases](https://github.com/DevilsDev/rag-pipeline-utils/releases).
|
|
582
702
|
|
|
703
|
+
[2.7.0]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.7.0
|
|
583
704
|
[2.6.2]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.6.2
|
|
584
705
|
[2.6.1]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.6.1
|
|
585
706
|
[2.6.0]: https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v2.6.0
|
package/README.md
CHANGED
|
@@ -143,6 +143,8 @@ npx rag-pipeline ingest ./docs # indexes .md, .html, .csv and .txt f
|
|
|
143
143
|
npx rag-pipeline query "What is the remote work policy?"
|
|
144
144
|
npx rag-pipeline serve --port 3000 # local HTTP API: GET /health, POST /query
|
|
145
145
|
npx rag-pipeline doctor # checks config, API keys, plugins and the index
|
|
146
|
+
npx rag-pipeline generate-dataset --output tests.json # drafts a test set from the index with your llm
|
|
147
|
+
npx rag-pipeline eval tests.json --min faithfulness=0.8 # scores a test set; exits 1 on failure
|
|
146
148
|
```
|
|
147
149
|
|
|
148
150
|
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.
|
|
@@ -208,6 +210,10 @@ console.log(report.scores); // includes contextRecall because a reference was gi
|
|
|
208
210
|
if (report.scores.faithfulness < 0.8) process.exitCode = 1;
|
|
209
211
|
```
|
|
210
212
|
|
|
213
|
+
Keep the question set in a JSON file of `{ prompt, expected, sourceIds }` cases; `generateSyntheticDataset` (or `rag-pipeline generate-dataset`) drafts one from your documents for you to review. `validateDataset` checks it before a run and reports every malformed case, with its index and field; `runEvaluation` runs it and saves a JSON report, which `renderEvaluationReport` turns into Markdown or HTML; and `compareConfigurations` compares two pipelines, or a pipeline against the report saved from your main branch, and lists the cases that got worse. See the [dataset format](https://devilsdev.github.io/rag-pipeline-utils/docs/Evaluation#dataset-format).
|
|
214
|
+
|
|
215
|
+
On GitHub, [`DevilsDev/rag-eval-action`](https://github.com/DevilsDev/rag-eval-action) runs this on every pull request, compares it with your main branch and posts the summary as a comment.
|
|
216
|
+
|
|
211
217
|
### Check answers from another framework
|
|
212
218
|
|
|
213
219
|
Already on LangChain, LlamaIndex, Mastra or the AI SDK? `checkAnswer` checks the answer your chain produced against the sources it was given, in the shape your framework returns them:
|
|
@@ -339,6 +345,8 @@ const results = await hybrid.retrieve({
|
|
|
339
345
|
console.log(results[0].id); // "err-4012"
|
|
340
346
|
```
|
|
341
347
|
|
|
348
|
+
On the BEIR SciFact benchmark, `BM25Search` alone matches the published BM25 baseline (nDCG@10 0.665); fusion helps when the vector side is a strong embedder, so weight the retrievers to suit. See [retrieval quality](https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks#retrieval-quality).
|
|
349
|
+
|
|
342
350
|
### Answer multi-part questions
|
|
343
351
|
|
|
344
352
|
`AgenticPipeline` splits compound questions into sub-queries, retrieves for each, and self-checks the answer against the sources before returning it.
|
|
@@ -464,22 +472,22 @@ The result of `run()` is:
|
|
|
464
472
|
|
|
465
473
|
## Capabilities
|
|
466
474
|
|
|
467
|
-
| Area | What you get
|
|
468
|
-
| ---------------- |
|
|
469
|
-
| **Chunking** | `ChunkingEngine` with sentence, fixed-size, recursive, semantic and structure-aware strategies
|
|
470
|
-
| **Retrieval** | `MemoryRetriever`, persistent `FileVectorStore`, `BM25Search`, `HybridRetriever` (Reciprocal Rank Fusion)
|
|
471
|
-
| **Reranking** | `ScoringReranker`, `EmbeddingReranker` (cached), `CascadeReranker`
|
|
472
|
-
| **Citations** | Per-sentence source mapping, hallucination report, numeric-consistency check
|
|
473
|
-
| **Evaluation** | Faithfulness, relevance, context precision, context recall (with a reference), groundedness, BLEU/ROUGE, semantic similarity with any embedder |
|
|
474
|
-
| **Integrations** | `checkAnswer` for answers from LangChain, LlamaIndex, Mastra or the AI SDK; `createAiSdkAdapter`
|
|
475
|
-
| **Caching** | Opt-in caches for query embeddings, retrieval and answers, in memory (`MemoryCache`) or Redis (`RedisCache`)
|
|
476
|
-
| **Testing** | `/testing` entry: offline `HashEmbedder`, `EchoLLM`, fixtures, `createTestPipeline()`; `validatePlugin` for plugin tests
|
|
477
|
-
| **Guardrails** | Injection detection with input normalisation, ACL and relevance filtering before generation, PII redaction
|
|
478
|
-
| **Agentic** | `QueryPlanner`, `IterativeRetriever`, `SelfCritiqueChecker`, `AgenticPipeline`
|
|
479
|
-
| **GraphRAG** | `KnowledgeGraph`, `EntityExtractor`, `GraphRetriever`
|
|
480
|
-
| **Streaming** | Token streaming with a final chunk carrying citations and evaluation; `SSEAdapter`, `WebSocketAdapter`
|
|
481
|
-
| **Cost** | `CostTracker`, `TokenBudget`, `CostCalculator` with sourced, overridable pricing
|
|
482
|
-
| **Operations** | `DevServer` HTTP API, `ExecutionTracer`, `AuditLogger`, MCP tool server (`MCPServer`)
|
|
475
|
+
| Area | What you get |
|
|
476
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
477
|
+
| **Chunking** | `ChunkingEngine` with sentence, fixed-size, recursive, semantic and structure-aware strategies |
|
|
478
|
+
| **Retrieval** | `MemoryRetriever`, persistent `FileVectorStore`, `PgVectorRetriever` (PostgreSQL), `QdrantRetriever`, `BM25Search`, `HybridRetriever` (Reciprocal Rank Fusion) |
|
|
479
|
+
| **Reranking** | `ScoringReranker`, `EmbeddingReranker` (cached), `CascadeReranker` |
|
|
480
|
+
| **Citations** | Per-sentence source mapping, hallucination report, numeric-consistency check |
|
|
481
|
+
| **Evaluation** | Faithfulness, relevance, context precision, context recall (with a reference), groundedness, BLEU/ROUGE, semantic similarity with any embedder; test sets with `validateDataset`, `runEvaluation`, `compareConfigurations`, `generateSyntheticDataset` and `rag-pipeline eval` |
|
|
482
|
+
| **Integrations** | `checkAnswer` for answers from LangChain, LlamaIndex, Mastra or the AI SDK; `createAiSdkAdapter` |
|
|
483
|
+
| **Caching** | Opt-in caches for query embeddings, retrieval and answers, in memory (`MemoryCache`) or Redis (`RedisCache`) |
|
|
484
|
+
| **Testing** | `/testing` entry: offline `HashEmbedder`, `EchoLLM`, fixtures, `createTestPipeline()`; `validatePlugin` for plugin tests |
|
|
485
|
+
| **Guardrails** | Injection detection with input normalisation, ACL and relevance filtering before generation, PII redaction |
|
|
486
|
+
| **Agentic** | `QueryPlanner`, `IterativeRetriever`, `SelfCritiqueChecker`, `AgenticPipeline` |
|
|
487
|
+
| **GraphRAG** | `KnowledgeGraph`, `EntityExtractor`, `GraphRetriever` |
|
|
488
|
+
| **Streaming** | Token streaming with a final chunk carrying citations and evaluation; `SSEAdapter`, `WebSocketAdapter` |
|
|
489
|
+
| **Cost** | `CostTracker`, `TokenBudget`, `CostCalculator` with sourced, overridable pricing |
|
|
490
|
+
| **Operations** | `DevServer` HTTP API, `ExecutionTracer`, `AuditLogger`, MCP tool server (`MCPServer`) |
|
|
483
491
|
|
|
484
492
|
## How it compares
|
|
485
493
|
|
|
@@ -509,6 +517,8 @@ Choose LangChain.js for the widest integration catalogue or work that goes well
|
|
|
509
517
|
| `OllamaConnector` | ✓ | ✓ | Local models, no key |
|
|
510
518
|
| `LocalEmbedder` | ✓ | | Offline TF-IDF, fitted to your corpus |
|
|
511
519
|
|
|
520
|
+
`PgVectorRetriever` and `QdrantRetriever` store and search documents in PostgreSQL with pgvector and in Qdrant ([vector stores](https://devilsdev.github.io/rag-pipeline-utils/docs/Concepts-Connectors#postgresql-with-pgvector)); `efSearch` trades pgvector query speed for recall. Their ingest speed, query latency and recall, measured in CI, are on the [Benchmarks page](https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks).
|
|
521
|
+
|
|
512
522
|
Vercel AI SDK models (any provider it supports) work as the embedder and LLM through `createAiSdkAdapter`; see [Use with other frameworks](https://devilsdev.github.io/rag-pipeline-utils/docs/Integrations).
|
|
513
523
|
|
|
514
524
|
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.
|
|
@@ -532,22 +542,23 @@ They are still exported from the main entry in 2.x with a one-time deprecation w
|
|
|
532
542
|
|
|
533
543
|
## Compatibility
|
|
534
544
|
|
|
535
|
-
| |
|
|
536
|
-
| -------------- |
|
|
537
|
-
| Node.js | 18, 20, 22 (Node 18 support ends with 3.0)
|
|
538
|
-
| Module formats | CommonJS (`require`) and ESM (`import`)
|
|
539
|
-
| TypeScript | Declarations for every export, including `/experimental
|
|
540
|
-
| Versioning | Semantic versioning with a deprecation window, see [SEMVER.md](SEMVER.md)
|
|
541
|
-
| Supply chain | Published from GitHub Actions with npm provenance
|
|
545
|
+
| | |
|
|
546
|
+
| -------------- | ---------------------------------------------------------------------------------------------------- |
|
|
547
|
+
| Node.js | 18, 20, 22 (Node 18 support ends with 3.0) |
|
|
548
|
+
| Module formats | CommonJS (`require`) and ESM (`import`) |
|
|
549
|
+
| TypeScript | Declarations for every export, including `/experimental`, compiled and run against the package in CI |
|
|
550
|
+
| Versioning | Semantic versioning with a deprecation window, see [SEMVER.md](SEMVER.md) |
|
|
551
|
+
| Supply chain | Published from GitHub Actions with npm provenance |
|
|
542
552
|
|
|
543
553
|
## Documentation
|
|
544
554
|
|
|
545
555
|
- [Documentation site](https://devilsdev.github.io/rag-pipeline-utils/): guides, API reference and deployment
|
|
546
556
|
- [CLI reference](https://devilsdev.github.io/rag-pipeline-utils/docs/CLI)
|
|
547
557
|
- [API reference](https://devilsdev.github.io/rag-pipeline-utils/docs/API-Reference)
|
|
558
|
+
- [Generated API reference](https://devilsdev.github.io/rag-pipeline-utils/docs/api): every export, with its methods, options and types
|
|
548
559
|
- [Evaluation guide](https://devilsdev.github.io/rag-pipeline-utils/docs/Evaluation)
|
|
549
560
|
- [Examples](examples/): basic pipeline, OpenAI with Pinecone, and a deployable Fastify service ([run the basic pipeline in your browser](https://stackblitz.com/github/DevilsDev/rag-pipeline-utils/tree/main/examples/basic-pipeline))
|
|
550
|
-
- [Changelog](CHANGELOG.md) and [
|
|
561
|
+
- [Changelog](CHANGELOG.md), [benchmark results](https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks) and [methodology](BENCHMARKS.md)
|
|
551
562
|
|
|
552
563
|
## Security
|
|
553
564
|
|