<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Devil's Dev</title>
    <description>The latest articles on DEV Community by Devil's Dev (@devildev).</description>
    <link>https://dev.to/devildev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4229856%2F54f9826f-7636-4ccf-b2dd-4ae9d0016f45.jpg</url>
      <title>DEV Community: Devil's Dev</title>
      <link>https://dev.to/devildev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devildev"/>
    <language>en</language>
    <item>
      <title>RAG Pipeline Utils v3.9.1: Warnings on the Edge No Longer Throw</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Tue, 10 Nov 2026 20:15:47 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v391-warnings-on-the-edge-no-longer-throw-2m1p</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v391-warnings-on-the-edge-no-longer-throw-2m1p</guid>
      <description>&lt;p&gt;A patch release: &lt;code&gt;/edge&lt;/code&gt; on Cloudflare Workers without &lt;code&gt;nodejs_compat&lt;/code&gt; no longer throws "process.emitWarning is not a function" for cached pipelines and cost estimates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install @devilsdev/rag-pipeline-utils@^3.9.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The edge fix
&lt;/h2&gt;

&lt;p&gt;This affects you if you import &lt;code&gt;@devilsdev/rag-pipeline-utils/edge&lt;/code&gt; in a&lt;br&gt;
Cloudflare Worker without the &lt;code&gt;nodejs_compat&lt;/code&gt; flag. Those Workers have no&lt;br&gt;
&lt;code&gt;process&lt;/code&gt; object, so where the library meant to warn you, it failed&lt;br&gt;
instead: a cached pipeline with a component that has no cache key failed&lt;br&gt;
its run, and &lt;code&gt;CostCalculator.estimate()&lt;/code&gt; for a model with no price threw.&lt;/p&gt;

&lt;p&gt;Now you get the warning in &lt;code&gt;console.warn&lt;/code&gt;, with its code, and the call&lt;br&gt;
carries on. The same goes for two other warnings: &lt;code&gt;AnthropicConnector&lt;/code&gt;&lt;br&gt;
sending a request again without a temperature the model rejects, and&lt;br&gt;
&lt;code&gt;GuardrailsPipeline&lt;/code&gt; when its retrieval guard was skipped. Nothing changes&lt;br&gt;
on Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  A new look
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/" rel="noopener noreferrer"&gt;docs site&lt;/a&gt; and the&lt;br&gt;
README have a new look, with new fonts and colours, and the&lt;br&gt;
&lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Comparison" rel="noopener noreferrer"&gt;Comparison page&lt;/a&gt;&lt;br&gt;
now lets you filter its table and compare one framework at a time.&lt;/p&gt;

&lt;p&gt;The scoped packages, &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt; and &lt;code&gt;create-rag-pipeline&lt;/code&gt;&lt;br&gt;
are released at 3.9.1 too, unchanged apart from the version.&lt;/p&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/v3.9.1/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-9-1-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.9.0: Catching Answers That Drop a Condition</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Tue, 10 Nov 2026 06:04:20 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v390-catching-answers-that-drop-a-condition-9d3</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v390-catching-answers-that-drop-a-condition-9d3</guid>
      <description>&lt;p&gt;Answer checks now catch an answer that drops its source's condition, and are much faster on long answers. Text from PDFs and web pages is read the way it was typed, and a 1,000-sentence answer is checked in under half a second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install @devilsdev/rag-pipeline-utils@^3.9.0
&lt;span class="c"&gt;# and, if you use the MCP server:&lt;/span&gt;
npx @devilsdev/rag-mcp-server@3.9.0 ./docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you install &lt;code&gt;@devilsdev/rag-core&lt;/code&gt;, &lt;code&gt;rag-guardrails&lt;/code&gt;, &lt;code&gt;rag-connectors&lt;/code&gt; or &lt;code&gt;rag-eval&lt;/code&gt; directly, upgrade them to 3.9.0 as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A condition left out is caught.&lt;/strong&gt; "Remote work is allowed two days
per week" is no longer grounded by "Remote work is allowed two days per
week with manager approval", and "Access is allowed" no longer by
"Access is allowed, but not for guests". The check reports
&lt;code&gt;condition_mismatch&lt;/code&gt;. Turn it off with &lt;code&gt;conditionCheck: false&lt;/code&gt;, or
&lt;code&gt;--no-condition-check&lt;/code&gt; on the CLI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text is read as typed.&lt;/strong&gt; Zero-width characters, soft hyphens,
full-width digits and no-break spaces are normalised before text is
compared, so a source copied from a PDF or a web page supports the
sentence that quotes it. Sentences end where a reader would end them:
"Dr. Lee" and "10 a.m." don't end one, and a list item does. Citation
markers such as &lt;code&gt;[1]&lt;/code&gt; and &lt;code&gt;¹&lt;/code&gt; no longer fail a correct sentence.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Long answers are checked in linear time.&lt;/strong&gt; Each source and answer is
prepared once per check, so a 1,000-sentence answer that took about 9 s
is checked in under half a second. The MCP server counts its input
limits the way the check does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stable scores across source sets.&lt;/strong&gt; A duplicated or unrelated source
no longer changes a verdict, and &lt;code&gt;computeFaithfulness&lt;/code&gt;, groundedness and
&lt;code&gt;PipelineEvaluator&lt;/code&gt; use the same word weights as &lt;code&gt;checkAnswer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fixes across the library.&lt;/strong&gt; The chunkers keep all their text;
&lt;code&gt;FileVectorStore&lt;/code&gt; scores are true cosine similarities, and a save merges
with what other processes saved; streams end with one complete done
chunk and honour &lt;code&gt;timeout&lt;/code&gt;; &lt;code&gt;CostTracker&lt;/code&gt; checks the budget before a
run; DAG node timeouts and concurrency take effect; and &lt;code&gt;AuditLogger&lt;/code&gt;
gains &lt;code&gt;close()&lt;/code&gt; and a working webhook.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  After upgrading
&lt;/h2&gt;

