@jcode.labs/ragmir 2.6.0 → 2.7.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 (58) hide show
  1. package/README.md +4 -2
  2. package/dist/chunking.d.ts.map +1 -1
  3. package/dist/chunking.js +48 -4
  4. package/dist/chunking.js.map +1 -1
  5. package/dist/cli-options.d.ts +2 -0
  6. package/dist/cli-options.d.ts.map +1 -1
  7. package/dist/cli-options.js +8 -0
  8. package/dist/cli-options.js.map +1 -1
  9. package/dist/cli.js +27 -10
  10. package/dist/cli.js.map +1 -1
  11. package/dist/defaults.d.ts +1 -0
  12. package/dist/defaults.d.ts.map +1 -1
  13. package/dist/defaults.js +1 -0
  14. package/dist/defaults.js.map +1 -1
  15. package/dist/evaluate.d.ts.map +1 -1
  16. package/dist/evaluate.js +43 -2
  17. package/dist/evaluate.js.map +1 -1
  18. package/dist/index-diagnostics.d.ts +1 -1
  19. package/dist/index-diagnostics.d.ts.map +1 -1
  20. package/dist/index-diagnostics.js +7 -2
  21. package/dist/index-diagnostics.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js.map +1 -1
  25. package/dist/ingest.d.ts.map +1 -1
  26. package/dist/ingest.js +8 -0
  27. package/dist/ingest.js.map +1 -1
  28. package/dist/mcp.d.ts +2 -1
  29. package/dist/mcp.d.ts.map +1 -1
  30. package/dist/mcp.js +17 -8
  31. package/dist/mcp.js.map +1 -1
  32. package/dist/query-sanitizer.d.ts +8 -0
  33. package/dist/query-sanitizer.d.ts.map +1 -0
  34. package/dist/query-sanitizer.js +170 -0
  35. package/dist/query-sanitizer.js.map +1 -0
  36. package/dist/query.d.ts.map +1 -1
  37. package/dist/query.js +105 -8
  38. package/dist/query.js.map +1 -1
  39. package/dist/research.d.ts.map +1 -1
  40. package/dist/research.js +9 -0
  41. package/dist/research.js.map +1 -1
  42. package/dist/store.d.ts +1 -0
  43. package/dist/store.d.ts.map +1 -1
  44. package/dist/store.js +38 -6
  45. package/dist/store.js.map +1 -1
  46. package/dist/types.d.ts +37 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/dist/version.d.ts +1 -1
  49. package/dist/version.js +1 -1
  50. package/examples/document-evidence-benchmark/.ragmir/config.json +21 -0
  51. package/examples/document-evidence-benchmark/README.md +33 -0
  52. package/examples/document-evidence-benchmark/golden-queries.json +35 -0
  53. package/examples/document-evidence-benchmark/raw/contracts/master-services-agreement.md +11 -0
  54. package/examples/document-evidence-benchmark/raw/legal-tax/residency-review-note.md +10 -0
  55. package/examples/document-evidence-benchmark/raw/rfp/security-questionnaire.md +12 -0
  56. package/examples/document-evidence-benchmark/raw/runbooks/incident-response-runbook.md +11 -0
  57. package/examples/document-evidence-benchmark/raw/specs/agent-integration-spec.md +11 -0
  58. package/package.json +3 -3
