@devilsdev/rag-pipeline-utils 2.3.0 → 2.4.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/README.md +293 -361
- package/contracts/loader-contract.json +11 -6
- package/contracts/reranker-contract.json +18 -26
- package/dist/index.cjs +21190 -47
- package/dist/index.d.ts +298 -68
- package/dist/index.mjs +9 -76
- package/package.json +20 -8
- package/src/agentic/agentic-pipeline.js +235 -0
- package/src/agentic/iterative-retriever.js +213 -0
- package/src/agentic/query-planner.js +208 -0
- package/src/agentic/self-critique.js +102 -0
- package/src/ai/adaptive-retrieval.js +0 -3
- package/src/ai/federated-learning.js +0 -3
- package/src/ai/federation.js +1 -6
- package/src/ai/index.js +9 -20
- package/src/ai/model-training.js +0 -3
- package/src/ai/multimodal-processing.js +0 -3
- package/src/ai/multimodal.js +1 -6
- package/src/ai/orchestrator.js +1 -6
- package/src/ai/retrieval-engine.js +1 -6
- package/src/chunking/chunking-engine.js +142 -0
- package/src/chunking/strategies/fixed-size.js +54 -0
- package/src/chunking/strategies/recursive.js +127 -0
- package/src/chunking/strategies/semantic.js +128 -0
- package/src/chunking/strategies/sentence.js +32 -0
- package/src/chunking/strategies/structure-aware.js +138 -0
- package/src/citation/citation-tracker.js +161 -0
- package/src/citation/hallucination-detector.js +74 -0
- package/src/citation/source-mapper.js +95 -0
- package/src/cli/commands/ai-ml/adaptive-commands.js +178 -0
- package/src/cli/commands/ai-ml/federated-commands.js +207 -0
- package/src/cli/commands/ai-ml/index.js +17 -0
- package/src/cli/commands/ai-ml/multimodal-commands.js +187 -0
- package/src/cli/commands/ai-ml/shared.js +51 -0
- package/src/cli/commands/ai-ml/training-commands.js +228 -0
- package/src/cli/commands/ai-ml.js +176 -757
- package/src/cli/commands/plugin-hub/certification-commands.js +221 -0
- package/src/cli/commands/plugin-hub/event-handlers.js +64 -0
- package/src/cli/commands/plugin-hub/hub-commands.js +290 -0
- package/src/cli/commands/plugin-hub/review-commands.js +78 -0
- package/src/cli/commands/plugin-hub.js +106 -782
- package/src/cli/diagnostics/config-checker.js +81 -0
- package/src/cli/diagnostics/dependency-checker.js +69 -0
- package/src/cli/diagnostics/environment-checker.js +45 -0
- package/src/cli/diagnostics/performance-checker.js +51 -0
- package/src/cli/diagnostics/plugin-checker.js +106 -0
- package/src/cli/diagnostics/security-checker.js +61 -0
- package/src/cli/doctor-command.js +70 -369
- package/src/cli/enhanced-cli-commands.js +162 -706
- package/src/cli/handlers/config-handler.js +126 -0
- package/src/cli/handlers/diagnostics-handler.js +113 -0
- package/src/cli/handlers/ingest-handler.js +42 -0
- package/src/cli/handlers/init-handler.js +51 -0
- package/src/cli/handlers/query-handler.js +45 -0
- package/src/cli/handlers/run-handler.js +181 -0
- package/src/cli/interactive-wizard.js +99 -723
- package/src/cli/shared/cli-utils.js +89 -0
- package/src/cli/wizard/configuration.js +148 -0
- package/src/cli/wizard/observability.js +79 -0
- package/src/cli/wizard/performance.js +76 -0
- package/src/cli/wizard/plugin-selection.js +297 -0
- package/src/cli/wizard/preview-save.js +172 -0
- package/src/cli/wizard/project-setup.js +66 -0
- package/src/config/memory-optimization.js +3 -3
- package/src/connectors/anthropic-connector.js +179 -0
- package/src/connectors/base-connector.js +94 -0
- package/src/connectors/cohere-connector.js +143 -0
- package/src/connectors/local-embedder.js +171 -0
- package/src/connectors/memory-retriever.js +150 -0
- package/src/connectors/ollama-connector.js +205 -0
- package/src/connectors/openai-connector.js +173 -0
- package/src/core/create-pipeline.js +21 -1
- package/src/core/observability/tracing.js +2 -1
- package/src/core/pipeline-factory.js +0 -1
- package/src/core/plugin-registry.js +14 -14
- package/src/cost/cost-calculator.js +146 -0
- package/src/cost/cost-tracker.js +260 -0
- package/src/cost/token-budget.js +245 -0
- package/src/dag/core/execution-scheduler.js +2 -1
- package/src/dag/core/topology-validation.js +0 -3
- package/src/dag/dag-engine.js +3 -5
- package/src/dag/dag-node.js +0 -1
- package/src/dag/enhanced-dag-engine.js +171 -99
- package/src/dashboard/dashboard-generator.js +642 -0
- package/src/dashboard/metrics-aggregator.js +409 -0
- package/src/debug/execution-tracer.js +210 -0
- package/src/debug/trace-inspector.js +281 -0
- package/src/dev/dev-server.js +5 -5
- package/src/dev/hot-reload.js +3 -2
- package/src/dx/integration-templates.js +0 -3
- package/src/ecosystem/plugin-analytics-dashboard.js +2 -2
- package/src/ecosystem/plugin-hub.js +2 -2
- package/src/enterprise/audit-logging.js +2 -2
- package/src/enterprise/sso-integration.js +52 -32
- package/src/evaluate/context-metrics.js +127 -0
- package/src/evaluate/evaluator.js +4 -2
- package/src/evaluate/faithfulness.js +117 -0
- package/src/evaluate/groundedness.js +60 -0
- package/src/evaluate/pipeline-evaluator.js +156 -0
- package/src/evaluate/relevance.js +129 -0
- package/src/evaluate/scoring.js +27 -0
- package/src/graph/entity-extractor.js +183 -0
- package/src/graph/graph-index.js +113 -0
- package/src/graph/graph-retriever.js +244 -0
- package/src/graph/knowledge-graph.js +256 -0
- package/src/guardrails/guardrails-pipeline.js +136 -0
- package/src/guardrails/post-generation-guard.js +170 -0
- package/src/guardrails/pre-retrieval-guard.js +161 -0
- package/src/guardrails/retrieval-guard.js +126 -0
- package/src/index.js +255 -9
- package/src/loader/html-loader.js +4 -15
- package/src/loader/markdown-loader.js +4 -15
- package/src/mcp/mcp-server.js +199 -0
- package/src/mcp/mcp-tool-builder.js +121 -0
- package/src/observability/audit-logger.js +0 -2
- package/src/observability/event-logger.js +2 -1
- package/src/observability/security-monitor.js +0 -2
- package/src/observability/telemetry.js +0 -2
- package/src/reranker/cascade-reranker.js +79 -0
- package/src/reranker/embedding-reranker.js +124 -0
- package/src/reranker/llm-reranker.js +6 -3
- package/src/reranker/scoring-reranker.js +123 -0
- package/src/retrieval/bm25-search.js +157 -0
- package/src/retrieval/hybrid-retriever.js +111 -0
- package/src/retrieval/rank-fusion.js +62 -0
- package/src/security/jwt-config.js +4 -3
- package/src/security/jwt-validator.js +2 -1
- package/src/security/plugin-sandbox.js +0 -3
- package/src/security/plugin-signature-verifier.js +4 -6
- package/src/security/validator.js +0 -2
- package/src/streaming/embedding-stream.js +197 -0
- package/src/streaming/sse-adapter.js +168 -0
- package/src/streaming/stream-router.js +210 -0
- package/src/streaming/streaming-embedder.js +231 -0
- package/src/streaming/websocket-adapter.js +171 -0
- package/src/templates/scaffold.js +147 -0
- package/src/templates/template-registry.js +272 -0
- package/src/utils/contract-validator.js +2 -1
- package/src/utils/input-sanitizer.js +80 -99
- package/src/utils/performance-monitor.js +0 -3
- package/src/utils/plugin-scaffolder.js +9 -16
- package/src/utils/rate-limiter.js +0 -1
- package/src/utils/retry-policy.js +0 -3
- package/src/utils/safe-expression-evaluator.js +0 -3
- package/src/utils/secure-logger-config.js +2 -4
- package/src/utils/secure-logging.js +0 -3
- package/src/utils/structured-logger.js +0 -3
- package/src/ai/index-fixed.js +0 -509
- package/src/ai/module-template.js +0 -37
- package/src/ci/workflow-analyzer.js +0 -71
- package/src/cli/plugin-marketplace-commands.js +0 -869
- package/src/dev/README.md +0 -126
- package/src/dev/examples/hot-reload-usage.js +0 -355
- package/src/mocks/openai-embedder.js +0 -119
- package/src/mocks/openai-llm.js +0 -77
- package/src/mocks/pdf-loader.js +0 -21
- package/src/mocks/pinecone-retriever.js +0 -106
- package/src/scripts/script-utilities.js +0 -36
- package/src/utils/ci/diagnostic-reporter.js +0 -57
- package/src/utils/examples/error-formatter-usage.js +0 -351
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# rag-pipeline-utils
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**The comprehensive Node.js toolkit for building production-ready RAG pipelines — with built-in evaluation, citation tracking, agentic reasoning, guardrails, and 7 provider connectors.**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/DevilsDev/rag-pipeline-utils/actions)
|
|
6
6
|
[](https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils)
|
|
@@ -8,468 +8,418 @@
|
|
|
8
8
|
[](https://opensource.org/licenses/GPL-3.0)
|
|
9
9
|
[](https://nodejs.org/)
|
|
10
10
|
[](https://www.npmjs.com/package/@devilsdev/rag-pipeline-utils)
|
|
11
|
-
[](https://github.com/DevilsDev/rag-pipeline-utils/discussions)
|
|
12
11
|
|
|
13
12
|
---
|
|
14
13
|
|
|
15
14
|
## Why This Exists
|
|
16
15
|
|
|
17
|
-
Building
|
|
16
|
+
Building RAG systems in Node.js shouldn't require stitching together Python tools or reinventing every component. **rag-pipeline-utils** gives you the complete stack in one package: loaders, embedders, retrievers, LLM connectors, rerankers, evaluation, citation tracking, guardrails, and agentic reasoning.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
Every component follows clear contracts. Every integration is optional. Every decision is yours.
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **
|
|
24
|
-
- **Observable**
|
|
25
|
-
- **
|
|
26
|
-
- **Open** – no vendor lock-in, no proprietary APIs, just JavaScript
|
|
27
|
-
|
|
28
|
-
Whether you're prototyping a document Q&A system or scaling a production knowledge base, this toolkit grows with you.
|
|
20
|
+
- **Modular** -- swap any component without rewriting your pipeline
|
|
21
|
+
- **Evaluated** -- built-in faithfulness, relevance, and groundedness metrics on every run
|
|
22
|
+
- **Safe** -- 3-layer guardrails with prompt injection detection, PII filtering, and source grounding
|
|
23
|
+
- **Observable** -- OpenTelemetry tracing, Prometheus metrics, and compliance-grade audit logs
|
|
24
|
+
- **Connected** -- OpenAI, Anthropic, Cohere, Ollama, or bring your own
|
|
29
25
|
|
|
30
26
|
---
|
|
31
27
|
|
|
32
28
|
## Quick Start
|
|
33
29
|
|
|
34
|
-
Here's a complete RAG pipeline in 15 lines:
|
|
35
|
-
|
|
36
|
-
```javascript
|
|
37
|
-
const { createRagPipeline } = require("@devilsdev/rag-pipeline-utils");
|
|
38
|
-
|
|
39
|
-
// Implement your plugins (or use existing ones)
|
|
40
|
-
const pipeline = createRagPipeline({
|
|
41
|
-
loader: new MyPDFLoader(),
|
|
42
|
-
embedder: new MyOpenAIEmbedder({ apiKey: process.env.OPENAI_API_KEY }),
|
|
43
|
-
retriever: new MyVectorDBRetriever({ url: "http://localhost:8000" }),
|
|
44
|
-
llm: new MyLLMConnector({ model: "gpt-4" }),
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
// Ingest documents
|
|
48
|
-
await pipeline.ingest("./company-docs.pdf");
|
|
49
|
-
|
|
50
|
-
// Query with natural language
|
|
51
|
-
const answer = await pipeline.query("What is the vacation policy?");
|
|
52
|
-
console.log(answer.text);
|
|
53
|
-
// Output: "Based on the company handbook, employees receive 20 days of vacation per year..."
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Requirements:** Node.js >= 18.0.0
|
|
57
|
-
|
|
58
|
-
Install with:
|
|
59
|
-
|
|
60
30
|
```bash
|
|
61
31
|
npm install @devilsdev/rag-pipeline-utils
|
|
62
32
|
```
|
|
63
33
|
|
|
64
|
-
|
|
34
|
+
Build a RAG pipeline with built-in connectors:
|
|
65
35
|
|
|
66
|
-
|
|
36
|
+
```javascript
|
|
37
|
+
const {
|
|
38
|
+
createRagPipeline,
|
|
39
|
+
OpenAIConnector,
|
|
40
|
+
MemoryRetriever,
|
|
41
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
67
42
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- **Consistent validation behavior** eliminating duplicate checks
|
|
71
|
-
- **Race condition mitigation** in concurrent token verification
|
|
43
|
+
const llm = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
44
|
+
const retriever = new MemoryRetriever();
|
|
72
45
|
|
|
73
|
-
|
|
46
|
+
const pipeline = createRagPipeline({ retriever, llm });
|
|
74
47
|
|
|
75
|
-
|
|
48
|
+
const result = await pipeline.run({
|
|
49
|
+
query: "What is the vacation policy?",
|
|
50
|
+
options: { citations: true, evaluate: true },
|
|
51
|
+
});
|
|
76
52
|
|
|
77
|
-
|
|
53
|
+
console.log(result.results);
|
|
54
|
+
// Retrieved documents
|
|
55
|
+
console.log(result.citations?.groundednessScore);
|
|
56
|
+
// 0.85 -- how well the answer is grounded in sources
|
|
57
|
+
console.log(result.evaluation?.scores);
|
|
58
|
+
// { faithfulness: 0.9, relevance: 0.8, contextPrecision: 0.7, ... }
|
|
59
|
+
```
|
|
78
60
|
|
|
79
|
-
|
|
61
|
+
**Requirements:** Node.js >= 18.0.0
|
|
80
62
|
|
|
81
|
-
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Architecture
|
|
82
66
|
|
|
83
67
|
```mermaid
|
|
84
68
|
graph LR
|
|
85
|
-
A[Documents] --> B[
|
|
69
|
+
A[Documents] --> B[Chunking Engine]
|
|
86
70
|
B --> C[Embedder]
|
|
87
71
|
C --> D[Vector Store]
|
|
88
|
-
|
|
89
|
-
F[User Query] -->
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
72
|
+
|
|
73
|
+
F[User Query] --> G{Guardrails}
|
|
74
|
+
G --> H[Query Planner]
|
|
75
|
+
H --> E[Retriever + BM25]
|
|
76
|
+
E --> I[Reranker]
|
|
77
|
+
I --> J[LLM]
|
|
78
|
+
J --> K{Citation Tracker}
|
|
79
|
+
K --> L{Evaluator}
|
|
80
|
+
L --> M[Response]
|
|
94
81
|
|
|
95
82
|
style B fill:#e1f5e1
|
|
96
|
-
style C fill:#e1f5e1
|
|
97
83
|
style E fill:#e1f5e1
|
|
98
84
|
style G fill:#fff4e1
|
|
99
|
-
style H fill:#
|
|
100
|
-
style
|
|
85
|
+
style H fill:#fff4e1
|
|
86
|
+
style K fill:#e3f2fd
|
|
87
|
+
style L fill:#e3f2fd
|
|
101
88
|
```
|
|
102
89
|
|
|
103
|
-
|
|
104
|
-
2. **Embedder** – Convert text to vector embeddings
|
|
105
|
-
3. **Vector Store** – Index and persist embeddings
|
|
106
|
-
4. **Retriever** – Find semantically similar content
|
|
107
|
-
5. **Reranker** (optional) – Refine retrieval results
|
|
108
|
-
6. **LLM** – Generate contextual responses
|
|
90
|
+
**Pipeline stages:** Chunk --> Embed --> Store --> Retrieve --> Rerank --> Generate --> Cite --> Evaluate
|
|
109
91
|
|
|
110
|
-
|
|
92
|
+
Each stage is optional, pluggable, and observable. Enable citation tracking and evaluation with a single option flag.
|
|
111
93
|
|
|
112
94
|
---
|
|
113
95
|
|
|
114
96
|
## Features
|
|
115
97
|
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
-
Swap any component without rewriting your pipeline. Use OpenAI embeddings with Pinecone storage, or mix Hugging Face models with PostgreSQL—your choice.
|
|
119
|
-
|
|
120
|
-
### Enterprise Observability
|
|
121
|
-
|
|
122
|
-
Built-in structured logging, Prometheus metrics, OpenTelemetry tracing, and audit logs for compliance-grade transparency.
|
|
123
|
-
|
|
124
|
-
### DAG Workflow Engine
|
|
125
|
-
|
|
126
|
-
Chain complex multi-step operations with retry logic, parallel execution, and graceful error handling. Perfect for batch ingestion or multi-stage transformations.
|
|
127
|
-
|
|
128
|
-
### Type-Safe Contracts
|
|
98
|
+
### Plugin Architecture
|
|
129
99
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
### Production-Ready Security
|
|
133
|
-
|
|
134
|
-
Hardened security with defense-in-depth: JWT replay protection with race condition mitigation, multi-layer path traversal defense with iterative URL decoding, validated JSON parsing, algorithm whitelisting, automatic secret redaction, and comprehensive audit logging.
|
|
135
|
-
|
|
136
|
-
### Streaming & Batching
|
|
137
|
-
|
|
138
|
-
Stream LLM responses in real-time. Batch embed thousands of documents efficiently with parallel processing and backpressure control.
|
|
139
|
-
|
|
140
|
-
### Framework Agnostic
|
|
141
|
-
|
|
142
|
-
Works with Express, Fastify, Next.js, or any Node.js runtime. Deploy to AWS Lambda, Vercel, Docker, or bare metal.
|
|
143
|
-
|
|
144
|
-
---
|
|
100
|
+
Five plugin types with JSON Schema contracts: **loader**, **embedder**, **retriever**, **llm**, and **reranker**. Register, validate, and swap components at runtime.
|
|
145
101
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Whether you're implementing a new retriever, writing documentation, reporting bugs, or sharing ideas—every contribution makes this toolkit better for everyone.
|
|
151
|
-
|
|
152
|
-
**Getting Started:**
|
|
153
|
-
|
|
154
|
-
- [GitHub Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions) – Ask questions, share use cases, propose features
|
|
155
|
-
- [Issue Tracker](https://github.com/DevilsDev/rag-pipeline-utils/issues) – Report bugs or request features
|
|
156
|
-
- [Contributing Guide](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/docs/CONTRIBUTING.md) – Learn how to submit pull requests
|
|
157
|
-
- [Code of Conduct](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/CODE_OF_CONDUCT.md) – Our community standards
|
|
158
|
-
|
|
159
|
-
**Good First Issues:** Look for issues tagged `good first issue` to find beginner-friendly contributions.
|
|
160
|
-
|
|
161
|
-
**Office Hours:** Join our monthly community calls to discuss roadmap priorities and architectural decisions.
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Security and Quality
|
|
166
|
-
|
|
167
|
-
Security isn't optional. This toolkit is built with defense in depth:
|
|
168
|
-
|
|
169
|
-
### Core Security Features
|
|
170
|
-
|
|
171
|
-
- **Validated Inputs** – All JSON parsed through schema validation (AJV)
|
|
172
|
-
- **Secure Logging** – Automatic redaction of 36 sensitive field patterns (API keys, JWTs, tokens)
|
|
173
|
-
- **JWT Best Practices** – Algorithm whitelisting, issuer/audience validation, expiration enforcement
|
|
174
|
-
- **Dependency Scanning** – Weekly Dependabot updates, CI blocks on critical vulnerabilities
|
|
175
|
-
- **Audit Trail** – Immutable compliance-grade logs for all security-sensitive operations
|
|
176
|
-
- **Plugin Sandboxing** – Third-party plugins run with declared permissions and resource limits
|
|
177
|
-
- **Supply Chain Security** – All GitHub Actions pinned to commit SHAs, SBOM generation available
|
|
178
|
-
|
|
179
|
-
### Recent Security Enhancements (v2.3.0)
|
|
180
|
-
|
|
181
|
-
#### Hardened JWT Validation
|
|
182
|
-
|
|
183
|
-
**Advanced Replay Protection:**
|
|
184
|
-
|
|
185
|
-
- Self-signed tokens can be verified multiple times (essential for refresh flows and load balancer retries)
|
|
186
|
-
- External tokens are tracked and blocked on replay attempts
|
|
187
|
-
- Race condition mitigation with optimized check-then-set pattern
|
|
188
|
-
- Separate tracking for reusable vs. single-use tokens
|
|
189
|
-
|
|
190
|
-
**Consistent Validation Behavior:**
|
|
102
|
+
```javascript
|
|
103
|
+
const { pluginRegistry } = require("@devilsdev/rag-pipeline-utils");
|
|
104
|
+
pluginRegistry.register("llm", "my-model", MyCustomLLM);
|
|
105
|
+
```
|
|
191
106
|
|
|
192
|
-
|
|
193
|
-
- Eliminated duplicate validation logic to prevent configuration confusion
|
|
194
|
-
- Clear separation of concerns: jsonwebtoken handles cryptographic validation, custom logic handles business rules
|
|
107
|
+
### Smart Chunking
|
|
195
108
|
|
|
196
|
-
|
|
109
|
+
Five built-in strategies for document splitting: `sentence`, `fixed-size`, `recursive` (default, 512 chars), `semantic` (topic-boundary detection), and `structure-aware` (respects Markdown headers, HTML sections, code blocks).
|
|
197
110
|
|
|
198
111
|
```javascript
|
|
199
|
-
const {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
issuer: "my-app",
|
|
205
|
-
audience: "api-users",
|
|
206
|
-
strictValidation: true, // Enforces iss/aud validation
|
|
207
|
-
enableJtiTracking: true, // Prevents replay attacks
|
|
112
|
+
const { ChunkingEngine } = require("@devilsdev/rag-pipeline-utils");
|
|
113
|
+
const engine = new ChunkingEngine({
|
|
114
|
+
strategy: "recursive",
|
|
115
|
+
chunkSize: 512,
|
|
116
|
+
chunkOverlap: 50,
|
|
208
117
|
});
|
|
209
|
-
|
|
210
|
-
// Self-signed tokens can be verified multiple times
|
|
211
|
-
const token = validator.sign({ sub: "user-123" });
|
|
212
|
-
validator.verify(token); // First verification
|
|
213
|
-
validator.verify(token); // Still works (refresh flow)
|
|
214
|
-
|
|
215
|
-
// External tokens are blocked on replay
|
|
216
|
-
const externalToken = getTokenFromThirdParty();
|
|
217
|
-
validator.verify(externalToken); // First use
|
|
218
|
-
validator.verify(externalToken); // Throws "Token replay detected"
|
|
118
|
+
const chunks = engine.chunk(documentText);
|
|
219
119
|
```
|
|
220
120
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
**Multi-Layer Protection:**
|
|
121
|
+
### Hybrid Retrieval
|
|
224
122
|
|
|
225
|
-
|
|
226
|
-
- Detects double-encoded paths: `%252e%252e%252f` → `%2e%2e%2f` → `../`
|
|
227
|
-
- Malformed encoding treated as attack indicator (throws error)
|
|
228
|
-
- Critical security violations always throw, regardless of configuration
|
|
229
|
-
|
|
230
|
-
**Attack Vectors Blocked:**
|
|
231
|
-
|
|
232
|
-
- Standard traversal: `../../../etc/passwd`
|
|
233
|
-
- Windows paths: `..\..\windows\system32`
|
|
234
|
-
- URL encoded: `%2e%2e%2f`, `%2e%2e%5c`
|
|
235
|
-
- Double encoded: `%252e%252e%252f`
|
|
236
|
-
- Mixed encoding: combinations of above
|
|
237
|
-
|
|
238
|
-
**Example:**
|
|
123
|
+
Combine vector similarity with BM25 keyword search using Reciprocal Rank Fusion. Run multiple retrievers in parallel with graceful degradation.
|
|
239
124
|
|
|
240
125
|
```javascript
|
|
241
|
-
const {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
126
|
+
const {
|
|
127
|
+
BM25Search,
|
|
128
|
+
HybridRetriever,
|
|
129
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
130
|
+
const bm25 = new BM25Search();
|
|
131
|
+
bm25.index(documents);
|
|
132
|
+
|
|
133
|
+
const hybrid = new HybridRetriever([
|
|
134
|
+
{ retriever: vectorRetriever, weight: 0.7, name: "vector" },
|
|
135
|
+
{ retriever: bm25, weight: 0.3, name: "keyword" },
|
|
136
|
+
]);
|
|
137
|
+
const results = await hybrid.retrieve({ query });
|
|
250
138
|
```
|
|
251
139
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
**Critical Security Errors:**
|
|
140
|
+
### RAG Evaluation
|
|
255
141
|
|
|
256
|
-
-
|
|
257
|
-
- Object depth limit violations **always throw** to prevent DoS
|
|
258
|
-
- Security-critical operations are prioritized over configuration flexibility
|
|
142
|
+
Measure pipeline quality with five built-in metrics: **faithfulness**, **answer relevance**, **context precision**, **context recall**, and **groundedness**. Run automatically on every pipeline execution or standalone.
|
|
259
143
|
|
|
260
|
-
|
|
144
|
+
```javascript
|
|
145
|
+
const { PipelineEvaluator } = require("@devilsdev/rag-pipeline-utils");
|
|
146
|
+
const evaluator = new PipelineEvaluator();
|
|
147
|
+
const metrics = evaluator.evaluate({ query, answer, results: retrievedDocs });
|
|
148
|
+
// metrics.scores.faithfulness, metrics.scores.relevance, etc.
|
|
149
|
+
```
|
|
261
150
|
|
|
262
|
-
|
|
263
|
-
- Audit events emitted for replay detection, algorithm mismatches, and validation failures
|
|
264
|
-
- Structured logging with security event correlation
|
|
151
|
+
Or inline: `pipeline.run({ query, options: { evaluate: true } })`
|
|
265
152
|
|
|
266
|
-
###
|
|
153
|
+
### Citation & Grounding
|
|
267
154
|
|
|
268
|
-
|
|
155
|
+
Track which source documents support each claim. Detect hallucinations automatically. Get a groundedness score for every answer.
|
|
269
156
|
|
|
270
|
-
|
|
157
|
+
```javascript
|
|
158
|
+
const { CitationTracker } = require("@devilsdev/rag-pipeline-utils");
|
|
159
|
+
const tracker = new CitationTracker();
|
|
160
|
+
const result = tracker.track(answer, retrievedDocs);
|
|
161
|
+
// result.groundednessScore, result.citations, result.hallucinationReport
|
|
162
|
+
```
|
|
271
163
|
|
|
272
|
-
|
|
273
|
-
- Input Sanitizer: 69 tests covering XSS, SQL injection, command injection, and path traversal
|
|
164
|
+
### Agentic RAG
|
|
274
165
|
|
|
275
|
-
|
|
166
|
+
Multi-step retrieval with query decomposition, iterative search, and self-critique. The agent splits complex questions into sub-queries, retrieves evidence in parallel via the DAG engine, and validates its own answer before returning.
|
|
276
167
|
|
|
277
|
-
|
|
168
|
+
```javascript
|
|
169
|
+
const { AgenticPipeline } = require("@devilsdev/rag-pipeline-utils");
|
|
170
|
+
const agent = new AgenticPipeline({
|
|
171
|
+
enableCritique: true,
|
|
172
|
+
enablePlanning: true,
|
|
173
|
+
});
|
|
174
|
+
const result = await agent.run({
|
|
175
|
+
query: "Compare all three competitors",
|
|
176
|
+
retriever,
|
|
177
|
+
llm,
|
|
178
|
+
});
|
|
179
|
+
// result.subQueries, result.critique, result.answer
|
|
180
|
+
```
|
|
278
181
|
|
|
279
|
-
|
|
182
|
+
### 3-Layer Guardrails
|
|
280
183
|
|
|
281
|
-
|
|
184
|
+
Wrap any pipeline with production safety: **pre-retrieval** (prompt injection detection, topic filtering), **retrieval-time** (relevance threshold, ACL filtering, freshness), and **post-generation** (PII detection, groundedness check, length validation).
|
|
282
185
|
|
|
283
|
-
```
|
|
284
|
-
|
|
186
|
+
```javascript
|
|
187
|
+
const { GuardrailsPipeline } = require("@devilsdev/rag-pipeline-utils");
|
|
188
|
+
const safePipeline = new GuardrailsPipeline(pipeline, {
|
|
189
|
+
preRetrieval: { enableInjectionDetection: true },
|
|
190
|
+
retrieval: { minRelevanceScore: 0.6 },
|
|
191
|
+
postGeneration: { enablePIIDetection: true, enableGroundednessCheck: true },
|
|
192
|
+
});
|
|
193
|
+
const result = await safePipeline.run({ query });
|
|
285
194
|
```
|
|
286
195
|
|
|
287
|
-
###
|
|
196
|
+
### Streaming
|
|
288
197
|
|
|
289
|
-
|
|
290
|
-
# Clone the repository
|
|
291
|
-
git clone https://github.com/DevilsDev/rag-pipeline-utils.git
|
|
292
|
-
cd rag-pipeline-utils
|
|
198
|
+
Stream LLM responses in real-time via Server-Sent Events or WebSocket. The `StreamRouter` auto-detects transport and handles backpressure.
|
|
293
199
|
|
|
294
|
-
|
|
295
|
-
|
|
200
|
+
```javascript
|
|
201
|
+
const { StreamRouter } = require("@devilsdev/rag-pipeline-utils");
|
|
202
|
+
const router = new StreamRouter();
|
|
296
203
|
|
|
297
|
-
|
|
298
|
-
|
|
204
|
+
// Express example
|
|
205
|
+
app.get("/api/stream", async (req, res) => {
|
|
206
|
+
await router.streamSSE(pipeline, req.query.q, res);
|
|
207
|
+
});
|
|
208
|
+
```
|
|
299
209
|
|
|
300
|
-
|
|
301
|
-
npm run lint
|
|
210
|
+
### Provider Connectors
|
|
302
211
|
|
|
303
|
-
|
|
304
|
-
npm run build
|
|
212
|
+
Seven built-in connectors -- drop into any pipeline with zero configuration:
|
|
305
213
|
|
|
306
|
-
|
|
307
|
-
|
|
214
|
+
```javascript
|
|
215
|
+
const {
|
|
216
|
+
OpenAIConnector, // GPT-4, GPT-3.5, text-embedding-3
|
|
217
|
+
AnthropicConnector, // Claude 3 Opus, Sonnet, Haiku
|
|
218
|
+
CohereConnector, // Embed + Rerank
|
|
219
|
+
OllamaConnector, // Llama 3, Mistral (local)
|
|
220
|
+
LocalEmbedder, // TF-IDF (offline, no API)
|
|
221
|
+
MemoryRetriever, // In-memory cosine similarity
|
|
222
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
223
|
+
|
|
224
|
+
const ollama = new OllamaConnector({
|
|
225
|
+
model: "llama3",
|
|
226
|
+
baseURL: "http://localhost:11434",
|
|
227
|
+
});
|
|
228
|
+
const openai = new OpenAIConnector({ apiKey: process.env.OPENAI_API_KEY });
|
|
308
229
|
```
|
|
309
230
|
|
|
310
|
-
###
|
|
231
|
+
### Cost Management
|
|
311
232
|
|
|
312
|
-
|
|
313
|
-
npm test # Run test suite
|
|
314
|
-
npm run test:watch # Watch mode for TDD
|
|
315
|
-
npm run lint # Check code style
|
|
316
|
-
npm run lint:fix # Auto-fix linting issues
|
|
317
|
-
npm run security:audit # Scan dependencies
|
|
318
|
-
npm run docs:api # Generate API documentation
|
|
319
|
-
npm run benchmark # Performance benchmarks
|
|
320
|
-
```
|
|
233
|
+
Track token spend per provider, estimate costs before execution, and enforce budgets with hard and soft limits.
|
|
321
234
|
|
|
322
|
-
|
|
235
|
+
```javascript
|
|
236
|
+
const {
|
|
237
|
+
CostCalculator,
|
|
238
|
+
TokenBudget,
|
|
239
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
240
|
+
const calc = new CostCalculator();
|
|
241
|
+
const cost = calc.estimate("gpt-4", 2000, 500);
|
|
242
|
+
// cost.totalCost = 0.09 (USD)
|
|
243
|
+
|
|
244
|
+
const budget = new TokenBudget({ maxTokens: 100000 });
|
|
245
|
+
budget.record(2500);
|
|
246
|
+
budget.check(1000); // { allowed: true, remaining: { tokens: 96500 } }
|
|
247
|
+
```
|
|
323
248
|
|
|
324
|
-
|
|
249
|
+
### Pipeline Debugging
|
|
325
250
|
|
|
326
|
-
|
|
251
|
+
Trace every execution step with timing, bottleneck detection, and optimization recommendations.
|
|
327
252
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
253
|
+
```javascript
|
|
254
|
+
const {
|
|
255
|
+
ExecutionTracer,
|
|
256
|
+
TraceInspector,
|
|
257
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
258
|
+
const tracer = new ExecutionTracer();
|
|
259
|
+
const traced = tracer.trace(pipeline);
|
|
260
|
+
const result = await traced.run({ query });
|
|
261
|
+
|
|
262
|
+
const inspector = new TraceInspector();
|
|
263
|
+
const analysis = inspector.analyze(tracer.getTraces()[0]);
|
|
264
|
+
// analysis.bottleneck, analysis.recommendations
|
|
265
|
+
```
|
|
332
266
|
|
|
333
|
-
###
|
|
267
|
+
### MCP Integration
|
|
334
268
|
|
|
335
|
-
|
|
336
|
-
- **Federated Learning** – Privacy-preserving model training across distributed datasets
|
|
337
|
-
- **Advanced Reranking** – Cross-encoder models and learned ranking functions
|
|
338
|
-
- **Performance Dashboard** – Web UI for monitoring pipeline health and cost metrics
|
|
269
|
+
Expose any pipeline as a Model Context Protocol tool, callable from Claude Desktop, IDE extensions, or any MCP-compatible client.
|
|
339
270
|
|
|
340
|
-
|
|
271
|
+
```javascript
|
|
272
|
+
const { MCPServer } = require("@devilsdev/rag-pipeline-utils");
|
|
273
|
+
const server = MCPServer.fromPipeline(pipeline, { name: "knowledge-base" });
|
|
274
|
+
const tools = server.getToolDefinitions();
|
|
275
|
+
const result = await server.handleToolUse("knowledge-base", {
|
|
276
|
+
query: "How does auth work?",
|
|
277
|
+
});
|
|
278
|
+
```
|
|
341
279
|
|
|
342
|
-
|
|
343
|
-
- Kubernetes operator for production deployments
|
|
344
|
-
- Real-time collaboration features for team-based pipelines
|
|
280
|
+
### Quick Start Templates
|
|
345
281
|
|
|
346
|
-
|
|
282
|
+
Scaffold complete projects from four built-in templates: `document-qa`, `chatbot`, `code-search`, and `customer-support`.
|
|
347
283
|
|
|
348
|
-
|
|
284
|
+
```javascript
|
|
285
|
+
const { ProjectScaffolder } = require("@devilsdev/rag-pipeline-utils");
|
|
286
|
+
const scaffolder = new ProjectScaffolder();
|
|
287
|
+
scaffolder.create("chatbot", "./my-chatbot");
|
|
288
|
+
// Creates: package.json, index.js, .ragrc.json, README.md
|
|
289
|
+
```
|
|
349
290
|
|
|
350
|
-
|
|
291
|
+
### Streaming Embeddings
|
|
351
292
|
|
|
352
|
-
|
|
293
|
+
Generate embeddings in real-time with backpressure control and memory management. Process millions of documents without running out of memory.
|
|
353
294
|
|
|
354
|
-
|
|
295
|
+
```javascript
|
|
296
|
+
const { StreamingEmbedder } = require("@devilsdev/rag-pipeline-utils");
|
|
297
|
+
const streamer = new StreamingEmbedder(myEmbedder, {
|
|
298
|
+
batchSize: 50,
|
|
299
|
+
maxMemoryMB: 512,
|
|
300
|
+
});
|
|
301
|
+
for await (const { id, vector, progress } of streamer.embedStream(documents)) {
|
|
302
|
+
console.log(`${(progress * 100).toFixed(0)}% — embedded ${id}`);
|
|
303
|
+
}
|
|
304
|
+
```
|
|
355
305
|
|
|
356
|
-
|
|
306
|
+
### GraphRAG
|
|
357
307
|
|
|
358
|
-
|
|
308
|
+
Build knowledge graphs from documents and retrieve using entity-relationship traversal. Combines graph-based scoring with text matching for superior retrieval on entity-heavy content.
|
|
359
309
|
|
|
360
310
|
```javascript
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
// strictValidation defaults to true
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
// Behavior unchanged - tokens validated correctly
|
|
311
|
+
const { GraphRetriever } = require("@devilsdev/rag-pipeline-utils");
|
|
312
|
+
const retriever = new GraphRetriever({ traversalDepth: 2 });
|
|
313
|
+
await retriever.store(documents); // Extracts entities + builds graph
|
|
314
|
+
const results = await retriever.retrieve("Who founded OpenAI?", 5);
|
|
315
|
+
// Results ranked by entity graph traversal + text relevance
|
|
370
316
|
```
|
|
371
317
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
If you explicitly set `strictValidation: false`, the behavior has changed for consistency:
|
|
318
|
+
### Advanced Reranking
|
|
375
319
|
|
|
376
|
-
|
|
320
|
+
Three reranking strategies beyond LLM-based: BM25 scoring, embedding cosine similarity, and cascaded multi-stage reranking.
|
|
377
321
|
|
|
378
322
|
```javascript
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
323
|
+
const {
|
|
324
|
+
ScoringReranker,
|
|
325
|
+
EmbeddingReranker,
|
|
326
|
+
CascadeReranker,
|
|
327
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
328
|
+
const cascade = new CascadeReranker([
|
|
329
|
+
new ScoringReranker(), // Stage 1: BM25 keyword scoring
|
|
330
|
+
new EmbeddingReranker(embedder), // Stage 2: semantic similarity
|
|
331
|
+
]);
|
|
332
|
+
const ranked = await cascade.rerank(query, documents);
|
|
385
333
|
```
|
|
386
334
|
|
|
387
|
-
|
|
335
|
+
### Performance Dashboard
|
|
336
|
+
|
|
337
|
+
Generate standalone HTML dashboards from pipeline metrics. No external dependencies — open in any browser.
|
|
388
338
|
|
|
389
339
|
```javascript
|
|
390
|
-
const
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
});
|
|
396
|
-
|
|
340
|
+
const {
|
|
341
|
+
MetricsAggregator,
|
|
342
|
+
DashboardGenerator,
|
|
343
|
+
} = require("@devilsdev/rag-pipeline-utils");
|
|
344
|
+
const aggregator = new MetricsAggregator();
|
|
345
|
+
aggregator.recordQuery({ duration: 250, cost: 0.003, success: true });
|
|
346
|
+
|
|
347
|
+
const dashboard = new DashboardGenerator();
|
|
348
|
+
const html = dashboard.generate(aggregator.getSnapshot());
|
|
349
|
+
// Write to file: fs.writeFileSync('dashboard.html', html);
|
|
397
350
|
```
|
|
398
351
|
|
|
399
|
-
|
|
352
|
+
### Enterprise
|
|
400
353
|
|
|
401
|
-
|
|
354
|
+
Multi-tenant isolation, SSO integration (SAML, OAuth2, Active Directory, OIDC), compliance-grade audit logging, and data governance with classification and retention policies.
|
|
402
355
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
- Refresh token flows
|
|
406
|
-
- Load balancer retries
|
|
407
|
-
- Distributed systems with eventual consistency
|
|
356
|
+
### DAG Workflow Engine
|
|
408
357
|
|
|
409
|
-
|
|
410
|
-
const token = validator.sign({ sub: "user-123" });
|
|
358
|
+
Chain complex multi-step operations with topological execution, retry logic, parallel processing via semaphore-based concurrency, graceful degradation, and checkpoint/resume.
|
|
411
359
|
|
|
412
|
-
|
|
413
|
-
// After v2.3.0: Works correctly for self-signed tokens
|
|
414
|
-
validator.verify(token); // Works
|
|
415
|
-
validator.verify(token); // Now works!
|
|
416
|
-
```
|
|
360
|
+
### Security
|
|
417
361
|
|
|
418
|
-
|
|
362
|
+
Defense-in-depth: JWT replay protection, algorithm whitelisting, plugin sandboxing with isolated-vm, multi-layer path traversal defense (5-pass iterative URL decoding), input validation, and automatic secret redaction (36+ patterns).
|
|
419
363
|
|
|
420
|
-
###
|
|
364
|
+
### Observability
|
|
421
365
|
|
|
422
|
-
|
|
366
|
+
OpenTelemetry distributed tracing, Prometheus metrics export, structured Pino logging, SLO monitoring, and security event tracking.
|
|
423
367
|
|
|
424
|
-
|
|
368
|
+
---
|
|
425
369
|
|
|
426
|
-
|
|
370
|
+
## Installation
|
|
427
371
|
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
const result = sanitizePath("../../../etc/passwd");
|
|
431
|
-
// Returned: null (silent failure)
|
|
372
|
+
```bash
|
|
373
|
+
npm install @devilsdev/rag-pipeline-utils
|
|
432
374
|
```
|
|
433
375
|
|
|
434
|
-
|
|
376
|
+
### Development
|
|
435
377
|
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
378
|
+
```bash
|
|
379
|
+
git clone https://github.com/DevilsDev/rag-pipeline-utils.git
|
|
380
|
+
cd rag-pipeline-utils
|
|
381
|
+
npm install
|
|
382
|
+
npm test # 92 suites, 2050+ tests
|
|
383
|
+
npm run build # CJS + ESM + TypeScript definitions
|
|
384
|
+
npm run lint # ESLint
|
|
385
|
+
npm run dev # Interactive development tools
|
|
440
386
|
```
|
|
441
387
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
**Migration:** Wrap path sanitization in try-catch if you need to handle errors gracefully:
|
|
388
|
+
### Useful Commands
|
|
445
389
|
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
// Handle attack attempt
|
|
453
|
-
logger.warn("Path traversal blocked", { input: userInput });
|
|
454
|
-
return res.status(400).json({ error: "Invalid path" });
|
|
455
|
-
}
|
|
456
|
-
throw error;
|
|
457
|
-
}
|
|
390
|
+
```bash
|
|
391
|
+
npm run benchmark # Performance benchmarks
|
|
392
|
+
npm run security:audit # Dependency scanning
|
|
393
|
+
npm run docs:api # Generate API documentation
|
|
394
|
+
npm run docs:validate # Verify README code examples
|
|
395
|
+
npm run verify:esm # Validate ESM build
|
|
458
396
|
```
|
|
459
397
|
|
|
460
|
-
|
|
398
|
+
---
|
|
461
399
|
|
|
462
|
-
|
|
400
|
+
## Roadmap
|
|
463
401
|
|
|
464
|
-
###
|
|
402
|
+
### v2.4.0 (Current)
|
|
465
403
|
|
|
466
|
-
|
|
404
|
+
- 104 public exports
|
|
405
|
+
- Streaming embeddings with backpressure control
|
|
406
|
+
- GraphRAG -- knowledge graph construction, entity extraction, graph-based retrieval
|
|
407
|
+
- Advanced reranking -- BM25 scoring, embedding-based, cascade rerankers
|
|
408
|
+
- Performance dashboard -- HTML dashboard generator, metrics aggregation
|
|
409
|
+
- Smart chunking, citation tracking, RAG evaluation, agentic RAG, hybrid retrieval
|
|
410
|
+
- 3-layer guardrails, cost management, MCP integration, streaming adapters
|
|
411
|
+
- 7 provider connectors (OpenAI, Anthropic, Cohere, Ollama, LocalEmbedder, MemoryRetriever)
|
|
412
|
+
- 92 test suites, 2050+ tests
|
|
467
413
|
|
|
468
|
-
|
|
469
|
-
npm test
|
|
470
|
-
```
|
|
414
|
+
### What's Next (v3.0.0)
|
|
471
415
|
|
|
472
|
-
|
|
416
|
+
- **Intelligent Caching** -- embedding cache with TTL and invalidation strategies
|
|
417
|
+
- **Native Rust Bindings** -- performance-critical paths compiled to native code
|
|
418
|
+
- **Kubernetes Operator** -- production deployments with auto-scaling
|
|
419
|
+
- **Edge Deployment** -- Cloudflare Workers, Deno Deploy, Vercel Edge
|
|
420
|
+
- **Real-time Collaboration** -- team-based pipeline editing and sharing
|
|
421
|
+
|
|
422
|
+
**Vote on features:** [GitHub Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions/categories/roadmap)
|
|
473
423
|
|
|
474
424
|
---
|
|
475
425
|
|
|
@@ -477,43 +427,25 @@ If you encounter issues, please [open an issue](https://github.com/DevilsDev/rag
|
|
|
477
427
|
|
|
478
428
|
We welcome contributions of all kinds:
|
|
479
429
|
|
|
480
|
-
- **Code**
|
|
481
|
-
- **Documentation**
|
|
482
|
-
- **Testing**
|
|
483
|
-
- **Design**
|
|
484
|
-
- **Community**
|
|
430
|
+
- **Code** -- fix bugs, add features, improve performance
|
|
431
|
+
- **Documentation** -- write guides, improve examples, clarify concepts
|
|
432
|
+
- **Testing** -- expand test coverage, add integration tests, report edge cases
|
|
433
|
+
- **Design** -- propose API improvements, suggest architectural patterns
|
|
434
|
+
- **Community** -- answer questions, review pull requests, mentor new contributors
|
|
485
435
|
|
|
486
|
-
**Before
|
|
436
|
+
**Before you start:**
|
|
487
437
|
|
|
488
438
|
1. Read the [Contributing Guide](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/docs/CONTRIBUTING.md)
|
|
489
439
|
2. Check existing [Issues](https://github.com/DevilsDev/rag-pipeline-utils/issues) and [Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions)
|
|
490
440
|
3. Open an issue to discuss major changes before coding
|
|
491
441
|
4. Follow our [Code of Conduct](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/CODE_OF_CONDUCT.md)
|
|
492
442
|
|
|
493
|
-
**Pull Request Checklist:**
|
|
494
|
-
|
|
495
|
-
- [ ] Tests pass (`npm test`)
|
|
496
|
-
- [ ] Linter passes (`npm run lint`)
|
|
497
|
-
- [ ] Documentation updated
|
|
498
|
-
- [ ] Changelog entry added
|
|
499
|
-
- [ ] Type definitions updated (if applicable)
|
|
500
|
-
|
|
501
443
|
---
|
|
502
444
|
|
|
503
445
|
## License
|
|
504
446
|
|
|
505
|
-
**GPL-3.0**
|
|
506
|
-
|
|
507
|
-
This is free software: you are free to change and redistribute it under the terms of the GNU General Public License version 3.
|
|
447
|
+
**GPL-3.0** -- See [LICENSE](https://github.com/DevilsDev/rag-pipeline-utils/blob/main/LICENSE) for full terms.
|
|
508
448
|
|
|
509
449
|
---
|
|
510
450
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
**Star this repository** if you find it useful—it helps others discover the project.
|
|
514
|
-
|
|
515
|
-
**Share your use case** in [Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions/categories/show-and-tell) to inspire the community.
|
|
516
|
-
|
|
517
|
-
**Contribute** your first pull request—check out issues tagged [good first issue](https://github.com/DevilsDev/rag-pipeline-utils/labels/good%20first%20issue).
|
|
518
|
-
|
|
519
|
-
Happy building.
|
|
451
|
+
**Star this repo** if you find it useful. **Share your use case** in [Discussions](https://github.com/DevilsDev/rag-pipeline-utils/discussions/categories/show-and-tell). **Contribute** your first PR -- check [good first issues](https://github.com/DevilsDev/rag-pipeline-utils/labels/good%20first%20issue).
|