&lt;p&gt;Some changes need action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Re-tune &lt;code&gt;minRelevanceScore&lt;/code&gt; for &lt;code&gt;FileVectorStore&lt;/code&gt;.&lt;/strong&gt; Its scores are
now cosine similarity (1 for an identical vector); they used to grow with
the query vector's length.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-ingest&lt;/strong&gt; to pick up the chunker fixes. The &lt;code&gt;recursive&lt;/code&gt; (default),
&lt;code&gt;fixed-size&lt;/code&gt; and &lt;code&gt;sentence&lt;/code&gt; chunkers no longer drop or split text, so
chunks can change.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raise &lt;code&gt;timeout&lt;/code&gt; if you stream long answers.&lt;/strong&gt; A run's timeout now
covers a returned stream until it ends.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Regenerate saved baselines&lt;/strong&gt; that compare multi-source scores or
hallucination classes. Scores move for answers checked against several
sources, and hallucination classes change in many cases while rates and
verdicts don't.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benchmarks
&lt;/h2&gt;

&lt;p&gt;On the condition-dropped benchmark, F1 on the test split is 85.9% lexical&lt;br&gt;
and 90.1% with a Claude judge on the released code. On the public RAGTruth&lt;br&gt;
and HaluEval sets, F1 moved by at most 0.01: the stricter condition check&lt;br&gt;
adds a few false alarms on RAGTruth, and HaluEval has three more misses.&lt;br&gt;
Every number, including those that got worse, is on the&lt;br&gt;
&lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks" rel="noopener noreferrer"&gt;Benchmarks page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Known gaps
&lt;/h2&gt;

