feat(reparse): reuse chunks and processing artifacts - #2035
Closed
0Tty0 wants to merge 13 commits into
Closed
Conversation
0Tty0
force-pushed
the
feat/issue-1679-chunk-reuse
branch
from
July 15, 2026 08:32
82b9b16 to
c77078c
Compare
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.
Summary
Why
Knowledge reparse previously removed existing chunks and indexes before rebuilding them, repeating expensive provider work and creating a destructive failure window. The new reconciliation flow preserves reusable results when normalized inputs and effective provider identities still match, while correctly invalidating changed content, model configuration, prompts, and output contracts.
The shared artifact layer freezes only successful ownership-free outputs. Every cache hit is validated and rebound to the current run, so reuse does not leak tenant, document, chunk, or graph ownership. Retry ordering and atomic winner semantics keep concurrent workers convergent without publishing partial state.
Implementation
Incremental chunk and embedding reuse
Processing artifact foundation
VLM and DocReader reuse
Chat and Wiki reuse
GraphRAG extraction reuse
Lifecycle operations and retention
Scope
This PR implements:
Administrative cache inspection/purge APIs and external dashboards remain follow-up work for #1679.
Validation
go test -tags sqlite_fts5 -count=1 ./internal/types ./internal/application/repository ./internal/application/repository/retriever/postgres ./internal/application/repository/retriever/sqlite ./internal/application/repository/retriever/tencentvectordb ./internal/application/service/file ./internal/application/service/retriever ./internal/application/service ./internal/containerCGO_LDFLAGS=-lssp go test -count=1 ./internal/config ./internal/types ./internal/application/repository ./internal/application/service/file ./internal/application/servicego vet ./internal/config ./internal/types ./internal/application/repository ./internal/application/service/file ./internal/application/servicegofmtgit diff --checkRelated to #1679.