Repository navigation
RAG core library (M1): chunking, ingestion and cited context retrieval - #17
Open
roshni-shah-promact wants to merge 17 commits into
Open
roshni-shah-promact wants to merge 17 commits into
roshni-shah-promact wants to merge 17 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tible mdast stack) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…verage gate Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… validation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…enderer (NRAG-08) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjihb1EBKPQCRVnkGtu
…l stats (NRAG-09) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjihb1EBKPQCRVnkGtu
…), follow-up to NRAG-09 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjihb1EBKPQCRVnkGtu
…ble ids (NRAG-10) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjihb1EBKPQCRVnkGtu
…AG-11) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjihb1EBKPQCRVnkGtu
…ss-tenant overwrite Chunk ids hash documentId, which is only unique per tenant. Two tenants ingesting the same documentId with identical content produced the same chunk ids, and the second upsert silently replaced the first tenant's records (tenant A lost its index; a deleteDocument by A then removed nothing). Records are now keyed by (tenantId, chunkId) and the VectorStore contract documents that adapters must do the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjmJ9SAbwyR7KkkFZzs
…budgets When the code fence markers alone exceeded the budget (e.g. a `typescript` fence with maxTokens 4), code was split down to single characters but each piece was still wrapped in a fence, yielding chunks above maxTokens. Such code is now emitted unfenced, and make() refuses (throws) instead of silently emitting an over-budget chunk when no valid chunking exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjmJ9SAbwyR7KkkFZzs
Re-ingesting identical content under a higher version returned 'unchanged' without touching the stored records, so they kept the old version number. A later ingest of an in-between older version (e.g. v1 stored, v3 identical, then v2) passed the staleness check and replaced the newest content, breaking last-writer-wins (§8.4). Such bumps now re-upsert the records with the new version (all vectors reused, nothing re-embedded) and still report 'unchanged'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjmJ9SAbwyR7KkkFZzs
…ver (NRAG-12) - createRetriever: mandatory tenant/ACL filter validated and passed into the store query, hybrid degrades to vector with a one-time warning, minScore (re-checked after the adapter), MMR (default on, lambda 0.7, candidates capped at 50). - packContext: fills highest score first up to maxTokens - margin (default 4000, counter margin 5%/15%), measured on the final rendered text so it can never go over budget; merges adjacent chunks of a section, expands to the parent only if it fits, strongest blocks at the edges, [n] labels with a citations array. - VectorStore.getByIds (filtered like search) for parent expansion; createRag.getContext wired. - Cross-tenant leakage, ACL trimming and over-budget property tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjmJ9SAbwyR7KkkFZzs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JotNjmJ9SAbwyR7KkkFZzs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Milestone M1 of the Node.js RAG spec (
docs/specs/rag-service-spec.md, NRAG-06 → NRAG-12): the@promact/rag-corelibrary. The package is"private": true, so nothing gets published.VectorStore+ incremental ingestion (doc-hash skip, chunk reuse, last-writer-wins)[n]citationsReview notes
Built by unattended cloud runs, then reviewed by Opus, which fixed 3 defects, each with a regression test:
Please decide the open questions listed in
docs/specs/rag-progress.md→ "Blocked / questions". Most important:(tenantId, chunkId)aclGroups: []hides a document from everyonefindByContentHashis not tenant-scopedChecks
npm run build && npm run lint && npx jestall pass. rag-core has 100% line coverage.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.