&lt;p&gt;The condition check is deliberately narrow. A negated contrast with no&lt;br&gt;
scope word ("but not guests", "but guests are not admitted") is not yet&lt;br&gt;
read as a restriction, and neither is a restriction attached to a&lt;br&gt;
different subject ("Staff may enter" against "Guests may enter, but staff&lt;br&gt;
need approval"). 3.10 plans restrictions that follow their subject, which&lt;br&gt;
covers these cases.&lt;/p&gt;

&lt;p&gt;Thanks to the readers whose reports shaped this release.&lt;/p&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/v3.9.0/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;, and the release notes are on &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v3.9.0" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-9-0-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.8.3: A Clearer npm Page (No Code Changes)</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Sun, 08 Nov 2026 22:05:13 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v383-a-clearer-npm-page-no-code-changes-41hc</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v383-a-clearer-npm-page-no-code-changes-41hc</guid>
      <description>&lt;p&gt;Documentation and package metadata only; no code changes. The security fixes are in 3.8.2: if you're on 3.8.1 or earlier, upgrade for them (see the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/releases/tag/v3.8.2" rel="noopener noreferrer"&gt;v3.8.2 release&lt;/a&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils@^3.8.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;p&gt;The npm page is the first thing most people see, so this release makes it&lt;br&gt;
say what the library does in one line:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;RAG for Node.js that tells you when your LLM is making things up.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That line is now the README headline, the npm description and the text of&lt;br&gt;
the banner, which no longer repeats the package name under the heading.&lt;/p&gt;

&lt;p&gt;The package also lists the keywords people search for when they look for&lt;br&gt;
this kind of check: &lt;code&gt;hallucination&lt;/code&gt;, &lt;code&gt;hallucination-detection&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;grounding&lt;/code&gt;, &lt;code&gt;fact-checking&lt;/code&gt;, &lt;code&gt;mcp&lt;/code&gt;, &lt;code&gt;vercel-ai-sdk&lt;/code&gt;, &lt;code&gt;mastra&lt;/code&gt; and&lt;br&gt;
&lt;code&gt;langchain&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And the "Take only what you need" table now gives the installed size of&lt;br&gt;
every package, from under 1 MB for &lt;code&gt;create-rag-pipeline&lt;/code&gt; to about 34 MB for&lt;br&gt;
the main package, so you can pick the smallest one that does the job.&lt;/p&gt;

&lt;p&gt;The scoped packages, &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt; and &lt;code&gt;create-rag-pipeline&lt;/code&gt;&lt;br&gt;
are released at 3.8.3 too, unchanged apart from the version.&lt;/p&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/v3.8.3/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-8-3-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.8.2: Security Fixes and a Re-ingest Check</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Sun, 08 Nov 2026 20:59:22 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v382-security-fixes-and-a-re-ingest-check-30md</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v382-security-fixes-and-a-re-ingest-check-30md</guid>
      <description>&lt;p&gt;A security release. Upgrade now if you use the vector-store retrievers (&lt;code&gt;QdrantRetriever&lt;/code&gt;, &lt;code&gt;PineconeRetriever&lt;/code&gt;, &lt;code&gt;WeaviateRetriever&lt;/code&gt;, &lt;code&gt;PgVectorRetriever&lt;/code&gt;) or &lt;code&gt;HybridRetriever&lt;/code&gt; with access control, &lt;code&gt;GuardrailsPipeline&lt;/code&gt;, plugins from &lt;code&gt;.ragrc.json&lt;/code&gt; or &lt;code&gt;hub install&lt;/code&gt;, &lt;code&gt;AuditLogger&lt;/code&gt;, &lt;code&gt;DevServer&lt;/code&gt; or &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt;, and re-ingest vector-store documents whose &lt;code&gt;acl&lt;/code&gt; or &lt;code&gt;requiredRole&lt;/code&gt; is set at the top level. Some changes in access control can hide documents that were visible before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils@^3.8.2
&lt;span class="c"&gt;# and, if you use the MCP server:&lt;/span&gt;
npx @devilsdev/rag-mcp-server@3.8.2 ./docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you install &lt;code&gt;@devilsdev/rag-core&lt;/code&gt;, &lt;code&gt;rag-guardrails&lt;/code&gt;, &lt;code&gt;rag-connectors&lt;/code&gt; or &lt;code&gt;rag-eval&lt;/code&gt; directly, upgrade them to 3.8.2 as well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;Five advisories are fixed in this release. Each one lists the affected&lt;br&gt;
versions and workarounds for anyone who can't upgrade yet.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access control in the vector stores and &lt;code&gt;HybridRetriever&lt;/code&gt;&lt;/strong&gt;
(&lt;code&gt;RetrievalGuard&lt;/code&gt; with &lt;code&gt;enforceACL&lt;/code&gt;): a document whose &lt;code&gt;acl&lt;/code&gt; or
&lt;code&gt;requiredRole&lt;/code&gt; was set at its top level could be returned to users
without the role when it was stored in &lt;code&gt;QdrantRetriever&lt;/code&gt;,
&lt;code&gt;PineconeRetriever&lt;/code&gt;, &lt;code&gt;WeaviateRetriever&lt;/code&gt; or &lt;code&gt;PgVectorRetriever&lt;/code&gt;, or
merged by &lt;code&gt;HybridRetriever&lt;/code&gt;. This completes the 3.8.1 fix for the
built-in stores.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-234f-v76m-p9wc" rel="noopener noreferrer"&gt;GHSA-234f-v76m-p9wc&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GuardrailsPipeline&lt;/code&gt;&lt;/strong&gt;: streamed answers skipped the output checks
(PII redaction, groundedness and length checks, strict-mode blocking), a
blocked answer's text could still be returned in its guard summary, and
with some custom pipelines the retrieval guard silently didn't run.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-whr9-r3mv-2565" rel="noopener noreferrer"&gt;GHSA-whr9-r3mv-2565&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugins&lt;/strong&gt;: plugins listed in &lt;code&gt;.ragrc.json&lt;/code&gt; were loaded without the
documented signature verification, and &lt;code&gt;hub install&lt;/code&gt;'s checks could miss
a plugin's entry file and ran its contract check with your full
environment, credentials included.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-m9gh-5x7v-rqj2" rel="noopener noreferrer"&gt;GHSA-m9gh-5x7v-rqj2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Denial of service and the dev server&lt;/strong&gt;: some inputs made text checks,
plugin archive extraction and the MCP server's tools take seconds to
minutes of CPU time, and a &lt;code&gt;DevServer&lt;/code&gt; bound to all interfaces skipped
its Host-header check for requests from the local machine.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-4jh4-qv86-j2gw" rel="noopener noreferrer"&gt;GHSA-4jh4-qv86-j2gw&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;AuditLogger&lt;/code&gt;&lt;/strong&gt;: deleted, reordered or truncated audit records weren't
detected, and a missing tenant filter could return other tenants'
events.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-89fq-598q-39wc" rel="noopener noreferrer"&gt;GHSA-89fq-598q-39wc&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  After upgrading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Re-ingest vector-store documents with top-level restrictions.&lt;/strong&gt;
&lt;code&gt;QdrantRetriever&lt;/code&gt;, &lt;code&gt;PineconeRetriever&lt;/code&gt;, &lt;code&gt;WeaviateRetriever&lt;/code&gt; and
&lt;code&gt;PgVectorRetriever&lt;/code&gt; now store a document's top-level &lt;code&gt;acl&lt;/code&gt; and
&lt;code&gt;requiredRole&lt;/code&gt;. Documents stored by earlier versions were saved without
them, so upgrading alone doesn't restrict those documents. See
&lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Security#do-i-need-to-re-ingest" rel="noopener noreferrer"&gt;Do I need to re-ingest?&lt;/a&gt;
to check a store. Thanks to a reader for suggesting the re-ingest check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upgrading from 3.8.0 or earlier?&lt;/strong&gt; Also re-ingest &lt;code&gt;FileVectorStore&lt;/code&gt;
indexes whose documents set &lt;code&gt;acl&lt;/code&gt; or &lt;code&gt;requiredRole&lt;/code&gt; at the top level
(fixed in 3.8.1).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Changed
&lt;/h2&gt;

&lt;p&gt;Some of these change behaviour:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;HybridRetriever&lt;/code&gt; keeps the restrictions of every copy of a document&lt;/strong&gt;
it merges, which can hide documents that were visible before. The role
&lt;code&gt;rag:no-access&lt;/code&gt; is reserved: it restricts a document to no one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;GuardrailsPipeline&lt;/code&gt;&lt;/strong&gt; buffers streamed answers when a post-generation
guard is set and releases them as one chunk after the check, returns
blocked results without text, and withholds results the retrieval guard
couldn't check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugins configured in &lt;code&gt;.ragrc.json&lt;/code&gt; are verified before they load&lt;/strong&gt;;
unsigned plugins still load, with a one-time warning, unless you set
&lt;code&gt;requireSignedPlugins&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;hub install&lt;/code&gt; scans more and passes less&lt;/strong&gt;, and &lt;code&gt;hub certify&lt;/code&gt; scans the
entry file the same way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt; limits tool inputs and check time.&lt;/strong&gt; Each
limit can be raised with a CLI flag or environment variable (see the
package README).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;DevServer&lt;/code&gt; checks the &lt;code&gt;Host&lt;/code&gt; header of loopback requests&lt;/strong&gt; whatever it
is bound to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;AuditLogger&lt;/code&gt; chains and verifies its records&lt;/strong&gt;, stores a signing key
when none is configured, and validates tenant filters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/v3.8.2/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-8-2-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.8.1</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Sat, 07 Nov 2026 05:30:55 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v381-3pl2</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v381-3pl2</guid>
      <description>&lt;p&gt;A security release. Upgrade now if you use &lt;code&gt;RetrievalGuard&lt;/code&gt; access control, plugin signature verification, the development server (&lt;code&gt;DevServer&lt;/code&gt;) or &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt;, and re-ingest &lt;code&gt;FileVectorStore&lt;/code&gt; indexes whose documents set &lt;code&gt;acl&lt;/code&gt; or &lt;code&gt;requiredRole&lt;/code&gt; at the top level. One change in access control can hide documents that were visible before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils@^3.8.1
&lt;span class="c"&gt;# and, if you use the MCP server:&lt;/span&gt;
npx @devilsdev/rag-mcp-server@3.8.1 ./docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Security
&lt;/h2&gt;

&lt;p&gt;Four advisories are fixed in this release. Each one lists the affected&lt;br&gt;
versions and workarounds for anyone who can't upgrade yet.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access control&lt;/strong&gt; (&lt;code&gt;RetrievalGuard&lt;/code&gt; with &lt;code&gt;enforceACL&lt;/code&gt;, and the built-in
&lt;code&gt;MemoryRetriever&lt;/code&gt;, &lt;code&gt;FileVectorStore&lt;/code&gt; and &lt;code&gt;BM25Search&lt;/code&gt;): a document
restricted to a role could be passed to users without that role,
depending on where the restriction was set on the document and how the
user's permissions were passed in.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-8393-cmg7-9rv3" rel="noopener noreferrer"&gt;GHSA-8393-cmg7-9rv3&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plugin signatures&lt;/strong&gt; (&lt;code&gt;PluginSignatureVerifier&lt;/code&gt; with
&lt;code&gt;requireContentDigest: true&lt;/code&gt;): a crafted plugin manifest could pass
verification for code its signer never approved.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-w693-22gp-m69r" rel="noopener noreferrer"&gt;GHSA-w693-22gp-m69r&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The development server&lt;/strong&gt; (&lt;code&gt;DevServer&lt;/code&gt;): in some setups it could be
reached from the network, or by other web pages open in your browser,
which could then run queries on your LLM provider's credits.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-6h47-g8cw-366q" rel="noopener noreferrer"&gt;GHSA-6h47-g8cw-366q&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The MCP server&lt;/strong&gt; (&lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt;): a crafted HTML file in
an indexed folder could stall indexing for minutes.
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/security/advisories/GHSA-j2vr-gm7f-3r37" rel="noopener noreferrer"&gt;GHSA-j2vr-gm7f-3r37&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  After upgrading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Re-ingest &lt;code&gt;FileVectorStore&lt;/code&gt; indexes whose documents set &lt;code&gt;acl&lt;/code&gt; or
&lt;code&gt;requiredRole&lt;/code&gt; at the top level&lt;/strong&gt; (not in &lt;code&gt;metadata&lt;/code&gt;). Index files
written by earlier versions don't contain that field, so upgrading alone
doesn't restrict those documents. Documents with the restriction in
&lt;code&gt;metadata&lt;/code&gt;, and the in-memory stores (&lt;code&gt;MemoryRetriever&lt;/code&gt;, &lt;code&gt;BM25Search&lt;/code&gt;),
need no action beyond upgrading.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;RetrievalGuard&lt;/code&gt; now requires every restriction a document sets.&lt;/strong&gt; A
document can set &lt;code&gt;requiredRole&lt;/code&gt; or &lt;code&gt;acl&lt;/code&gt; at its top level, in &lt;code&gt;metadata&lt;/code&gt;
and on &lt;code&gt;doc&lt;/code&gt;; access now requires meeting each one that is set (any one
role of a list is enough for that list). This can hide documents that
were visible before.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/v3.8.1/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-8-1-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.8: Testing RAG Answers in TypeScript</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Fri, 06 Nov 2026 10:07:03 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v38-testing-rag-answers-in-typescript-4dle</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v38-testing-rag-answers-in-typescript-4dle</guid>
      <description>&lt;p&gt;v3.8.0 is about testing RAG in TypeScript. The answer matchers now compile with types, and a new guide walks through the whole setup with Vitest, from a unit test to a test set that fails CI when answers get worse. Nothing breaks for existing code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils@^3.8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The matchers, with types
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;@devilsdev/rag-pipeline-utils/testing&lt;/code&gt; has had three matchers for a while: &lt;code&gt;toBeGroundedIn&lt;/code&gt; (every sentence of the answer is supported by its sources, numbers and negation included), &lt;code&gt;toCite&lt;/code&gt; and &lt;code&gt;toContainNoPII&lt;/code&gt;. They worked in JavaScript. In TypeScript, &lt;code&gt;expect(result).toBeGroundedIn()&lt;/code&gt; didn't compile, because nothing told TypeScript the matchers existed. Worse, the declaration our own Testing page suggested failed under Vitest 5 with "All declarations of 'Assertion' must have identical type parameters".&lt;/p&gt;

