Multi-Document Corpus Indexing - #417
Open
krishna231122-del wants to merge 3 commits into
Open
Conversation
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.
📝 Overview
This PR introduces Multi-Document Corpus Indexing, allowing users to merge multiple individual document trees into a single, unified knowledge base.
By running multiple structures through the new Corpus Builder, Agentic RAG systems can now navigate and reason across an entire repository of documents simultaneously from a single root node, rather than being limited to a single document's context.
🛠️ Changes Made
Corpus Builder (
pageindex/corpus_builder.py):*structure.jsonfiles as child nodes under a unified"Corpus"root node.node_ids sequentially across the entire merged tree to prevent cross-document ID collisions and ensure reliable traversal.CLI Enhancements (
run_pageindex.py):--corpus_filesargument to specify a list of pre-compiled JSON structure files to merge.--corpus_nameargument to allow customizing the title of the root node (defaults to"Corpus").[corpus_name]_structure.json.Dummy Files & Gitignore:
examples/documents/test_doc2.txtfor integration testing.🧪 Testing
Successfully compiled two independent Markdown structures:
test_doc_convertedtest_doc2_convertedMerged them using:
python3 run_pageindex.py \ --corpus_files \ results/test_doc_converted_structure.json \ results/test_doc2_converted_structure.json \ --corpus_name "Test Knowledge Base"