@@ -0,0 +1,33 @@
1
+ # Document Evidence Benchmark
2
+
3
+ Synthetic document benchmark for Ragmir retrieval. It is intentionally safe to commit: the contract,
4
+ RFP, runbook, spec, and legal/tax notes are fictional and contain no customer data.
5
+
6
+ This benchmark checks two things:
7
+
8
+ - `recall@k`: each query retrieves the expected source file.
9
+ - exact citations: each query retrieves the expected `relative/path:Lx-Ly#chunkIndex` citation.
10
+
11
+ The corpus is small on purpose so every source file fits in a single chunk. That keeps the expected
12
+ citations deterministic while exercising the same CLI path used for private dogfooding.
13
+
14
+ ## Run From This Repository Checkout
15
+
16
+ Build Ragmir once from the repository root:
17
+
18
+ ```bash
19
+ pnpm build
20
+ ```
21
+
22
+ Then run the benchmark from this folder:
23
+
24
+ ```bash
25
+ cd packages/ragmir-core/examples/document-evidence-benchmark
26
+ node ../../dist/cli.js ingest
27
+ node ../../dist/cli.js evaluate --golden golden-queries.json --json
28
+ node ../../dist/cli.js evaluate --golden golden-queries.json --fail-under 1
29
+ ```
30
+
31
+ Use this example as a public-safe template for private document evaluations. Keep real contracts,
32
+ RFPs, runbooks, tax notes, golden queries, and generated JSON reports outside Git or under ignored
33
+ local Ragmir state.
@@ -0,0 +1,35 @@
1
+ {
2
+ "topK": 3,
3
+ "queries": [
4
+ {
5
+ "id": "contract-data-export-residency",
6
+ "query": "MSA client data export residency renewal notice DOCBENCH-MSA-001",
7
+ "expectedPaths": ["raw/contracts/master-services-agreement.md"],
8
+ "expectedCitations": ["raw/contracts/master-services-agreement.md:L1-L11#0"]
9
+ },
10
+ {
11
+ "id": "rfp-no-hosted-account",
12
+ "query": "security questionnaire no hosted account no telemetry read focused MCP",
13
+ "expectedPaths": ["raw/rfp/security-questionnaire.md"],
14
+ "expectedCitations": ["raw/rfp/security-questionnaire.md:L1-L12#0"]
15
+ },
16
+ {
17
+ "id": "runbook-evidence-pack",
18
+ "query": "What runbook evidence must be collected after a payment incident?",
19
+ "expectedPaths": ["raw/runbooks/incident-response-runbook.md"],
20
+ "expectedCitations": ["raw/runbooks/incident-response-runbook.md:L1-L11#0"]
21
+ },
22
+ {
23
+ "id": "spec-complements-agent-memory",
24
+ "query": "agent integration spec complements agent memory conversation state",
25
+ "expectedPaths": ["raw/specs/agent-integration-spec.md"],
26
+ "expectedCitations": ["raw/specs/agent-integration-spec.md:L1-L11#0"]
27
+ },
28
+ {
29
+ "id": "legal-tax-professional-review",
30
+ "query": "legal tax residency review professional review filing positions",
31
+ "expectedPaths": ["raw/legal-tax/residency-review-note.md"],
32
+ "expectedCitations": ["raw/legal-tax/residency-review-note.md:L1-L10#0"]
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1,11 @@
1
+ # Synthetic Master Services Agreement
2
+
3
+ Agreement ID: DOCBENCH-MSA-001. This fictional contract is for retrieval testing only.
4
+
5
+ The supplier may process implementation notes, support tickets, and project specifications only from
6
+ the customer-designated workstation. Client data exports must remain in the agreed local evidence
7
+ folder and may not be copied to a hosted account without written approval from the customer owner.
8
+
9
+ Renewal notice window: either party may stop automatic renewal by sending written notice at least
10
+ 60 days before the renewal date. The contract owner must attach the local export residency evidence
11
+ to the renewal review.
@@ -0,0 +1,10 @@
1
+ # Synthetic Legal And Tax Review Note
2
+
3
+ Matter: fictional cross-border founder residency review for benchmark testing.
4
+
5
+ The note compares board minutes, travel calendars, service contracts, and tax residency assumptions.
6
+ It is not legal advice. Professional review is required before relying on residency analysis,
7
+ changing filing positions, or sending a client-facing recommendation.
8
+
9
+ The cited evidence package must separate facts, assumptions, and uncertainty. Missing documents
10
+ should be listed explicitly instead of filled with model guesses.
@@ -0,0 +1,12 @@
1
+ # Synthetic RFP Security Questionnaire
2
+
3
+ Question: Does the proposed retrieval layer require a hosted account, product telemetry, or broad
4
+ write access to the repository?
5
+
6
+ Answer: No hosted account is required. The default mode runs locally with no telemetry. MCP access is
7
+ read-focused: the agent can ask for status, prompt-routing advice, search results, cited answers,
8
+ audits, evaluation results, usage summaries, and security posture, but it does not receive a
9
+ destructive repository tool from Ragmir.
10
+
11
+ Follow-up: customer-specific evidence stays on disk and is reviewed by a human before an RFP response
12
+ is sent.
@@ -0,0 +1,11 @@
1
+ # Synthetic Payment Incident Runbook
2
+
3
+ Trigger: payment queue latency above the internal threshold for ten minutes.
4
+
5
+ The on-call engineer opens the local incident template and collects a payment incident evidence pack:
6
+ timeline, customer impact summary, rollback decision, command transcript, and links to cited runbook
7
+ sections. The evidence pack remains under the local Ragmir reports folder until the incident lead
8
+ approves external sharing.
9
+
10
+ Do not paste raw customer records into an agent prompt. Use cited retrieval snippets and summarize
11
+ uncertainty separately from confirmed evidence.
@@ -0,0 +1,11 @@
1
+ # Synthetic Agent Integration Spec
2
+
3
+ Goal: let external coding agents use local project evidence without turning Ragmir into another chat
4
+ memory system.
5
+
6
+ Ragmir complements agent memory. It does not replace the agent conversation state, task plan, or
7
+ native code index. The agent keeps its normal reasoning loop, then calls Ragmir when it needs cited
8
+ evidence from local documents such as contracts, RFPs, runbooks, or specs.
9
+
10
+ The MCP surface stays read-focused and bounded by topK. This is a security advantage: agents receive
11
+ verifiable passages and audit data without gaining a broad document mutation channel.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcode.labs/ragmir",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Ragmir Core: open-source sovereign local RAG for confidential datasets and AI agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -69,8 +69,8 @@
69
69
  "unpdf": "^1.4.0",
70
70
  "yaml": "^2.9.0",
71
71
  "zod": "^4.1.13",
72
- "@jcode.labs/ragmir-chat": "2.6.0",
73
- "@jcode.labs/ragmir-tts": "2.6.0"
72
+ "@jcode.labs/ragmir-chat": "2.7.0",
73
+ "@jcode.labs/ragmir-tts": "2.7.0"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/html-to-text": "^9.0.4",