@devilsdev/rag-pipeline-utils 2.0.0 β†’ 2.1.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.
Files changed (77) hide show
  1. package/.eslintrc.json +24 -18
  2. package/.github/workflows/docs-deploy.yml +46 -0
  3. package/.github/workflows/publish-release-blog.yml +53 -0
  4. package/.github/workflows/storybook-deploy.yml +33 -0
  5. package/.husky/pre-commit +1 -0
  6. package/.storybook/main.js +20 -0
  7. package/.storybook/preview.js +13 -0
  8. package/CHANGELOG.md +15 -1
  9. package/README.md +101 -72
  10. package/Use-Cases.md +134 -0
  11. package/docs-site/.plaiceholder-cache/img_hero.jpg.json +1 -0
  12. package/docs-site/.plaiceholder-cache/img_logo.png.json +1 -0
  13. package/docs-site/.storybook/preview.js +8 -0
  14. package/docs-site/blog/2021-08-26-welcome/index.md +0 -1
  15. package/docs-site/blog/2025-04-17-release-2.0.md +67 -0
  16. package/docs-site/blog/2025-04-17-release-v2.0.2.md +13 -0
  17. package/docs-site/blog/2025-04-18-architecture-overview.md +34 -0
  18. package/docs-site/blog/2025-04-18-release-2.0.0.md +21 -0
  19. package/docs-site/blog/2025-04-19-prompt-engineering-best-practices.md +31 -0
  20. package/docs-site/blog/2025-04-20-image-showcase.md +23 -0
  21. package/docs-site/blog/authors.yml +5 -23
  22. package/docs-site/blog/tags.yml +27 -16
  23. package/docs-site/docs/Architecture.md +4 -4
  24. package/docs-site/docs/CLI.md +3 -3
  25. package/docs-site/docs/Evaluation.md +7 -7
  26. package/docs-site/docs/FAQ.md +6 -6
  27. package/docs-site/docs/Introduction.md +9 -9
  28. package/docs-site/docs/Plugins.md +3 -3
  29. package/docs-site/docs/Tutorials.md +106 -0
  30. package/docs-site/docs/Usage.md +5 -5
  31. package/docs-site/docs/Use-Cases.md +77 -0
  32. package/docs-site/docs/components/BlogCardExample.mdx +7 -0
  33. package/docs-site/docusaurus.config.js +16 -2
  34. package/docs-site/package-lock.json +487 -2
  35. package/docs-site/package.json +7 -3
  36. package/docs-site/scripts/generate-placeholders.js +17 -0
  37. package/docs-site/scripts/watch-images.js +40 -0
  38. package/docs-site/sidebar-snippet.txt +5 -0
  39. package/docs-site/sidebars.js +26 -9
  40. package/docs-site/src/components/BlogCard.jsx +31 -0
  41. package/docs-site/src/components/BlogCard.stories.jsx +34 -0
  42. package/docs-site/src/components/BlogImage.jsx +58 -0
  43. package/docs-site/src/components/BlogImage.stories.jsx +20 -0
  44. package/docs-site/static/img/authors/ali.jpg +0 -0
  45. package/docs-site/static/img/hero.jpg +0 -0
  46. package/docs-site/utils/image.js +19 -0
  47. package/package.json +27 -3
  48. package/scripts/validate-changelog-version.js +48 -0
  49. package/src/stories/Button.jsx +39 -0
  50. package/src/stories/Button.stories.js +49 -0
  51. package/src/stories/Configure.mdx +364 -0
  52. package/src/stories/Header.jsx +56 -0
  53. package/src/stories/Header.stories.js +29 -0
  54. package/src/stories/Page.jsx +69 -0
  55. package/src/stories/Page.stories.js +28 -0
  56. package/src/stories/assets/accessibility.png +0 -0
  57. package/src/stories/assets/accessibility.svg +1 -0
  58. package/src/stories/assets/addon-library.png +0 -0
  59. package/src/stories/assets/assets.png +0 -0
  60. package/src/stories/assets/avif-test-image.avif +0 -0
  61. package/src/stories/assets/context.png +0 -0
  62. package/src/stories/assets/discord.svg +1 -0
  63. package/src/stories/assets/docs.png +0 -0
  64. package/src/stories/assets/figma-plugin.png +0 -0
  65. package/src/stories/assets/github.svg +1 -0
  66. package/src/stories/assets/share.png +0 -0
  67. package/src/stories/assets/styling.png +0 -0
  68. package/src/stories/assets/testing.png +0 -0
  69. package/src/stories/assets/theming.png +0 -0
  70. package/src/stories/assets/tutorials.svg +1 -0
  71. package/src/stories/assets/youtube.svg +1 -0
  72. package/src/stories/button.css +30 -0
  73. package/src/stories/header.css +32 -0
  74. package/src/stories/page.css +68 -0
  75. package/docs-site/blog/2019-05-28-first-blog-post.md +0 -12
  76. package/docs-site/blog/2019-05-29-long-blog-post.md +0 -44
  77. package/docs-site/blog/2021-08-01-mdx-blog-post.mdx +0 -24
