Repository navigation
v3.5.0
A minor release with no breaking changes. The guards take your own detectors and their accuracy is published, evaluation scores reach OpenTelemetry and Langfuse, and verifyCitations() checks the citations Claude and OpenAI return.
npm install @devilsdev/rag-pipeline-utils@^3.5.0Security
- Connector errors no longer carry the API key. On 3.4.0 and earlier, a failed call through
AnthropicConnector,CohereConnectororOllamaConnector(a wrong key, an unknown model, a network error) threw an axios error that kept the request headers, soconsole.error(err)or an error reporter printed the API key. Errors are now plainErrors withstatus,codeand the API's response, and their message says what the API said.OpenAIConnectorwas not affected. If your logs may hold such errors, rotate the key.
Highlights
- Pluggable guard detectors.
PreRetrievalGuard,RetrievalGuardandPostGenerationGuardtakedetectors(an injection classifier, a PII service), with the built-in patterns or instead of them (builtIn: false). Async detectors run through the newcheckAsync()/filterAsync(); a detector that throws blocks by default. Detectors - Measured guardrails.
rag-pipeline eval-guardrails <cases.jsonl>andevaluateDetectors()report precision, recall, F1 and confusion counts per detector, and fail CI below a--min. The Benchmarks page publishes the patterns' numbers, and a classifier's for comparison, on public test sets. Guardrail accuracy - Scores in OpenTelemetry and Langfuse. With
telemetryon, each evaluation score is agen_ai.evaluation.resultevent parented to the span it judges;result.telemetrycarries the ids, andtoLangfuseScores(result)returnslangfuse.score.create()objects. No new dependency. Observability - Verify provider citations.
fromAnthropicCitations()andfromOpenAIFileCitations()normalise a model's citations, andverifyCitations()checks each claim against the passages it cites, with number and negation checks and the optional judge. Citations
Fixed
AnthropicConnectorworks with current Claude models. On 3.4.0 the LLM judge failed with HTTP 400 on Claude Haiku 5.5, Sonnet 5.5 (the connector's default), Opus 5.5 and Fable 5.1, which reject the judge'stemperature: 0, andgenerate()returnedundefinedwhen a model thought before answering. The connector now retries withouttemperature(with a warning), returns every text block, rejects a refusal withcode: "MODEL_REFUSED", andgenerateWithUsage()reports tokens. Found by the new Claude benchmarks.CostTrackerandcreateModelRouterprice Claude Haiku 5.5 and Fable 5.1 (they reported $0), andCostTracker's estimate counts the retrieved passages, not just the query (it was about 25 times too low).- The TypeScript declarations compile with
@types/node25 and later. - A strict
GuardrailsPipelineblock'serrorsays why.
Changed
- The retrieval span is named
retrievalwith kind internal, per the OpenTelemetry GenAI conventions (it wasretrieval <data source>, kind client); only pgvector and Qdrant spans change name. SEMVER.md now states that telemetry may follow those conventions in minor releases, each change listed in the CHANGELOG.
The scoped packages (@devilsdev/rag-core, -connectors, -eval, -guardrails) and @devilsdev/rag-mcp-server are released at 3.5.0 too. Full details: CHANGELOG · Blog post