Repository navigation
A minor release with no breaking changes. The grounding check now catches answers that contradict their source, and the checks come to the tools you already use.
npm install @devilsdev/rag-pipeline-utils@^3.3.0Highlights
- Grounding catches negation. "Full-time employees never receive paid vacation" is no longer grounded by a source that says they get twenty days. Each sentence is compared with the closest source sentence;
checkAnswer, the evaluation metrics,rag-pipeline evaland the guardrails all use it, andcheckPolarityConsistencyexposes it. Some answers that passed before now fail, on purpose. Evaluation - AI SDK middleware.
wrapLanguageModel({ model, middleware: groundingMiddleware({ retriever }) })adds retrieval, answer checks and guardrails to any Vercel AI SDK model.generateTextandstreamTextstay as they are; the report is inproviderMetadata.ragPipelineand the passages insources. Tested with AI SDK 6 and 7. Middleware - Matchers for Jest and Vitest.
expect.extend(ragMatchers)from/testingaddstoBeGroundedIn,toCiteandtoContainNoPII. Matchers - Mastra.
createMastraScorerturns the metrics into Mastra scorers that make no model calls;createMastraGuardrailsis a processor that stops a run on prompt injection and redacts PII. Mastra - Coming from LlamaIndex.TS. LlamaIndex.TS is deprecated. The comparison now covers LangChain.js, Mastra and the AI SDK, and a migration guide maps its concepts.
Also
- Issue templates and a Community plugins section.
- Development dependencies updated (88 of 99 Dependabot alerts closed); the published package still installs with no known vulnerabilities.
The four scoped packages (@devilsdev/rag-core, -connectors, -eval, -guardrails) are released at 3.3.0 too. Full details: CHANGELOG · Blog post