package/.eslintrc.json CHANGED
@@ -1,21 +1,27 @@
1
1
  {
2
- "env": {
3
- "es2022": true,
4
- "node": true,
5
- "jest": true
6
- },
7
- "extends": [
8
- "eslint:recommended"
2
+ "env": {
3
+ "es2022": true,
4
+ "node": true,
5
+ "jest": true
6
+ },
7
+ "extends": [
8
+ "eslint:recommended",
9
+ "plugin:storybook/recommended"
10
+ ],
11
+ "parserOptions": {
12
+ "ecmaVersion": "latest",
13
+ "sourceType": "module"
14
+ },
15
+ "rules": {
16
+ "no-unused-vars": "warn",
17
+ "no-console": "off",
18
+ "semi": [
19
+ "error",
20
+ "always"
9
21
  ],
10
- "parserOptions": {
11
- "ecmaVersion": "latest",
12
- "sourceType": "module"
13
- },
14
- "rules": {
15
- "no-unused-vars": "warn",
16
- "no-console": "off",
17
- "semi": ["error", "always"],
18
- "quotes": ["error", "single"]
19
- }
22
+ "quotes": [
23
+ "error",
24
+ "single"
25
+ ]
20
26
  }
21
-
27
+ }
@@ -0,0 +1,46 @@
1
+ # .github/workflows/docs-deploy.yml
2
+ # Version: 1.1.0
3
+ # Description: Deploys Docusaurus to GitHub Pages on changes to documentation files
4
+ # Author: Ali Kahwaji
5
+
6
+ name: πŸ“š Deploy Docusaurus Docs
7
+
8
+ on:
9
+ push:
10
+ branches: [main]
11
+ paths:
12
+ - 'docs-site/**'
13
+ - 'docs/**'
14
+ - 'blog/**'
15
+ - 'sidebars.js'
16
+ - 'docusaurus.config.js'
17
+ - 'package.json'
18
+
19
+ jobs:
20
+ deploy:
21
+ name: Deploy to GitHub Pages
22
+ runs-on: ubuntu-latest
23
+
24
+ steps:
25
+ - name: πŸ“₯ Checkout repository
26
+ uses: actions/checkout@v4
27
+
28
+ - name: βš™οΈ Setup Node.js
29
+ uses: actions/setup-node@v4
30
+ with:
31
+ node-version: 20
32
+
33
+ - name: πŸ“¦ Install dependencies
34
+ run: npm ci
35
+
36
+ - name: πŸ› οΈ Build Docusaurus site
37
+ run: npm run docs:build
38
+
39
+ - name: πŸš€ Deploy to GitHub Pages
40
+ uses: peaceiris/actions-gh-pages@v4
41
+ with:
42
+ github_token: ${{ secrets.GITHUB_TOKEN }}
43
+ publish_dir: ./docs-site/build
44
+ publish_branch: gh-pages
45
+ user_name: github-actions[bot]
46
+ user_email: 41898282+github-actions[bot]@users.noreply.github.com
@@ -0,0 +1,53 @@
1
+ # .github/workflows/publish-release-blog.yml
2
+ # Version: 1.1.0
3
+ # Description: Auto-publish blog post from CHANGELOG or prepared .md after NPM release
4
+ # Author: Ali Kahwaji
5
+
6
+ name: ✨ Publish Release Blog Post
7
+
8
+ on:
9
+ release:
10
+ types: [published]
11
+
12
+ jobs:
13
+ publish-blog-post:
14
+ name: Generate & Commit Blog Post
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: ⬇️ Checkout main branch
19
+ uses: actions/checkout@v4
20
+ with:
21
+ ref: main # βœ… Ensures blog is committed to 'main'
22
+ fetch-depth: 0
23
+
24
+ - name: πŸ”§ Set up Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: 20
28
+
29
+ - name: ✏️ Generate blog post
30
+ run: |
31
+ VERSION=${GITHUB_REF#refs/tags/}
32
+ DATE=$(date +'%Y-%m-%d')
33
+ FILE="docs-site/blog/${DATE}-release-${VERSION}.md"
34
+
35
+ echo "---" > $FILE
36
+ echo "slug: release-${VERSION}" >> $FILE
37
+ echo "title: ✨ Version ${VERSION} Released" >> $FILE
38
+ echo "authors: [ali]" >> $FILE
39
+ echo "tags: [release, changelog]" >> $FILE
40
+ echo "---" >> $FILE
41
+ echo >> $FILE
42
+ echo "RAG Pipeline Utils v${VERSION} is now available on NPM!" >> $FILE
43
+ echo >> $FILE
44
+ echo "#### Highlights" >> $FILE
45
+ echo "- πŸš€ Auto-published blog from GitHub release" >> $FILE
46
+ echo "- πŸ“¦ Version bump: ${VERSION}" >> $FILE
47
+ echo "- πŸ“˜ See CHANGELOG.md for full details" >> $FILE
48
+
49
+ - name: πŸ“‹ Commit blog post
50
+ uses: stefanzweifel/git-auto-commit-action@v5
51
+ with:
52
+ commit_message: "docs(blog): add release post for ${{ github.ref_name }}"
53
+ file_pattern: "docs-site/blog/*.md"
@@ -0,0 +1,33 @@
1
+ # .github/workflows/storybook-deploy.yml
2
+ name: πŸ“˜ Deploy Storybook
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ paths:
8
+ - 'docs-site/src/components/**'
9
+ - '.storybook/**'
10
+
11
+ jobs:
12
+ deploy-storybook:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Setup Node
19
+ uses: actions/setup-node@v4
20
+ with:
21
+ node-version: 20
22
+
23
+ - name: Install dependencies
24
+ run: npm ci
25
+
26
+ - name: Build Storybook
27
+ run: npm run build-storybook
28
+
29
+ - name: Deploy to GitHub Pages
30
+ uses: peaceiris/actions-gh-pages@v4
31
+ with:
32
+ github_token: ${{ secrets.GITHUB_TOKEN }}
33
+ publish_dir: ./storybook-static
package/.husky/pre-commit CHANGED
@@ -3,3 +3,4 @@
3
3
 
4
4
  npm run validate-fixtures && npm run lint
5
5
  npx lint-staged
6
+ node scripts/validate-changelog-version.js
@@ -0,0 +1,20 @@
1
+
2
+
3
+ /** @type { import('@storybook/react-webpack5').StorybookConfig } */
4
+ const config = {
5
+ "stories": [
6
+ "../src/**/*.mdx",
7
+ "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
8
+ ],
9
+ "addons": [
10
+ "@storybook/addon-webpack5-compiler-swc",
11
+ "@storybook/addon-essentials",
12
+ "@storybook/addon-onboarding",
13
+ "@storybook/addon-interactions"
14
+ ],
15
+ "framework": {
16
+ "name": "@storybook/react-webpack5",
17
+ "options": {}
18
+ }
19
+ };
20
+ export default config;
@@ -0,0 +1,13 @@
1
+ /** @type { import('@storybook/react').Preview } */
2
+ const preview = {
3
+ parameters: {
4
+ controls: {
5
+ matchers: {
6
+ color: /(background|color)$/i,
7
+ date: /Date$/i,
8
+ },
9
+ },
10
+ },
11
+ };
12
+
13
+ export default preview;
package/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Changelog
2
2
 
3
- # [2.0.0](https://github.com/DevilsDev/rag-pipeline-utils/compare/v1.0.1...v2.0.0) (2025-04-17)
3
+ # [2.1.0](https://github.com/DevilsDev/rag-pipeline-utils/compare/v2.0.2...v2.1.0) (2025-04-18)
4
+
5
+
6
+ ### Features
7
+
8
+ * **docs-site:** add Storybook integration with BlogCard + LQIP image automation ([80965b8](https://github.com/DevilsDev/rag-pipeline-utils/commit/80965b8ef1d26372852ee0f39b56a73f337e0cea))
9
+
10
+ ## [2.0.1](https://github.com/DevilsDev/rag-pipeline-utils/compare/v2.0.0...v2.0.1) (2025-04-17)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add @docusaurus/preset-classic to enable CI builds ([ed5e771](https://github.com/DevilsDev/rag-pipeline-utils/commit/ed5e771f919face4693a6a7abfed4cf0fe1325ca))
16
+
17
+ ## [2.0.0] - 2025-04-17 (2025-04-17)
4
18
 
5
19
 
6
20
  ### Bug Fixes
package/README.md CHANGED
@@ -1,117 +1,146 @@
1
1
  # @DevilsDev/rag-pipeline-utils
2
2
 
3
+
4
+
5
+ # RAG Pipeline Utils
6
+
7
+ > Modular utilities for building Retrieval-Augmented Generation (RAG) pipelines, with CI-verified plugin contracts and mockable interfaces.
8
+
3
9
  [![CI](https://github.com/DevilsDev/rag-pipeline-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/DevilsDev/rag-pipeline-utils/actions)
4
10
  [![codecov](https://codecov.io/gh/DevilsDev/rag-pipeline-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/DevilsDev/rag-pipeline-utils)
5
11
  ![Release](https://img.shields.io/github/v/release/DevilsDev/rag-pipeline-utils?label=release)
12
+ ![License](https://img.shields.io/github/license/devilsdev/rag-pipeline-utils)
6
13
 
7
- **A modular Node.js toolkit for building RAG (Retrieval-Augmented Generation) pipelines with clean abstractions, pluggable components, and scalable architecture.**
14
+ ## Description
8
15
 
9
- ---
16
+ `@devilsdev/rag-pipeline-utils` provides a clean, extensible, and test-friendly foundation for constructing robust RAG pipelines using a plugin-based architecture. It enables developers to plug in their own document loaders, embedders, retrievers, and LLMs via configuration, and includes a CLI, mock contract verification, schema validation, and test harnesses to ensure production-readiness.
10
17
 
11
- ## Features
18
+ ## Key Features
12
19
 
13
- - βœ… Plugin-based architecture for RAG pipelines
14
- - βœ… Embedding + retrieval abstraction
15
- - βœ… Vector DB integrations (e.g., Pinecone)
16
- - βœ… Modular document loaders (PDF, HTML, Markdown, CSV, Directory)
17
- - βœ… CLI with `.ragrc.json` config fallback
18
- - βœ… Retry, backoff, and logging built-in
19
- - βœ… Reranker support and evaluation tooling
20
- - βœ… React dashboard for evaluation results
20
+ - **Plugin Contracts**: Runtime and CI verification of plugin interfaces (loader, embedder, retriever, llm).
21
+ - **CLI Support**: Easily run `ingest` and `query` commands using `.ragrc.json` configuration.
22
+ - **Test Fixtures**: Snapshot, fallback, and structured reranker validation.
23
+ - **Schema Enforcement**: `.ragrc.json` schema validation to catch config issues early.
24
+ - **Mock Repair Utilities**: Auto-fix for missing or broken mock implementations.
25
+ - **Modular Design**: Drop-in plugin support using custom class-based implementations.
21
26
 
22
- ---
27
+ ## Benefits of This Modular Design
28
+
29
+ - **Extensibility**: Developers can inject their own loader, retriever, or LLM logic without modifying the core.
30
+ - **Testability**: Mocks and CI tools validate contract adherence for reliable test coverage.
31
+ - **Decoupling**: Each plugin can be independently implemented and swapped in via `.ragrc.json`.
32
+ - **CI Resilience**: The CI pipeline includes linting, contract verification, and test coverage enforcement.
23
33
 
24
34
  ## Installation
25
35
 
26
36
  ```bash
27
- npm install @yourorg/rag-pipeline-utils
37
+ npm install @devilsdev/rag-pipeline-utils
28
38
  ```
29
39
 
30
- ---
40
+ ## Basic Usage
31
41
 
32
- ## Usage
42
+ 1. Create a `.ragrc.json` config:
33
43
 
34
- ```js
35
- import { createRagPipeline } from '@yourorg/rag-pipeline-utils';
44
+ ```json
45
+ {
46
+ "loader": {
47
+ "pdf": "./src/mocks/pdf-loader.js"
48
+ },
49
+ "embedder": {
50
+ "openai": "./src/mocks/openai-embedder.js"
51
+ },
52
+ "retriever": {
53
+ "pinecone": "./src/mocks/pinecone-retriever.js"
54
+ },
55
+ "llm": {
56
+ "openai": "./src/mocks/openai-llm.js"
57
+ },
58
+ "namespace": "demo-namespace",
59
+ "pipeline": ["loader", "embedder", "retriever"]
60
+ }
61
+ ```
36
62
 
37
- const rag = createRagPipeline({
38
- loader: 'markdown',
39
- embedder: 'openai',
40
- retriever: 'pinecone',
41
- llm: 'openai-gpt-4',
42
- useReranker: true
43
- });
63
+ 2. Run an ingestion:
44
64
 
45
- const answer = await rag.query('What is a vector database?');
46
- console.log(answer);
65
+ ```bash
66
+ node bin/cli.js ingest ./docs/sample.pdf
47
67
  ```
48
68
 
49
- ---
50
-
51
- ## Testing
69
+ 3. Run a query:
52
70
 
53
71
  ```bash
54
- npm test
72
+ node bin/cli.js query "What is in the document?"
55
73
  ```
56
74
 
57
- ---
75
+ ## Plugin Contracts
76
+
77
+ Each plugin must implement the following interface:
78
+
79
+ | Type | Required Methods |
80
+ | --------- | ------------------------------------------- |
81
+ | loader | `load(filePath)` |
82
+ | embedder | `embed(documents)`, `embedQuery(query)` |
83
+ | retriever | `store(vectors)`, `search(queryVector)` |
84
+ | llm | `ask(prompt)` |
85
+
86
+ ## Folder Structure
87
+
88
+ ```text
89
+ /project-root
90
+ β”œβ”€β”€ /src
91
+ β”‚ β”œβ”€β”€ /routes
92
+ β”‚ β”œβ”€β”€ /services
93
+ β”‚ β”œβ”€β”€ /utils
94
+ β”‚ └── app.js
95
+ β”œβ”€β”€ /scripts
96
+ β”‚ β”œβ”€β”€ setup.js
97
+ β”‚ β”œβ”€β”€ ci-runner.js
98
+ β”‚ └── repair-fixtures.js
99
+ β”œβ”€β”€ /__tests__
100
+ β”‚ β”œβ”€β”€ /fixtures
101
+ β”‚ β”œβ”€β”€ /unit
102
+ β”‚ β”œβ”€β”€ /integration
103
+ β”œβ”€β”€ /public
104
+ β”œβ”€β”€ README.md
105
+ β”œβ”€β”€ USE_CASES.md
106
+ β”œβ”€β”€ CHANGELOG.md
107
+ └── .env.example
108
+ ```
58
109
 
59
- ## CLI
60
110
 
61
- ```bash
62
- rag-pipeline ingest ./docs/my.pdf --loader pdf
63
- rag-pipeline query "Explain RAG pipelines" --llm openai-gpt-4
64
- rag-pipeline evaluate ./fixtures/sample-eval-dataset.json
65
- rag-pipeline rerank "Explain embeddings" --retriever pinecone
66
- ```
67
111
 
68
- Supports `.ragrc.json` fallback configuration:
112
+ ## Why Use This?
69
113
 
70
- ```json
71
- {
72
- "loader": "directory",
73
- "embedder": "openai",
74
- "retriever": "pinecone",
75
- "llm": "openai-gpt-4",
76
- "useReranker": true
77
- }
78
- ```
114
+ - **Developer Experience**: Fast iteration, full contract CI
115
+ - **Pluggable Design**: Swap in your stack (OpenAI, Pinecone, Langchain, etc.)
116
+ - **Minimal & Modular**: Clean separation of concerns
117
+ - **Prod-ready**: 100% test coverage, schema validation, CLI control
79
118
 
80
- ---
81
119
 
82
- ## Project Structure
83
120
 
84
- ```
85
- /src
86
- β”œβ”€β”€ core/ # Pipeline + registry
87
- β”œβ”€β”€ loader/ # Loaders for md, html, csv, dir
88
- β”œβ”€β”€ reranker/ # LLM-based context reranker
89
- β”œβ”€β”€ evaluate/ # Scoring, batch QA evaluation
90
- β”œβ”€β”€ utils/ # Logger, retry, schema
91
- /bin/cli.js # CLI entrypoint
92
- /__tests__/ # Unit, integration, snapshot tests
93
- /public/ # Evaluation dashboard (React)
94
- .github/workflows/ci.yml # CI config
95
- ```
121
+ ## Use Cases
96
122
 
97
- ---
123
+ Explore real-world DevX-focused examples in [USE_CASES.md](./Use-Cases.md), including:
98
124
 
99
- ## Evaluation Dashboard
125
+ - Mock-driven plugin TDD
126
+ - CI-based interface validation
127
+ - Multivendor ingestion and search
128
+ - Runtime swap of LLM, retrievers, or embedders
129
+ - Bootstrap pipelines with auto-repairable defaults
100
130
 
101
- ```bash
102
- node server.js
103
- ```
104
131
 
105
- Visit: [http://localhost:3000](http://localhost:3000) β†’ Visualizes metrics, BLEU/ROUGE, pass rate.
106
132
 
107
- ---
133
+ ## Contributing
134
+
135
+ We welcome contributions via PRs, especially new mock providers, validation helpers, and runtime extensions. Please follow the test + CI conventions before submitting.
136
+
137
+
108
138
 
109
139
  ## License
110
140
 
111
- Apache-2.0
141
+ This project is licensed under the **GNU GPL v3.0** License - see the [LICENSE](./LICENSE) file for details.
112
142
 
113
143
  ---
114
144
 
115
- ## πŸ‘€ Author
145
+ Built with ❀️ by [Ali Kahwaji].
116
146
 
117
- Ali Kahwaji β€” [@DevilsDev](https://github.com/DevilsDev)
package/Use-Cases.md ADDED
@@ -0,0 +1,134 @@
1
+ # RAG Pipeline Utils β€” Developer-Focused Use Cases
2
+
3
+ > Modular, composable, and CI-verified RAG orchestration for modern AI applications.
4
+
5
+ ---
6
+
7
+ ## Use Case 1: Pluggable Local RAG Stack for Prototyping
8
+
9
+ **Problem:** Traditional RAG tools force tight vendor dependencies.
10
+
11
+ **Solution:** Use mockable local plugin implementations to simulate loaders, embedders, retrievers, and LLMs.
12
+
13
+ ```bash
14
+ npm install @devilsdev/rag-pipeline-utils
15
+ ```
16
+
17
+ ```js
18
+ // cli.js or app.js
19
+ import { PluginRegistry } from './src/core/plugin-registry.js';
20
+ import { loadRagConfig } from './src/config/load-config.js';
21
+
22
+ const config = loadRagConfig('.ragrc.json');
23
+ const loader = PluginRegistry.getPlugin('loader', 'pdf');
24
+ const docs = loader.load('./test.pdf');
25
+ ```
26
+
27
+ **Benefits**
28
+ - Local plugin mocks with expected method contracts
29
+ - Reusable plugin templates (`pdf-loader.js`, `openai-embedder.js`)
30
+ - Dev-first DX: debug, snapshot, iterate without cloud costs
31
+
32
+ ---
33
+
34
+ ## Use Case 2: Declarative CLI RAG Pipelines (CI-Ready)
35
+
36
+ **Problem:** Hardcoded pipeline steps can't be validated or changed by non-engineers.
37
+
38
+ **Solution:** Define `.ragrc.json` once and reuse across environments.
39
+
40
+ ```json
41
+ {
42
+ "loader": { "pdf": "./src/mocks/pdf-loader.js" },
43
+ "embedder": { "openai": "./src/mocks/openai-embedder.js" },
44
+ "retriever": { "pinecone": "./src/mocks/pinecone-retriever.js" },
45
+ "llm": { "openai": "./src/mocks/openai-llm.js" },
46
+ "namespace": "docs-poc",
47
+ "pipeline": ["loader", "embedder", "retriever"]
48
+ }
49
+ ```
50
+
51
+ ```bash
52
+ node ./bin/cli.js ingest ./docs/whitepaper.pdf
53
+ node ./bin/cli.js query "What’s the goal of this architecture?"
54
+ ```
55
+
56
+ **Benefits**
57
+ - Teams can standardize pipelines in source control
58
+ - Tests fail fast if structure or mocks drift
59
+ - Non-devs can operate pipelines via CLI
60
+
61
+ ---
62
+
63
+ ## Use Case 3: Mock-First TDD for Plugin Development
64
+
65
+ **Problem:** LLM, vector, and loader logic are often developed without tests.
66
+
67
+ **Solution:** Define contract-compliant mocks and CI-validate their structure before connecting to APIs.
68
+
69
+ ```js
70
+ export default class CustomEmbedder {
71
+ embed(docs) { return docs.map(...); }
72
+ embedQuery(q) { return [...]; }
73
+ }
74
+ ```
75
+
76
+ Run full contract verification:
77
+
78
+ ```bash
79
+ npm run ci
80
+ ```
81
+
82
+ **Benefits**
83
+ - Every plugin is CI-verified for method presence
84
+ - Shared contracts enforce required interfaces
85
+ - Onboarding new devs? Just follow `pluginContracts.js`
86
+
87
+ ---
88
+
89
+ ## Use Case 4: Vendor-Neutral AI Data Pipelines
90
+
91
+ **Problem:** Every RAG stack is locked to OpenAI + Pinecone + Langchain.
92
+
93
+ **Solution:** Use this project to mix, match, or mock vector/LLM pairs:
94
+
95
+ ```js
96
+ "retriever": { "localstore": "./src/plugins/local-retriever.js" },
97
+ "llm": { "cohere": "./src/plugins/cohere-llm.js" }
98
+ ```
99
+
100
+ **Benefits**
101
+ - Run multiple RAG pipelines in parallel (A/B testing, evals)
102
+ - Lower infra cost with offline/local plugin support
103
+ - Integrate with tools outside Langchain ecosystem
104
+
105
+ ---
106
+
107
+ ## πŸ›  Use Case 5: Plugin Engineering with Guardrails
108
+
109
+ **Problem:** Complex plugin systems break silently.
110
+
111
+ **Solution:** This framework has:
112
+ - Plugin method contract enforcement
113
+ - CLI test runner (`scripts/ci-runner.js`)
114
+ - Auto repair tool (`scripts/repair-fixtures.js`)
115
+
116
+ **DX Boost**
117
+ - One-line plugin repairs
118
+ - Validated schema structure
119
+ - Aligned to real-world developer workflows
120
+
121
+ ---
122
+
123
+ ## Cross References
124
+
125
+ - [README](./README.md) β€” Project overview, architecture, CLI and configuration details
126
+ - [pluginContracts.js](./src/core/plugin-contracts.js) β€” Interface contracts for loader, embedder, retriever, LLM
127
+ - [diagnostic-reporter.js](./src/utils/ci/diagnostic-reporter.js) β€” CI error helper
128
+ - [repair-fixtures.js](./scripts/repair-fixtures.js) β€” Auto-regeneration of mocks
129
+
130
+ ---
131
+
132
+ ## License
133
+
134
+ Licensed under the **GPL-3.0 License** β€” see [LICENSE](./LICENSE) for full terms.
@@ -0,0 +1 @@
1
+ {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAIAAADwyuo0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGklEQVR4nGPILapfuW5vblF9blE9A4QD4QMApeANEwX0WNkAAAAASUVORK5CYII="}
@@ -0,0 +1 @@
1
+ {"base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAT0lEQVR4nAFEALv/AIXNrxKW5b44TKykITGQkA0Atv/dK37FpoIVaGhbSqqbIQAPMjMPAAcXJAAHGTkXJjUQABw3QRQOJT0bFCA3HBUiNRZrJhOUbaRuqQAAAABJRU5ErkJggg=="}
@@ -0,0 +1,8 @@
1
+ // .storybook/preview.js
2
+ export const parameters = {
3
+ layout: 'centered',
4
+ docs: {
5
+ title: '🧩 RAG Pipeline UI Components',
6
+ },
7
+ };
8
+
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  slug: welcome
3
3
  title: Welcome
4
- authors: [slorber, yangshun]
5
4
  tags: [facebook, hello, docusaurus]
6
5
  ---
7
6