&lt;p&gt;3.8.0 exports their signatures as &lt;code&gt;RagMatchers&lt;/code&gt;. Add them to Vitest's &lt;code&gt;Matchers&lt;/code&gt; once, in a declaration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;RagMatchers&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@devilsdev/rag-pipeline-utils/testing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="kr"&gt;module&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Matchers&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;RagMatchers&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;R&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the matchers type-check like any other assertion. A misspelled matcher is an error, and so is a wrong argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;expect(answer).toCite(123)
Argument of type 'number' is not assignable to parameter of type 'string | string[]'.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Jest works the same way, with &lt;code&gt;jest.Matchers&amp;lt;R&amp;gt;&lt;/code&gt;; the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Testing#matchers-in-typescript" rel="noopener noreferrer"&gt;Testing page&lt;/a&gt; has both.&lt;/p&gt;

&lt;h2&gt;
  
  
  A guide: Testing RAG in TypeScript
&lt;/h2&gt;

&lt;p&gt;RAG code rarely fails loudly: someone changes the chunk size, the prompt or the model, everything still runs, and an answer quietly says thirty days where the document says twenty. The new guide sets up a project that catches that, in three layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unit tests&lt;/strong&gt; with the typed matchers, on an offline test pipeline: deterministic, no API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer checks&lt;/strong&gt; with &lt;code&gt;checkAnswer&lt;/code&gt;, which return the exact sentence the sources don't support, for answers from any framework.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A test set&lt;/strong&gt; scored by &lt;code&gt;rag-pipeline eval&lt;/code&gt;, with minimums or a baseline from your main branch, failing the build when scores drop.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;a wrong number is caught&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sources&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;pageContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-time employees receive twenty days of paid vacation per year.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-time employees receive thirty days of paid vacation per year.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;not&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBeGroundedIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sources&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;check&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkAnswer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sources&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;grounded&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unsupported&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toEqual&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The guide is built from a runnable project, &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/tree/main/examples/testing-typescript" rel="noopener noreferrer"&gt;examples/testing-typescript&lt;/a&gt;. A test keeps the two identical. Before each release, a check installs the packed package with the latest Vitest and TypeScript, then type-checks the project, runs its tests and runs its evaluation, so the code in the guide works as written. &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Testing-RAG-TypeScript" rel="noopener noreferrer"&gt;Read the guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Releases announce themselves.&lt;/strong&gt; This post reached you through it: publishing a release now posts to GitHub Discussions, dev.to, Bluesky and Mastodon, built from the release notes and this blog post. Every post passes checks first: each number must appear in the files it came from, and each link must be live.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fewer development dependencies.&lt;/strong&gt; Eight unused OpenTelemetry SDK packages and three modules nothing loaded are gone, 237 packages in all. &lt;code&gt;npm audit&lt;/code&gt; findings in development tooling fell from 64 to 14, none high. What you install from npm had none and still has none.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scoped packages, &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt; and &lt;code&gt;create-rag-pipeline&lt;/code&gt; are released at 3.8.0 too. Full details: &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/main/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-8-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Meet rag-pipeline-utils: RAG for Node.js that tells you when your LLM is making things up</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Fri, 06 Nov 2026 07:53:38 +0000</pubDate>
      <link>https://dev.to/devildev/meet-rag-pipeline-utils-rag-for-nodejs-that-tells-you-when-your-llm-is-making-things-up-4o3n</link>
      <guid>https://dev.to/devildev/meet-rag-pipeline-utils-rag-for-nodejs-that-tells-you-when-your-llm-is-making-things-up-4o3n</guid>
      <description>&lt;p&gt;Your RAG chatbot just told an employee they get &lt;strong&gt;thirty&lt;/strong&gt; vacation days. The handbook it retrieved says &lt;strong&gt;twenty&lt;/strong&gt;. Nothing crashed, no test failed, and the answer reads perfectly well. That's how retrieval-augmented generation usually breaks: quietly.&lt;/p&gt;

