@devilsdev/rag-pipeline-utils 2.1.5 → 2.1.8

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 (142) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +395 -179
  3. package/bin/cli.js +14 -62
  4. package/contracts/embedder-contract.json +52 -0
  5. package/contracts/llm-contract.json +36 -0
  6. package/contracts/loader-contract.json +43 -0
  7. package/contracts/retriever-contract.json +68 -0
  8. package/dist/index.cjs +67 -0
  9. package/dist/index.mjs +51 -0
  10. package/package.json +108 -22
  11. package/.codecov.yml +0 -21
  12. package/.dockerignore +0 -14
  13. package/.eslintignore +0 -5
  14. package/.eslintrc.json +0 -28
  15. package/.github/PROJECT_ROADMAP.md +0 -102
  16. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  17. package/.github/release-template.md +0 -20
  18. package/.github/workflows/changelog-auto-commit.yml +0 -37
  19. package/.github/workflows/ci.yml +0 -53
  20. package/.github/workflows/docs-ci.yml +0 -46
  21. package/.github/workflows/docs-deploy.yml +0 -55
  22. package/.github/workflows/enforce-release-review.yml +0 -47
  23. package/.github/workflows/publish-release-blog.yml +0 -47
  24. package/.github/workflows/release-sync.yml +0 -50
  25. package/.github/workflows/roadmap-label-sync.yml +0 -35
  26. package/.github/workflows/roadmap-labels.yml +0 -67
  27. package/.github/workflows/roadmap-sync.yml +0 -44
  28. package/.github/workflows/sync-roadmap.yml +0 -62
  29. package/.husky/pre-commit +0 -6
  30. package/CHANGELOG.md +0 -97
  31. package/Dockerfile +0 -22
  32. package/Use-Cases.md +0 -134
  33. package/__tests__/fixtures/.ragrc.json +0 -8
  34. package/__tests__/fixtures/invalid-ragrc.json +0 -4
  35. package/__tests__/fixtures/sample-eval-dataset.json +0 -15
  36. package/__tests__/fixtures/sample.pdf +0 -1
  37. package/__tests__/fixtures/src/mocks/openai-embedder.js +0 -16
  38. package/__tests__/fixtures/src/mocks/openai-llm.js +0 -9
  39. package/__tests__/fixtures/src/mocks/pdf-loader.js +0 -17
  40. package/__tests__/fixtures/src/mocks/pinecone-retriever.js +0 -26
  41. package/__tests__/fixtures/valid-ragrc.json +0 -16
  42. package/__tests__/integration/cli/config-flow.test.js +0 -98
  43. package/__tests__/integration/config/load-config.test.js +0 -67
  44. package/__tests__/scripts/ensure-roadmap-labels.test.js +0 -64
  45. package/__tests__/unit/config/validate-schema.test.js +0 -121
  46. package/__tests__/unit/core/plugin-registry.test.js +0 -55
  47. package/__tests__/unit/reranker/__snapshots__/reranker.snapshot.test.js.snap +0 -15
  48. package/__tests__/unit/reranker/llm-reranker.test.js +0 -18
  49. package/__tests__/unit/reranker/reranker.enriched.test.js +0 -19
  50. package/__tests__/unit/reranker/reranker.fallback.test.js +0 -15
  51. package/__tests__/unit/reranker/reranker.snapshot.test.js +0 -15
  52. package/__tests__/unit/reranker/reranker.structured-output.test.js +0 -17
  53. package/codecov +0 -0
  54. package/codecov.SHA256SUM +0 -1
  55. package/codecov.SHA256SUM.sig +0 -16
  56. package/docs-site/README.md +0 -41
  57. package/docs-site/blog/2025-04-18-architecture-overview.md +0 -16
  58. package/docs-site/blog/2025-04-18-release-v2.1.1.md +0 -13
  59. package/docs-site/blog/2025-04-19-prompt-engineering-best-practices.md +0 -16
  60. package/docs-site/blog/2025-04-20-image-showcase.md +0 -14
  61. package/docs-site/blog/2025-04-20-release-2.1.1.md +0 -21
  62. package/docs-site/blog/2025-04-21-release-v2.1.3.md +0 -13
  63. package/docs-site/blog/2025-04-21-release-v2.1.4.md +0 -13
  64. package/docs-site/blog/authors.yml +0 -5
  65. package/docs-site/blog/tags.yml +0 -60
  66. package/docs-site/docs/Architecture.md +0 -76
  67. package/docs-site/docs/CLI.md +0 -69
  68. package/docs-site/docs/Evaluation.md +0 -61
  69. package/docs-site/docs/FAQ.md +0 -50
  70. package/docs-site/docs/Introduction.md +0 -58
  71. package/docs-site/docs/Plugins.md +0 -61
  72. package/docs-site/docs/Tutorials.md +0 -106
  73. package/docs-site/docs/Usage.md +0 -72
  74. package/docs-site/docs/Use-Cases.md +0 -77
  75. package/docs-site/docs/intro.mdx +0 -6
  76. package/docs-site/docusaurus.config.js +0 -88
  77. package/docs-site/package-lock.json +0 -17914
  78. package/docs-site/package.json +0 -47
  79. package/docs-site/sidebars.js +0 -39
  80. package/docs-site/src/components/HomepageFeatures/index.js +0 -56
  81. package/docs-site/src/components/HomepageFeatures/index.module.css +0 -57
  82. package/docs-site/src/components/HomepageHeader/index.js +0 -46
  83. package/docs-site/src/components/HomepageHeader/index.module.css +0 -77
  84. package/docs-site/src/css/custom.css +0 -104
  85. package/docs-site/src/pages/index.js +0 -20
  86. package/docs-site/src/pages/index.module.css +0 -23
  87. package/docs-site/src/pages/markdown-page.md +0 -7
  88. package/docs-site/static/.nojekyll +0 -0
  89. package/docs-site/static/img/authors/ali.jpg +0 -0
  90. package/docs-site/static/img/hero.jpg +0 -0
  91. package/docs-site/static/img/logo.png +0 -0
  92. package/docs-site/static/img/logo.svg +0 -6
  93. package/docs-site/static/img/social-card.jpg +0 -0
  94. package/jest.config.js +0 -24
  95. package/plugin.config.json +0 -14
  96. package/public/index.html +0 -0
  97. package/public/results/sample-eval.json +0 -0
  98. package/public/src/App.jsx +0 -57
  99. package/release.config.js +0 -36
  100. package/scripts/banner-injector.js +0 -102
  101. package/scripts/ci-runner.js +0 -51
  102. package/scripts/close-done-roadmap-issues.js +0 -65
  103. package/scripts/create-roadmap-issues.js +0 -47
  104. package/scripts/ensure-roadmap-labels.js +0 -73
  105. package/scripts/fix-mdx-blog-imports.js +0 -50
  106. package/scripts/fix-mdx-image-imports.js +0 -27
  107. package/scripts/generate-release-note.js +0 -40
  108. package/scripts/label-roadmap-issues.js +0 -125
  109. package/scripts/manual-test-checklist.md +0 -90
  110. package/scripts/repair-fixtures.js +0 -30
  111. package/scripts/setup.js +0 -31
  112. package/scripts/sync-labels.js +0 -71
  113. package/scripts/sync-roadmap-labels.js +0 -21
  114. package/scripts/tag-release.js +0 -64
  115. package/scripts/test-global-setup.js +0 -18
  116. package/scripts/validate-changelog-version.js +0 -48
  117. package/scripts/verify-fixture-mocks.js +0 -45
  118. package/scripts/verify-fixtures.js +0 -36
  119. package/server.js +0 -31
  120. package/src/config/load-config.js +0 -33
  121. package/src/config/load-plugin-config.js +0 -56
  122. package/src/config/validate-plugin-schema.js +0 -28
  123. package/src/config/validate-schema.js +0 -107
  124. package/src/core/create-pipeline.js +0 -96
  125. package/src/core/plugin-contracts.js +0 -21
  126. package/src/core/plugin-registry.js +0 -48
  127. package/src/dag/dag-engine.js +0 -70
  128. package/src/evaluate/evaluator.js +0 -44
  129. package/src/evaluate/scoring.js +0 -74
  130. package/src/loader/csv-loader.js +0 -30
  131. package/src/loader/directory-loader.js +0 -38
  132. package/src/loader/html-loader.js +0 -57
  133. package/src/loader/markdown-loader.js +0 -58
  134. package/src/mocks/openai-embedder.js +0 -30
  135. package/src/mocks/openai-llm.js +0 -18
  136. package/src/mocks/pdf-loader.js +0 -17
  137. package/src/mocks/pinecone-retriever.js +0 -25
  138. package/src/reranker/llm-reranker.js +0 -34
  139. package/src/utils/ci/diagnostic-reporter.js +0 -36
  140. package/src/utils/logger.js +0 -29
  141. package/src/utils/retry.js +0 -42
  142. package/src/utils/validate-plugin-contract.js +0 -36
