Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the indexing pipeline to separate initial document indexing from asynchronous chunk embedding and QA generation, and provides dedicated async indexing interfaces.
- Extracted
EsHit2Documentfor cleaner retriever result parsing and unified metadata keys. - Disabled inline QA in the synchronous indexer graph and added a new async indexer graph.
- Introduced
IndexAsyncandindexAsyncByDocsIDmethods inRag, plus corresponding tests.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/core/retriever/retriever.go | Extracted result parser into EsHit2Document and wired embedding |
| server/core/rag_test.go | Added tests for async indexing and sleep to wait for QA tasks |
| server/core/rag.go | Added idxerAsync, IndexAsync, and indexAsyncByDocsID logic |
| server/core/indexer/qa.go | Skip QA generation if qa_content already present |
| server/core/indexer/orchestration.go | Removed synchronous QA node from indexer graph |
| server/core/indexer/loader.go | Changed UseNameAsID from true to false for file loader |
| server/core/indexer/indexer_async.go | New async indexer component |
| server/core/indexer/indexer.go | Inline ID generation, ext-data extraction, disabled QA embedding |
| server/core/indexer/async.go | Added BuildIndexerAsync graph |
| server/core/common/consts.go | Removed duplicate DocExtra; consolidated metadata constants |
Comments suppressed due to low confidence (4)
server/core/retriever/retriever.go:32
- [nitpick] The variable name
embeddingIns11is unclear. Consider renaming toembeddingorembedderfor readability.
embeddingIns11, err := common.NewEmbedding(ctx, conf)
server/core/indexer/orchestration.go:16
- Multiple QA-related lines are commented out. Remove dead code or extract QA toggling into a configuration flag to improve clarity.
// QA = "QA"
server/core/rag_test.go:69
- This test logs the returned IDs but does not assert their correctness. Add assertions (e.g.,
len(ids) > 0) to catch regressions.
func TestIndexAsyncByDocsID(t *testing.T) {
server/core/indexer/indexer.go:91
- The boolean in the map lookup is assigned to
e, which can be confused with an error value. Rename it tookfor clarity.
for _, key := range common.ExtKeys {
ae0c81c to
a58d46b
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.
初始index不生成qa & 提供单独接口进行docs的indexer