&lt;p&gt;I maintain &lt;a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils" rel="noopener noreferrer"&gt;&lt;code&gt;@devilsdev/rag-pipeline-utils&lt;/code&gt;&lt;/a&gt;, an open-source RAG library for Node.js built around one idea: &lt;strong&gt;you should be able to check every answer against the sources it came from&lt;/strong&gt;, cheaply, in your app and in CI. This post is a quick tour.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Node.js 22+, with CommonJS, ESM and TypeScript types included.&lt;/p&gt;

&lt;h2&gt;
  
  
  Catch the made-up sentence
&lt;/h2&gt;

&lt;p&gt;You don't have to build your pipeline with this library to use it. Bring an answer from anywhere (LangChain, Mastra, the Vercel AI SDK, LlamaIndex or your own code) and pass it in with the sources it was given:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;checkAnswer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@devilsdev/rag-pipeline-utils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;check&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;checkAnswer&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-time employees receive thirty days of paid vacation per year. &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Remote work is allowed two days per week.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;sources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;pageContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-time employees receive twenty days of paid vacation per year.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;pageContent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Remote work is allowed two days per week with manager approval.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;grounded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;groundedness&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 0.5&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;check&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;unsupported&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// ["Full-time employees receive thirty days of paid vacation per year."]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It checks each sentence against the sources: the words, but also the numbers and the negations, which is where answers tend to go wrong. It runs locally with no API key and makes no model calls, so the same input gives the same verdict every time, offline, in tests.&lt;/p&gt;

