@devilsdev/rag-pipeline-utils 1.0.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 (65) hide show
  1. package/.dockerignore +14 -0
  2. package/.github/workflows/ci.yml +42 -0
  3. package/.github/workflows/release.yml +21 -0
  4. package/Dockerfile +22 -0
  5. package/LICENSE +674 -0
  6. package/README.md +116 -0
  7. package/__tests__/fixtures/sample-eval-dataset.json +15 -0
  8. package/__tests__/integration/cli/config-flow.test.js +44 -0
  9. package/__tests__/integration/config/load-config.test.js +52 -0
  10. package/__tests__/unit/core/plugin-registry.test.js +55 -0
  11. package/__tests__/unit/reranker/__snapshots__/reranker.snapshot.test.js.snap +15 -0
  12. package/__tests__/unit/reranker/llm-reranker.test.js +42 -0
  13. package/__tests__/unit/reranker/reranker.snapshot.test.js +17 -0
  14. package/bin/cli.js +168 -0
  15. package/docs-site/README.md +41 -0
  16. package/docs-site/blog/2019-05-28-first-blog-post.md +12 -0
  17. package/docs-site/blog/2019-05-29-long-blog-post.md +44 -0
  18. package/docs-site/blog/2021-08-01-mdx-blog-post.mdx +24 -0
  19. package/docs-site/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
  20. package/docs-site/blog/2021-08-26-welcome/index.md +29 -0
  21. package/docs-site/blog/authors.yml +23 -0
  22. package/docs-site/blog/tags.yml +19 -0
  23. package/docs-site/docs/Architecture.md +76 -0
  24. package/docs-site/docs/CLI.md +69 -0
  25. package/docs-site/docs/Evaluation.md +61 -0
  26. package/docs-site/docs/FAQ.md +50 -0
  27. package/docs-site/docs/Introduction.md +58 -0
  28. package/docs-site/docs/Plugins.md +61 -0
  29. package/docs-site/docs/Usage.md +72 -0
  30. package/docs-site/docusaurus.config.js +57 -0
  31. package/docs-site/package-lock.json +17914 -0
  32. package/docs-site/package.json +44 -0
  33. package/docs-site/sidebars.js +22 -0
  34. package/docs-site/src/components/HomepageFeatures/index.js +59 -0
  35. package/docs-site/src/components/HomepageFeatures/styles.module.css +58 -0
  36. package/docs-site/src/css/custom.css +81 -0
  37. package/docs-site/src/pages/index.js +37 -0
  38. package/docs-site/src/pages/index.module.css +23 -0
  39. package/docs-site/src/pages/markdown-page.md +7 -0
  40. package/docs-site/static/.nojekyll +0 -0
  41. package/docs-site/static/img/favicon.ico +0 -0
  42. package/docs-site/static/img/logo.png +0 -0
  43. package/docs-site/static/img/logo.svg +1539 -0
  44. package/docs-site/static/img/social-card.jpg +0 -0
  45. package/jest.config.js +14 -0
  46. package/package.json +65 -0
  47. package/public/index.html +0 -0
  48. package/public/results/sample-eval.json +0 -0
  49. package/public/src/App.jsx +57 -0
  50. package/release.config.js +23 -0
  51. package/server.js +31 -0
  52. package/src/config/load-config.js +35 -0
  53. package/src/config/validate-schema.js +49 -0
  54. package/src/core/create-pipeline.js +82 -0
  55. package/src/core/plugin-registry.js +61 -0
  56. package/src/dag/dag-engine.js +70 -0
  57. package/src/evaluate/evaluator.js +44 -0
  58. package/src/evaluate/scoring.js +74 -0
  59. package/src/loader/csv-loader.js +30 -0
  60. package/src/loader/directory-loader.js +38 -0
  61. package/src/loader/html-loader.js +57 -0
  62. package/src/loader/markdown-loader.js +58 -0
  63. package/src/reranker/llm-reranker.js +49 -0
  64. package/src/utils/logger.js +29 -0
  65. package/src/utils/retry.js +42 -0
package/.dockerignore ADDED
@@ -0,0 +1,14 @@
1
+ # Ignore test files, fixtures, and local config
2
+ __tests__/
3
+ coverage/
4
+ .env
5
+ .env.*
6
+ node_modules/
7
+ .dockerignore
8
+ .git
9
+ .gitignore
10
+ .vscode
11
+ *.log
12
+ *.md
13
+ /public/
14
+ /docs-site/
@@ -0,0 +1,42 @@
1
+ # .github/workflows/ci.yml
2
+ # Version: 0.1.0
3
+ # Description: GitHub Actions CI pipeline for lint, test, and coverage
4
+ # Author: Ali Kahwaji
5
+
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches: [main]
11
+ pull_request:
12
+ branches: [main]
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: 🧾 Checkout repository
20
+ uses: actions/checkout@v3
21
+
22
+ - name: 🟢 Setup Node.js
23
+ uses: actions/setup-node@v3
24
+ with:
25
+ node-version: 18
26
+
27
+ - name: 📦 Install dependencies
28
+ run: npm ci
29
+
30
+ - name: 🧹 Lint code
31
+ run: npm run lint
32
+
33
+ - name: 🧪 Run tests
34
+ run: npm test
35
+
36
+ - name: 📈 Upload coverage to Codecov
37
+ uses: codecov/codecov-action@v3
38
+ with:
39
+ token: ${{ secrets.CODECOV_TOKEN }}
40
+ files: ./coverage/lcov.info
41
+ flags: unit
42
+ name: codecov-report
@@ -0,0 +1,21 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ release:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: actions/setup-node@v3
13
+ with:
14
+ node-version: 18
15
+ registry-url: 'https://registry.npmjs.org'
16
+
17
+ - run: npm ci
18
+ - run: npx semantic-release
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/Dockerfile ADDED
@@ -0,0 +1,22 @@
1
+ # Version: 0.1.0
2
+ # Path: /Dockerfile
3
+ # Description: Minimal Docker image for rag-pipeline CLI
4
+ # Author: Ali Kahwaji
5
+
6
+ FROM node:18-slim
7
+
8
+ # Create app directory
9
+ WORKDIR /app
10
+
11
+ # Copy package files and install deps
12
+ COPY package*.json ./
13
+ RUN npm ci --omit=dev
14
+
15
+ # Copy application source
16
+ COPY . .
17
+
18
+ # Set default entrypoint
19
+ ENTRYPOINT ["node", "./bin/cli.js"]
20
+
21
+ # Default help
22
+ CMD ["--help"]