Skip to content

Commit ec01027

Browse files
authored
Merge pull request #163 from jcode-works/feature/agentic-rag-performance-ci
feat(core): diversify and accelerate agentic retrieval
2 parents e2b7f85 + 7ee4a7f commit ec01027

50 files changed

Lines changed: 1586 additions & 383 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
Ragmir turns specifications, Word files, PDFs, spreadsheets, code, and local exports into cited
1212
evidence indexed and retrieved on your machine. Core works offline by default, never uploads your
13-
corpus, and calls no model. Connect the agent or automation you already use through CLI, MCP, or a
14-
typed TypeScript API, or keep the complete workflow local with the optional Chat package.
13+
corpus, and calls no model. Ragmir is the local retrieval and evidence layer for agentic RAG
14+
workflows: the host agent plans and acts, while Ragmir supplies bounded, cited project evidence.
15+
Connect the agent or automation you already use through CLI, MCP, or a typed TypeScript API, or keep
16+
the complete workflow local with the optional Chat package.
1517

1618
[Website](https://ragmir.com) · [npm](https://www.npmjs.com/package/@jcode.labs/ragmir) ·
1719
[Documentation](https://github.com/jcode-works/jcode-ragmir/wiki) ·
@@ -45,7 +47,7 @@ Outcome: Core installed with the repository's package manager; useful sources se
4547
4648
3. Implement after approval:
4749
- Install @jcode.labs/ragmir as a dev dependency with the detected manager. Install Chat/TTS only if selected, at a compatible version.
48-
- Run the matching rgr setup --no-ingest --agents <selected> command. Keep project scope. If a same-name skill is unmanaged, show the diff and ask before --force.
50+
- Run rgr setup --no-ingest --agents <selected> via the detected manager. Keep project scope. Show unmanaged skill diffs and ask before --force-agent-skills.
4951
- Build a narrow .ragmir/config.json. Prefer stable relative globs for root guidance, docs/specs/ADRs, package READMEs/manifests, useful app config, and source/tests that explain behavior. Include locales only when useful.
5052
- Exclude .env*, credentials, keys, unapproved dumps/customer data, dependencies, generated/build/cache/coverage/log folders, vendored code, binaries/media, and .ragmir storage/models. In monorepos, keep nested bases scoped and shared knowledge at root.
5153
- Run preview and audit --unsupported before ingest. Review redactions, unsupported/oversized files, duplicates, chunks, and sensitive paths. Fix config first, then ingest.

context7.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://context7.com/schema/context7.json",
33
"projectTitle": "Ragmir",
4-
"description": "Confidential local RAG for coding agents and scripts, with offline cited retrieval. The TypeScript CLI, library, read-focused MCP server, and portable skills keep the corpus and index under ignored local state. Optional local Chat and TTS remain separate packages.",
4+
"description": "Confidential local retrieval and evidence for agentic RAG workflows, with offline cited retrieval. The TypeScript CLI, library, read-focused MCP server, and portable skills keep the corpus and index under ignored local state. Optional local Chat and TTS remain separate packages.",
55
"excludeFolders": [
66
"node_modules",
77
"packages/ragmir-core/dist",
@@ -21,7 +21,7 @@
2121
"rules": [
2222
"Ragmir v3.0.0 and later are licensed under AGPL-3.0-only, with a separate commercial licensing option from JCode Works for proprietary use. Earlier releases keep their published license.",
2323
"Use the canonical English setup prompt in docs/quick-start.md for a repository-aware installation; it detects the package manager and existing state, asks before changes or downloads, and verifies retrieval.",
24-
"Ragmir Core returns cited retrieval context only; it does not synthesize answers itself.",
24+
"Ragmir Core is the local retrieval and evidence layer for agentic RAG workflows. It is not an autonomous agent, planner, or action runtime; planning, tool use, and action authority stay in the host.",
2525
"Any compatible coding agent, script, CLI, TypeScript application, or MCP client can consume Core results; use a local consumer when no passage may leave the machine.",
2626
"Use `rgr portable export` to create a frozen relocatable folder containing the active index, any required local embedding model, a restricted launcher, portable skills, MCP adapters, and a SHA-256 inventory. Raw source files and access logs are excluded, but indexed passages remain sensitive. Verify the folder after moving it and keep action authority in the host agent or automation.",
2727
"Use one `createRagmirClient()` per project root for repeated work in a stateful Node.js process; it caches one immutable read snapshot until atomic generation replacement and flushes metadata-only access logs during close. Use top-level functions for one-shot scripts.",

docs/agent-integration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Agent integration
22

3-
Ragmir indexes the selected project files locally and gives the AI or automation you choose cited
4-
passages through CLI or one stdio MCP server. The default `local-hash` path keeps ingestion and
5-
retrieval offline. Core is model-agnostic, never uploads the corpus, and never calls a model itself.
3+
Ragmir is the local retrieval and evidence layer for agentic RAG workflows. It indexes the selected
4+
project files locally and gives the AI or automation you choose cited passages through CLI or one
5+
stdio MCP server. It is not an autonomous agent, planner, or action runtime: planning, tool use, and
6+
action authority stay in the host. The default `local-hash` path keeps ingestion and retrieval
7+
offline. Core is model-agnostic, never uploads the corpus, and never calls a model itself.
68

79
For an interactive repository-aware installation, paste the canonical prompt from the
810
[quick-start guide](./quick-start.md) into the coding agent. It detects the package manager and

docs/api-reference.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,11 @@ clamped to three chunks.
281281
`ResearchReport.budgets` records configured and consumed budgets; `audit.mode` distinguishes
282282
`manifest` from `full`. Evidence exposes a weighted cross-query RRF `researchScore` and `bestRank`.
283283
The original query has a protected weight so language-aware expansions can add evidence without
284-
removing direct-search results from the same candidate depth.
284+
removing direct-search results from the same candidate depth. After fusion, research reapplies
285+
`maxChunksPerDocument` with ranked backfill; the report records the cap and whether backfill was
286+
needed.
285287

286-
Golden evaluation files are limited to 1 MiB and 100 cases. Each query is limited to 20,000
288+
Golden evaluation files are limited to 16 MiB and 1,000 cases. Each query is limited to 20,000
287289
characters, with at most 100 expected paths or citations of 500 characters each.
288290
`AccessLogUsageOptions.days` accepts an integer from 1 to 3650.
289291

docs/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Outcome: Core installed with the repository's package manager; useful sources se
2626
2727
3. Implement after approval:
2828
- Install @jcode.labs/ragmir as a dev dependency with the detected manager. Install Chat/TTS only if selected, at a compatible version.
29-
- Run the matching rgr setup --no-ingest --agents <selected> command. Keep project scope. If a same-name skill is unmanaged, show the diff and ask before --force.
29+
- Run rgr setup --no-ingest --agents <selected> via the detected manager. Keep project scope. Show unmanaged skill diffs and ask before --force-agent-skills.
3030
- Build a narrow .ragmir/config.json. Prefer stable relative globs for root guidance, docs/specs/ADRs, package READMEs/manifests, useful app config, and source/tests that explain behavior. Include locales only when useful.
3131
- Exclude .env*, credentials, keys, unapproved dumps/customer data, dependencies, generated/build/cache/coverage/log folders, vendored code, binaries/media, and .ragmir storage/models. In monorepos, keep nested bases scoped and shared knowledge at root.
3232
- Run preview and audit --unsupported before ingest. Review redactions, unsupported/oversized files, duplicates, chunks, and sensitive paths. Fix config first, then ingest.

llms.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ the corpus, and calls no model.
3030
`compact: false` only for an explicit full payload. CLI compact output remains opt-in.
3131
- Core behavior: cited retrieval only. `ask` returns evidence, while synthesis belongs to the calling
3232
agent or optional local chat add-on.
33+
- Agentic RAG boundary: Ragmir supplies bounded, cited evidence to a host agent or automation;
34+
planning, tool use, and action authority remain in that host.
3335
- Consumer choice: use the AI or automation you already have through CLI, TypeScript, or MCP. Use a
3436
local consumer or optional Chat when no retrieved passage may leave the machine.
3537
- Portable knowledge: `rgr portable export` creates a frozen relocatable folder with the active

packages/ragmir-chat/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Outcome: Core installed with the repository's package manager; useful sources se
4040
4141
3. Implement after approval:
4242
- Install @jcode.labs/ragmir as a dev dependency with the detected manager. Install Chat/TTS only if selected, at a compatible version.
43-
- Run the matching rgr setup --no-ingest --agents <selected> command. Keep project scope. If a same-name skill is unmanaged, show the diff and ask before --force.
43+
- Run rgr setup --no-ingest --agents <selected> via the detected manager. Keep project scope. Show unmanaged skill diffs and ask before --force-agent-skills.
4444
- Build a narrow .ragmir/config.json. Prefer stable relative globs for root guidance, docs/specs/ADRs, package READMEs/manifests, useful app config, and source/tests that explain behavior. Include locales only when useful.
4545
- Exclude .env*, credentials, keys, unapproved dumps/customer data, dependencies, generated/build/cache/coverage/log folders, vendored code, binaries/media, and .ragmir storage/models. In monorepos, keep nested bases scoped and shared knowledge at root.
4646
- Run preview and audit --unsupported before ingest. Review redactions, unsupported/oversized files, duplicates, chunks, and sensitive paths. Fix config first, then ingest.

packages/ragmir-chat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"node-llama-cpp": "3.20.0"
6868
},
6969
"devDependencies": {
70-
"@types/node": "^24.10.1",
70+
"@types/node": "^22.20.1",
7171
"publint": "^0.3.23",
72-
"typescript": "^5.9.3",
72+
"typescript": "^6.0.2",
7373
"vitest": "^4.1.10"
7474
}
7575
}

packages/ragmir-core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Outcome: Core installed with the repository's package manager; useful sources se
4141
4242
3. Implement after approval:
4343
- Install @jcode.labs/ragmir as a dev dependency with the detected manager. Install Chat/TTS only if selected, at a compatible version.
44-
- Run the matching rgr setup --no-ingest --agents <selected> command. Keep project scope. If a same-name skill is unmanaged, show the diff and ask before --force.
44+
- Run rgr setup --no-ingest --agents <selected> via the detected manager. Keep project scope. Show unmanaged skill diffs and ask before --force-agent-skills.
4545
- Build a narrow .ragmir/config.json. Prefer stable relative globs for root guidance, docs/specs/ADRs, package READMEs/manifests, useful app config, and source/tests that explain behavior. Include locales only when useful.
4646
- Exclude .env*, credentials, keys, unapproved dumps/customer data, dependencies, generated/build/cache/coverage/log folders, vendored code, binaries/media, and .ragmir storage/models. In monorepos, keep nested bases scoped and shared knowledge at root.
4747
- Run preview and audit --unsupported before ingest. Review redactions, unsupported/oversized files, duplicates, chunks, and sensitive paths. Fix config first, then ingest.

packages/ragmir-core/benchmarks/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ and explicit reranker, compression, hashing, and content-dedup experiments.
2222

2323
## Claim rules
2424

25-
- `bench:quality` requires clean indexes with matching corpus and quality fingerprints. It separates
26-
p50/p95 latency from deterministic quality and evaluates vector-only, lexical-only, current
27-
hybrid, and experimental lexical weights.
25+
- `bench:quality` requires clean indexes with matching corpus and outcome fingerprints. It separates
26+
p50/p95 latency from deterministic quality and evaluates vector-only, lexical-only, an
27+
undiversified hybrid baseline, the default one-chunk document cap, a two-chunk cap, MMR, and
28+
experimental lexical weights. Ranking variants report the mean number of distinct documents in
29+
the first ten results.
30+
- `bench:compare` recognizes scale and quality reports separately. It validates both quality runs,
31+
their absolute gates, and explicit workload versions. Missing identities or metrics are invalid,
32+
incompatible workloads are inconclusive, and only complete comparable reports can pass.
2833
- `bench:vector-index` uses deterministic 384-dimensional tables, 10 warm-ups, 100 samples, and five
2934
measured repetitions. A candidate fails if it loses at least 0.01 Recall@10, has incomplete
3035
coverage, misses the M/L latency gate, or does not improve p95. `--quick` is calibration only.

0 commit comments

Comments
 (0)