&lt;p&gt;If you're worried about correct paraphrases being flagged, pass a &lt;code&gt;judge&lt;/code&gt; and your LLM is asked about the sentences that failed on wording alone, and nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  A pipeline in a dozen lines
&lt;/h2&gt;

&lt;p&gt;If you do want the library to run the pipeline, &lt;code&gt;createRagPipeline()&lt;/code&gt; wires an embedder, a retriever, an optional reranker and an LLM. This one runs offline, with the built-in TF-IDF embedder and an in-memory store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;createRagPipeline&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;LocalEmbedder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MemoryRetriever&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@devilsdev/rag-pipeline-utils&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;docs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vacation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Full-time employees get twenty vacation days.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;remote&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Remote work is allowed two days per week.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;embedder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LocalEmbedder&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;embedder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;train&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;docs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;retriever&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MemoryRetriever&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;retriever&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;docs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;vector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;embedder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;embed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;})),&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createRagPipeline&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;embedder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;retriever&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;How many vacation days?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "vacation"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Swap in OpenAI, Anthropic, Cohere or Ollama for the model, and pgvector, Qdrant, Pinecone or Weaviate for the store, when you're ready. Anything with an &lt;code&gt;embed()&lt;/code&gt; or &lt;code&gt;generate()&lt;/code&gt; method works too, including Vercel AI SDK models.&lt;/p&gt;