@@ -1,121 +0,0 @@
1
- /**
2
- * Version: 1.1.0
3
- * Description: Schema validation tests for .ragrc.json using AJV and external fixtures
4
- * Author: Ali Kahwaji
5
- * File: __tests__/unit/config/validate-schema.test.js
6
- */
7
-
8
- import { readFileSync } from 'fs';
9
- import { resolve } from 'path';
10
- import { validateRagrcSchema, validatePluginSchema } from '../../../src/config/validate-schema.js';
11
-
12
- const readFixture = (name) => {
13
- const filePath = resolve('__tests__/fixtures',name.replace('.ragrc', '-ragrc'));
14
- return JSON.parse(readFileSync(filePath, 'utf-8'));
15
- };
16
-
17
- describe('validateRagrcSchema', () => {
18
- test('passes with valid structured plugin schema', () => {
19
- const config = readFixture('valid-ragrc.json');
20
- const result = validateRagrcSchema(config);
21
- expect(result.valid).toBe(true);
22
- expect(result.errors).toBeUndefined(); // updated: null => undefined
23
- });
24
-
25
- test('fails with missing pipeline', () => {
26
- const config = {
27
- loader: { pdf: './src/mocks/pdf-loader.js' },
28
- namespace: 'no-pipeline'
29
- };
30
- const result = validateRagrcSchema(config);
31
- expect(result.valid).toBe(false);
32
- expect(result.errors).toEqual(
33
- expect.arrayContaining([
34
- expect.objectContaining({
35
- keyword: 'required',
36
- params: expect.objectContaining({ missingProperty: 'pipeline' })
37
- })
38
- ])
39
- );
40
- });
41
-
42
- test('fails with non-object plugin sections', () => {
43
- const config = {
44
- loader: './src/invalid.js', // should be object
45
- embedder: { openai: './src/mocks/openai-embedder.js' },
46
- retriever: { pinecone: './src/mocks/pinecone-retriever.js' },
47
- llm: { openai: './src/mocks/openai-llm.js' },
48
- pipeline: ['loader'],
49
- namespace: 'invalid-section'
50
- };
51
- const result = validateRagrcSchema(config);
52
- expect(result.valid).toBe(false);
53
- expect(result.errors).toEqual(
54
- expect.arrayContaining([
55
- expect.objectContaining({ instancePath: '/loader' })
56
- ])
57
- );
58
- });
59
-
60
- test('fails with non-string namespace', () => {
61
- const config = {
62
- loader: { pdf: './src/mocks/pdf-loader.js' },
63
- embedder: { openai: './src/mocks/openai-embedder.js' },
64
- retriever: { pinecone: './src/mocks/pinecone-retriever.js' },
65
- llm: { openai: './src/mocks/openai-llm.js' },
66
- pipeline: ['loader'],
67
- namespace: 12345
68
- };
69
- const result = validateRagrcSchema(config);
70
- expect(result.valid).toBe(false);
71
- expect(result.errors).toEqual(
72
- expect.arrayContaining([
73
- expect.objectContaining({ instancePath: '/namespace' })
74
- ])
75
- );
76
- });
77
- });
78
-
79
- describe('validatePluginSchema (subset)', () => {
80
- test('passes with plugin-only valid structure', () => {
81
- const config = {
82
- loader: { pdf: './src/mocks/pdf-loader.js' },
83
- embedder: { openai: './src/mocks/openai-embedder.js' },
84
- retriever: { pinecone: './src/mocks/pinecone-retriever.js' },
85
- llm: { openai: './src/mocks/openai-llm.js' }
86
- };
87
- const result = validatePluginSchema(config);
88
- expect(result.valid).toBe(true);
89
- });
90
-
91
- test('fails when plugin section is missing', () => {
92
- const config = {
93
- embedder: { openai: './mock.js' },
94
- retriever: { pinecone: './mock.js' },
95
- llm: { openai: './mock.js' }
96
- };
97
- const result = validatePluginSchema(config);
98
- expect(result.valid).toBe(false);
99
- expect(result.errors).toEqual(
100
- expect.arrayContaining([
101
- expect.objectContaining({ instancePath: '', message: expect.stringContaining('must have required property') })
102
- ])
103
- );
104
- });
105
-
106
- test('fails when plugin paths are not strings', () => {
107
- const config = {
108
- loader: { pdf: 12345 },
109
- embedder: { openai: './mock.js' },
110
- retriever: { pinecone: './mock.js' },
111
- llm: { openai: './mock.js' }
112
- };
113
- const result = validatePluginSchema(config);
114
- expect(result.valid).toBe(false);
115
- expect(result.errors).toEqual(
116
- expect.arrayContaining([
117
- expect.objectContaining({ instancePath: '/loader/pdf' })
118
- ])
119
- );
120
- });
121
- });
@@ -1,55 +0,0 @@
1
- /**
2
- * Version: 0.1.0
3
- * Path: /__tests__/unit/core/plugin-registry.test.js
4
- * Description: Unit tests for the PluginRegistry class
5
- * Author: Ali Kahwaji
6
- */
7
-
8
- import { PluginRegistry } from '../../../src/core/plugin-registry.js';
9
-
10
- describe('PluginRegistry', () => {
11
- let registry;
12
-
13
- beforeEach(() => {
14
- registry = new PluginRegistry();
15
- });
16
-
17
- test('registers and retrieves a plugin successfully', () => {
18
- const mockPlugin = { name: 'test-loader' };
19
- registry.register('loader', 'test', mockPlugin);
20
- const result = registry.get('loader', 'test');
21
- expect(result).toBe(mockPlugin);
22
- });
23
-
24
- test('overwrites existing plugin under the same name', () => {
25
- const firstPlugin = { name: 'first' };
26
- const secondPlugin = { name: 'second' };
27
- registry.register('embedder', 'dup', firstPlugin);
28
- registry.register('embedder', 'dup', secondPlugin);
29
- const result = registry.get('embedder', 'dup');
30
- expect(result).toBe(secondPlugin);
31
- });
32
-
33
- test('throws error for unknown plugin type on registration', () => {
34
- expect(() => registry.register('unknown-type', 'x', {})).toThrow(/Unknown plugin type/);
35
- });
36
-
37
- test('throws error when retrieving a nonexistent plugin', () => {
38
- expect(() => registry.get('retriever', 'missing')).toThrow(/Plugin not found/);
39
- });
40
-
41
- test('lists all registered plugin names for a type', () => {
42
- registry.register('llm', 'gpt-4', {});
43
- registry.register('llm', 'gpt-3.5', {});
44
- const list = registry.list('llm');
45
- expect(list).toContain('gpt-4');
46
- expect(list).toContain('gpt-3.5');
47
- expect(list.length).toBe(2);
48
- });
49
-
50
- test('throws error when listing plugins for invalid type', () => {
51
- expect(() => registry.list('invalid')).toThrow(/Unknown plugin type/);
52
- });
53
- });
54
-
55
-
@@ -1,15 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`LLMReranker output snapshot 1`] = `
4
- [
5
- {
6
- "text": "B",
7
- },
8
- {
9
- "text": "A",
10
- },
11
- {
12
- "text": "C",
13
- },
14
- ]
15
- `;
@@ -1,18 +0,0 @@
1
- /**
2
- * File: __tests__/unit/reranker/llm-reranker.test.js
3
- * Version: 1.0.0
4
- * Description: Validates core behavior of the LLMReranker module
5
- * Author: @devilsdev
6
- */
7
-
8
- import { LLMReranker } from '../../../src/reranker/llm-reranker.js';
9
-
10
- describe('LLMReranker', () => {
11
- test('returns reranked documents based on mock LLM JSON output', async () => {
12
- const mockLLM = { async generate() { return '[1, 0, 2]'; } };
13
- const docs = [{ text: 'A' }, { text: 'B' }, { text: 'C' }];
14
- const reranker = new LLMReranker({ llm: mockLLM });
15
- const result = await reranker.rerank('What is A?', docs);
16
- expect(result.map(d => d.text)).toEqual(['B', 'A', 'C']);
17
- });
18
- });
@@ -1,19 +0,0 @@
1
- /**
2
- * File: __tests__/unit/reranker/reranker.enriched.test.js
3
- * Version: 1.0.0
4
- * Description: Tests support for extended document structures
5
- * Author: @devilsdev
6
- */
7
- import { LLMReranker } from '../../../src/reranker/llm-reranker.js';
8
-
9
- test('supports documents with metadata', async () => {
10
- const mockLLM = { async generate() { return '[2, 0, 1]'; } };
11
- const docs = [
12
- { text: 'One', source: 'alpha' },
13
- { text: 'Two', source: 'beta' },
14
- { text: 'Three', source: 'gamma' }
15
- ];
16
- const reranker = new LLMReranker({ llm: mockLLM });
17
- const result = await reranker.rerank('Choose the most complete', docs);
18
- expect(result[0]).toHaveProperty('source', 'gamma');
19
- });
@@ -1,15 +0,0 @@
1
- /**
2
- * File: __tests__/unit/reranker/reranker.fallback.test.js
3
- * Version: 1.0.0
4
- * Description: Validates fallback handling for invalid LLM output
5
- * Author: @devilsdev
6
- */
7
- import { LLMReranker } from '../../../src/reranker/llm-reranker.js';
8
-
9
- test('gracefully handles invalid LLM output', async () => {
10
- const mockLLM = { async generate() { return 'INVALID_JSON'; } };
11
- const docs = [{ text: 'X' }, { text: 'Y' }, { text: 'Z' }];
12
- const reranker = new LLMReranker({ llm: mockLLM });
13
- const result = await reranker.rerank('Prompt?', docs);
14
- expect(result.map(d => d.text)).toEqual(['X', 'Y', 'Z']);
15
- });
@@ -1,15 +0,0 @@
1
- /**
2
- * File: __tests__/unit/reranker/reranker.snapshot.test.js
3
- * Version: 1.0.0
4
- * Description: Captures a snapshot baseline of reranked results
5
- * Author: @devilsdev
6
- */
7
- import { LLMReranker } from '../../../src/reranker/llm-reranker.js';
8
-
9
- test('LLMReranker output snapshot', async () => {
10
- const mockLLM = { async generate() { return '[1, 0, 2]'; } };
11
- const mockDocs = [{ text: 'A' }, { text: 'B' }, { text: 'C' }];
12
- const reranker = new LLMReranker({ llm: mockLLM });
13
- const result = await reranker.rerank('What is A?', mockDocs);
14
- expect(result).toMatchSnapshot();
15
- });
@@ -1,17 +0,0 @@
1
- /**
2
- * File: __tests__/unit/reranker/reranker.structured-output.test.js
3
- * Version: 1.0.0
4
- * Description: Validates structured LLM output parsing
5
- * Author: @devilsdev
6
- */
7
- import { LLMReranker } from '../../../src/reranker/llm-reranker.js';
8
-
9
- test('parses structured LLM JSON result', async () => {
10
- const mockLLM = { async generate() {
11
- return JSON.stringify({ ranking: [0, 2, 1] });
12
- }};
13
- const docs = [{ text: 'Alpha' }, { text: 'Beta' }, { text: 'Gamma' }];
14
- const reranker = new LLMReranker({ llm: mockLLM });
15
- const result = await reranker.rerank('Which is alpha?', docs);
16
- expect(result[0].text).toBe('Alpha');
17
- });
package/codecov DELETED
Binary file
package/codecov.SHA256SUM DELETED
@@ -1 +0,0 @@
1
- 0f7aadde579ebde1443ad2f977beada703f562997fdda603f213faf2a8559868 codecov
@@ -1,16 +0,0 @@
1
- -----BEGIN PGP SIGNATURE-----
2
-
3
- iQIzBAABCgAdFiEEJwNOf9uFDgu8LGL/gGuyiu13mGkFAmf1418ACgkQgGuyiu13
4
- mGke3w/8DpgS1CDxKdV50CKy81LmiA995bEw2ePBRc90JzNrGX7m2JcFQr/GUITs
5
- JofhfQ6sxnvLLxTLAyiMI8Tcbr2yN/BIjBERIhN8b20zL3KGY6kVS85czQdPs0a7
6
- BlY3xp7VgCv24E/SWc0m367GvBjVnanhMg+hIoaK4HQpWOx+93GzaGZWCnISl6yh
7
- Zn13zn/b/oXwvd3iekh3qb918kPwq3F3Ufd8gHLf71gH0usDoRIUwVIMYMjuoMeI
8
- ceIjZYe1BLG+hNAUkqboi1GK8IJQH66hwyB82KQxUZG0zEOTwhbvFrIijR30BSk6
9
- KROFxxe8s1kuEZGI/zhKPXkYkjiIdXQQvMP7emsQeLQljRb2k3prUhHw7LyFTPla
10
- KRK9MX1BoLr1Iol0Py/y8luSBCNvAmeCmbh6uGWS/1SJ/mj6CiZibWIO40qH9NJI
11
- wDY/JHrTHA2W2EsvREegny7znurxk1ORwT2scEJobu/NiLQEvpz6fvHaKiBcX45z
12
- 53pv1v0xlTFCEF6Vfg2geywIk4Dfi4l7dxyG9hyHtb1lQ0zwcz9KaAPhMjiJCUPa
13
- zGh0nN/xgkD9u7TNhOW3vG01R/wNW5BF+E8+04AO+RroV230m+a/e958I6pCd9M+
14
- N6FtNND7ZyIVoHiVA/v/tWc+ODZ5b9K8Q1Y6a0jkCbFZ3ZeCrPI=
15
- =onSD
16
- -----END PGP SIGNATURE-----
@@ -1,41 +0,0 @@
1
- # Website
2
-
3
- This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4
-
5
- ### Installation
6
-
7
- ```
8
- $ yarn
9
- ```
10
-
11
- ### Local Development
12
-
13
- ```
14
- $ yarn start
15
- ```
16
-
17
- This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18
-
19
- ### Build
20
-
21
- ```
22
- $ yarn build
23
- ```
24
-
25
- This command generates static content into the `build` directory and can be served using any static contents hosting service.
26
-
27
- ### Deployment
28
-
29
- Using SSH:
30
-
31
- ```
32
- $ USE_SSH=true yarn deploy
33
- ```
34
-
35
- Not using SSH:
36
-
37
- ```
38
- $ GIT_USER=<Your GitHub username> yarn deploy
39
- ```
40
-
41
- If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
@@ -1,16 +0,0 @@
1
- ---
2
- slug: architecture-overview
3
- title: RAG Architecture Overview
4
- authors: [ali]
5
- tags: [architecture, modular]
6
- ---
7
-
8
- Explore the modular RAG pipeline architecture. Components like loaders, embedders, retrievers, and generators are pluggable and testable.
9
-
10
- <!-- truncate -->
11
-
12
- ## Key Concepts
13
-
14
- - Plugin registry for clean composition
15
- - Evaluation layer for metrics like BLEU and recall
16
- - CLI integration for dev-first workflows
@@ -1,13 +0,0 @@
1
- ---
2
- slug: release-v2.1.1
3
- title: ✨ Version v2.1.1 Released
4
- authors: [ali]
5
- tags: [release, changelog]
6
- ---
7
-
8
- RAG Pipeline Utils vv2.1.1 is now available on NPM!
9
-
10
- #### Highlights
11
- - 🚀 Auto-published blog from GitHub release
12
- - 📦 Version bump: v2.1.1
13
- - 📘 See CHANGELOG.md for full details
@@ -1,16 +0,0 @@
1
- ---
2
- slug: prompt-engineering-best-practices
3
- title: Prompt Engineering Best Practices
4
- authors: [ali]
5
- tags: [prompt-engineering, tutorials]
6
- ---
7
-
8
- Design better prompts for your LLM-driven RAG workflows using templating, in-context examples, and task-specific embeddings.
9
-
10
- <!-- truncate -->
11
-
12
- ## Tips
13
-
14
- - Use instructions + context
15
- - Dynamically inject retrieved passages
16
- - Validate through CLI or dashboard
@@ -1,14 +0,0 @@
1
- ---
2
- slug: image-showcase
3
- title: Image Showcase with LQIP
4
- authors: [ali]
5
- tags: [image, tutorials]
6
- ---
7
-
8
- Demonstration of how low-quality image placeholders (LQIP) improve blog UX and optimize web performance.
9
-
10
- <!-- truncate -->
11
-
12
- ## Details
13
-
14
- This post showcases `BlogImage` and `BlogCard` with LQIP integration via Plaiceholder and SSR-safe fallbacks.
@@ -1,21 +0,0 @@
1
- <!-- .github/release-template.md -->
2
-
3
- # 🔖 Release v2.1.1
4
-
5
- **Published:** `2025-04-20`
6
- **Compare changes:** [View diff](https://github.com/DevilsDev/rag-pipeline-utils/compare/v2.0.0...v2.1.1)
7
- **Contributors:** `3`
8
- **Commits:** `17`
9
-
10
- ---
11
-
12
- ## 📦 What's New
13
-
14
- - Placeholder for changelog details or highlights.
15
-
16
- ---
17
-
18
- ## 📘 Changelog
19
-
20
- See full details in [CHANGELOG.md](/CHANGELOG.md)
21
-
@@ -1,13 +0,0 @@
1
- ---
2
- slug: release-v2.1.3
3
- title: ✨ Version v2.1.3 Released
4
- authors: [ali]
5
- tags: [release, changelog]
6
- ---
7
-
8
- RAG Pipeline Utils vv2.1.3 is now available on NPM!
9
-
10
- #### Highlights
11
- - 🚀 Auto-published blog from GitHub Release
12
- - 📦 Version bump: v2.1.3
13
- - 📘 See CHANGELOG.md for full details
@@ -1,13 +0,0 @@
1
- ---
2
- slug: release-v2.1.4
3
- title: ✨ Version v2.1.4 Released
4
- authors: [ali]
5
- tags: [release, changelog]
6
- ---
7
-
8
- RAG Pipeline Utils vv2.1.4 is now available on NPM!
9
-
10
- #### Highlights
11
- - 🚀 Auto-published blog from GitHub Release
12
- - 📦 Version bump: v2.1.4
13
- - 📘 See CHANGELOG.md for full details
@@ -1,5 +0,0 @@
1
- ali:
2
- name: Ali Kahwaji
3
- title: Creator & Maintainer of RAG Pipeline Utils
4
- url: https://github.com/alikahwaji
5
- image_url: /img/authors/ali.jpg
@@ -1,60 +0,0 @@
1
- # docs-site/blog/tags.yml
2
- # Description: Central tag definitions for Docusaurus blog filtering and grouping
3
-
4
- release:
5
- label: Release
6
- permalink: /blog/tags/release
7
-
8
- architecture:
9
- label: Architecture
10
- permalink: /blog/tags/architecture
11
-
12
- prompt-engineering:
13
- label: Prompt Engineering
14
- permalink: /blog/tags/prompt-engineering
15
-
16
- evaluation:
17
- label: Evaluation
18
- permalink: /blog/tags/evaluation
19
-
20
- tutorials:
21
- label: Tutorials
22
- permalink: /blog/tags/tutorials
23
-
24
- changelog:
25
- label: Changelog
26
- permalink: /blog/tags/changelog
27
-
28
- design:
29
- label: Design
30
- permalink: /blog/tags/design
31
-
32
- rag:
33
- label: RAG
34
- permalink: /blog/tags/rag
35
-
36
- developer-tools:
37
- label: Developer Tools
38
- permalink: /blog/tags/developer-tools
39
-
40
- modular:
41
- label: Modular
42
- permalink: /blog/tags/modular
43
-
44
- image:
45
- label: Image
46
- permalink: /blog/tags/image
47
-
48
- facebook:
49
- label: Facebook
50
- permalink: /blog/tags/facebook
51
-
52
- hello:
53
- label: Hello
54
- permalink: /blog/tags/hello
55
-
56
- docusaurus:
57
- label: Docusaurus
58
- permalink: /blog/tags/docusaurus
59
-
60
-
@@ -1,76 +0,0 @@
1
- # Architecture
2
-
3
- This page outlines the internal architecture of the RAG pipeline utilities, emphasizing modularity, plugin design, and SOLID-compliant structure.
4
-
5
- ---
6
-
7
- ## Core Design Philosophy
8
-
9
- The architecture adheres to enterprise-grade practices:
10
-
11
- - **Single Responsibility**: Each component handles one domain concern
12
- - **Pluggable Interfaces**: Any layer (loader, retriever, LLM) can be swapped
13
- - **Streaming-Ready**: Async flows support token-based output
14
- - **Environment-Safe**: Config via `.ragrc.json`, not hardcoded
15
- - **Testable**: All modules can be mocked and unit tested
16
-
17
- ---
18
-
19
- ## Layered Components
20
-
21
- ```
22
- +-------------------------+
23
- | createRagPipeline() |
24
- +-------------------------+
25
- | | |
26
- ▼ ▼ ▼
27
- Loader Embedder Retriever
28
- ▼ | ▼
29
- Chunks Embeddings Context
30
- \ | /
31
- ▼ ▼ ▼
32
- LLM Runner
33
- |
34
- Output
35
- ```
36
-
37
- ---
38
-
39
- ## Core Interfaces
40
-
41
- Each plugin is registered via the `PluginRegistry` and looked up by key.
42
-
43
- ```ts
44
- registry.register('loader', 'pdf', new PDFLoader())
45
- const loader = registry.get('loader', 'pdf');
46
- ```
47
-
48
- All plugins implement interface contracts like:
49
-
50
- ```ts
51
- interface Loader {
52
- load(path: string): Promise<{ chunk(): string[] }[]>;
53
- }
54
-
55
- interface Embedder {
56
- embed(chunks: string[]): Vector[];
57
- embedQuery(prompt: string): Vector;
58
- }
59
-
60
- interface Retriever {
61
- store(vectors: Vector[]): Promise<void>;
62
- retrieve(query: Vector): Promise<Context[]>;
63
- }
64
- ```
65
-
66
- ---
67
-
68
- ## DAG Support
69
-
70
- The `dag-engine.js` module supports chaining multiple components:
71
- - Example: Summarize → Retrieve → Rerank → LLM
72
- - Enables more complex workflows than linear ingestion/query
73
-
74
- ---
75
-
76
- Next → [Evaluation](./Evaluation.md)
@@ -1,69 +0,0 @@
1
- # CLI Reference
2
-
3
- The CLI gives you interactive access to the RAG pipeline tools via terminal.
4
-
5
- Install globally (optional):
6
- ```bash
7
- npm install -g @yourorg/rag-pipeline-utils
8
- ```
9
-
10
- Or run directly from your project:
11
- ```bash
12
- npx rag-pipeline <command>
13
- ```
14
-
15
- ---
16
-
17
- ## Commands
18
-
19
- ### `ingest`
20
- ```bash
21
- rag-pipeline ingest ./docs/sample.pdf --loader pdf
22
- ```
23
- - Loads and indexes documents into vector store
24
-
25
- ### `query`
26
- ```bash
27
- rag-pipeline query "Explain vector databases" --llm openai-gpt-4
28
- ```
29
- - Retrieves context and generates response
30
-
31
- ### `evaluate`
32
- ```bash
33
- rag-pipeline evaluate ./fixtures/eval.json
34
- ```
35
- - Runs batch evaluation with BLEU/ROUGE scoring
36
-
37
- ### `rerank`
38
- ```bash
39
- rag-pipeline rerank "What is RAG?" --retriever pinecone
40
- ```
41
- - Reorders retrieved context using an LLM reranker
42
-
43
- ---
44
-
45
- ## `.ragrc.json` Config
46
-
47
- Defaults can be set in a file:
48
- ```json
49
- {
50
- "loader": "directory",
51
- "embedder": "openai",
52
- "retriever": "pinecone",
53
- "llm": "openai-gpt-4",
54
- "useReranker": true
55
- }
56
- ```
57
-
58
- ---
59
-
60
- ## Docker Usage
61
-
62
- ```bash
63
- docker build -t rag-pipeline .
64
- docker run --rm -v $PWD:/data rag-pipeline query "What is retrieval?"
65
- ```
66
-
67
- ---
68
-
69
- Next → [Architecture](./Architecture.md)