&lt;p&gt;Prefer to start from a working app? &lt;code&gt;npm create rag-pipeline@latest&lt;/code&gt; scaffolds one for Next.js with the AI SDK, Mastra, or Cloudflare Workers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test answers like any other value
&lt;/h2&gt;

&lt;p&gt;RAG regressions don't throw. Someone changes the chunk size, the prompt, the model or the embedder, everything still runs, and the answers drift. So the library ships offline test helpers and matchers for Jest and Vitest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vitest&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// or Jest's global expect&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;createTestPipeline&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;ragMatchers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@devilsdev/rag-pipeline-utils/testing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ragMatchers&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;answers vacation questions from the handbook&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestPipeline&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;How many vacation days do I get?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toBeGroundedIn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// every sentence supported by result.results&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toCite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vacation&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toContainNoPII&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For whole test sets there's a CLI: &lt;code&gt;rag-pipeline eval&lt;/code&gt; scores a dataset and fails when answers get worse than a saved baseline, and the &lt;a href="https://github.com/DevilsDev/rag-eval-action" rel="noopener noreferrer"&gt;rag-eval-action&lt;/a&gt; GitHub Action runs it on every pull request and posts the comparison as a comment.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else is in the box
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Framework integrations.&lt;/strong&gt; &lt;code&gt;groundingMiddleware&lt;/code&gt; adds retrieval and grounding to any Vercel AI SDK model without changing the rest of your code; there are scorers and guardrails for Mastra.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Guardrails.&lt;/strong&gt; Prompt-injection detection and PII redaction, with &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/docs/Benchmarks#guardrail-accuracy" rel="noopener noreferrer"&gt;published precision and recall&lt;/a&gt;, plus access-control filtering before anything reaches the model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Production details.&lt;/strong&gt; Hybrid search, reranking, token budgets, timeouts and cancellation, retries, caching, and OpenTelemetry (or Langfuse) traces with the evaluation scores attached.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The edge.&lt;/strong&gt; A &lt;code&gt;/edge&lt;/code&gt; build for Cloudflare Workers, Vercel Edge and Deno.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude, via MCP.&lt;/strong&gt; &lt;code&gt;@devilsdev/rag-mcp-server&lt;/code&gt; lets Claude search a folder of your documents and check its own answers against them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Take only what you need.&lt;/strong&gt; The main package has everything; smaller packages like &lt;code&gt;@devilsdev/rag-eval&lt;/code&gt; (about 6 MB installed) are there if install size matters.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The fastest way in is the answer check on &lt;a href="https://stackblitz.com/github/DevilsDev/rag-pipeline-utils/tree/main/examples/use-cases?file=check-your-answer.js" rel="noopener noreferrer"&gt;StackBlitz&lt;/a&gt;: paste an answer of your own, with no install or API key.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://devilsdev.github.io/rag-pipeline-utils/" rel="noopener noreferrer"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/DevilsDev/rag-pipeline-utils" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; (issues and ideas welcome, and a star helps other developers find it)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils" rel="noopener noreferrer"&gt;npm&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear how you test your RAG apps today, and what you'd want a library like this to catch. Tell me in the comments.&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
    <item>
      <title>RAG Pipeline Utils v3.7.1: Security Fixes From a Code-Scanning Review, and a New npm Page</title>
      <dc:creator>Devil's Dev</dc:creator>
      <pubDate>Fri, 06 Nov 2026 07:44:06 +0000</pubDate>
      <link>https://dev.to/devildev/rag-pipeline-utils-v371-security-fixes-from-a-code-scanning-review-and-a-new-npm-page-4bko</link>
      <guid>https://dev.to/devildev/rag-pipeline-utils-v371-security-fixes-from-a-code-scanning-review-and-a-new-npm-page-4bko</guid>
      <description>&lt;p&gt;v3.7.1 is a patch release with no breaking changes. It fixes a slow pattern in &lt;code&gt;QueryPlanner&lt;/code&gt; that a long query could use to tie up a server, and two ways a crafted &lt;code&gt;__proto__&lt;/code&gt; key could write to &lt;code&gt;Object.prototype&lt;/code&gt; in the CLI. It also gives the npm page a new README. Upgrading is recommended if you pass user queries to &lt;code&gt;QueryPlanner&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @devilsdev/rag-pipeline-utils@^3.7.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How these were found
&lt;/h2&gt;

&lt;p&gt;Main had 52 open code-scanning alerts from CodeQL and OpenSSF Scorecard, most of them old. We went through every one of them against the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;timed each slow-pattern alert;&lt;/li&gt;
&lt;li&gt;reproduced each prototype-pollution alert;&lt;/li&gt;
&lt;li&gt;checked whether the flagged code is actually shipped in the published package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;19 are fixed in this release:&lt;/strong&gt; the code issues below, plus Docker image pins and tighter workflow permissions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;27 were false alarms,&lt;/strong&gt; and each was dismissed on GitHub with its reason. Examples: modules that aren't in the published package, test fixtures with attack strings, and a random session label that was never a secret.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The 6 still open&lt;/strong&gt; are repository settings (code review, branch protection, fuzzing) or an example that has no lockfile on purpose.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;QueryPlanner&lt;/code&gt; and long runs of spaces
&lt;/h2&gt;

&lt;p&gt;CodeQL flagged &lt;code&gt;QueryPlanner&lt;/code&gt;'s &lt;code&gt;;&lt;/code&gt; pattern as slow on long input. Timing the whole &lt;code&gt;plan()&lt;/code&gt; call found a worse one it hadn't flagged:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pattern for "…, and how …" clauses was &lt;strong&gt;cubic&lt;/strong&gt; in the length of a run of spaces: 4,000 spaces took 21 seconds, and 20,000 didn't finish within a minute.&lt;/li&gt;
&lt;li&gt;The "vs" and comparison patterns were quadratic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;QueryPlanner&lt;/code&gt; is exported from the main entry and from &lt;code&gt;/edge&lt;/code&gt;, and it's given user queries, so one long query could hold a server's CPU.&lt;/p&gt;

&lt;p&gt;The planner now reads each run of whitespace as one space before matching, and the clause boundaries can split a run only one way. On every query in the test suite and the edge cases we added, it splits exactly as before, and 200,000 characters of any shape we tried plan in under 100 ms. The one visible change: a sub-query has single spaces where the query had runs of whitespace.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;__proto__&lt;/code&gt; in the CLI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;rag-pipeline plugin install&lt;/code&gt;.&lt;/strong&gt; A plugin whose &lt;code&gt;package.json&lt;/code&gt; declared &lt;code&gt;"stage": "__proto__"&lt;/code&gt; passed the stage check, and registering it wrote to &lt;code&gt;Object.prototype&lt;/code&gt; in the CLI process. Only the stage names the installer knows are accepted now.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;rag-pipeline config set&lt;/code&gt;.&lt;/strong&gt; The key path was checked, but a &lt;code&gt;__proto__&lt;/code&gt; key inside the JSON value was merged into &lt;code&gt;Object.prototype&lt;/code&gt;. Such keys are skipped now, and the merge only goes into the config's own objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both fixes come with regression tests that fail on 3.7.0.&lt;/p&gt;

&lt;h2&gt;
  
  
  A new README on npm
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils" rel="noopener noreferrer"&gt;npm page&lt;/a&gt; now speaks to developers meeting the library for the first time. It opens with the problem the library solves, an answer that says thirty vacation days when the source says twenty, and shows &lt;code&gt;checkAnswer&lt;/code&gt; catching exactly that sentence. Then a pipeline in a dozen lines, and what else is in the box. Both examples run in CI, so they stay correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Also
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;eval&lt;/code&gt; Markdown report escapes backslashes, so an error message containing &lt;code&gt;\|&lt;/code&gt; no longer breaks a table cell.&lt;/li&gt;
&lt;li&gt;Docker base images are pinned by digest, and Dependabot keeps those digests current.&lt;/li&gt;
&lt;li&gt;The Security and Supply Chain workflows are read-only by default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full list is in the &lt;a href="https://github.com/DevilsDev/rag-pipeline-utils/blob/main/CHANGELOG.md" rel="noopener noreferrer"&gt;CHANGELOG&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://devilsdev.github.io/rag-pipeline-utils/blog/v3-7-1-release" rel="noopener noreferrer"&gt;rag-pipeline-utils blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>ai</category>
      <category>rag</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
