-
Notifications
You must be signed in to change notification settings - Fork 9
DOC-829 | GraphRAG: Add multi-file import, semantic units, restructure content #856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Deploy Preview Available Via |
|
Thanks for your work @nerpaula , I have added one comment, please resolve it, Otherwise LGTM. Full example JSON payload for ImportMultipleFilesRequest (/v1/import-multiple): |
diegomendez40
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work @nerpaula . I have added some comments. Please feel free to reach out for any clarification.
| ## Multi-File Import | ||
|
|
||
| Use multi-file import when you need to process multiple documents into a single | ||
| Knowledge Graph. This API provides streaming progress updates, making it | ||
| ideal for batch processing and long-running imports where you need to track progress. | ||
|
|
||
| ``` | ||
| POST /v1/import-multiple | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no mention of a reference architecture nor the AutoGraph. Our recommended way to ingest a huge corpus is by using the AutoGraph to create different clusters (mini-topics), then ingesting each of them with the multi-file importer into its own graphrag partition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expected right now. Will be enhanced with reference architecture and documentation for AutoGraph, I will treat that in a separate task/PR.
| - `vector_index_metric`: Distance metric for vector similarity search. The supported values are `"cosine"` (default), `"l2"`, and `"innerProduct"`. | ||
| - `vector_index_n_lists`: Number of lists for approximate search (optional). If not set, it is automatically computed as `8 * sqrt(collection_size)`. This parameter is ignored when using HNSW. | ||
| - `vector_index_use_hnsw`: Whether to use HNSW (Hierarchical Navigable Small World) index instead of the default inverted index (default: `false`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure these params will reach February release. I will check and come back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomendez40 what's the status of these parameters?
| - `smart_graph_attribute`: SmartGraph attribute for graph sharding. | ||
| - `shard_count`: Number of shards for the collections. | ||
| - `is_disjoint`: Whether the graphs must be disjoint. | ||
| - `satellite_collections`: An array of collection names to create as Satellite Collections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure these params will reach February release. I will check and come back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomendez40 what's the status of these parameters?
| ## Performance Considerations | ||
|
|
||
| ### Size Guidelines | ||
|
|
||
| - **Small Documents** (< 1MB): All features enabled with minimal impact. | ||
| - **Medium Documents** (1-10MB): Consider disabling `store_image_data` for large images. | ||
| - **Large Documents** (> 10MB): Use `enable_semantic_units=true, process_images=false, store_image_data=false` for basic URL extraction. | ||
|
|
||
| ### LLM Compatibility | ||
|
|
||
| The semantic units processing works with all LLM providers: | ||
| - **OpenAI**: GPT-4o, GPT-4o-mini (all models supported). | ||
| - **OpenRouter**: Gemini Flash, Claude Sonnet (all models supported). | ||
| - **Triton**: Mistral-Nemo-Instruct (all models supported). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this come from? I don't think most of this information is correct. Semantic Units require multimodal LLMs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegomendez40 can you please provide the correct information?
| ### Semantic Units Collection | ||
|
|
||
| - **Purpose**: Stores semantic units extracted from documents, including image | ||
| references and web URLs. This collection is only created when `enable_semantic_units` | ||
| is set to `true`. | ||
| - **Key Fields**: | ||
| - `_key`: Unique identifier for the semantic unit. | ||
| - `type`: Type of semantic unit (always "image" for image references). | ||
| - `image_url`: URL or reference to the image/web resource. | ||
| - `is_storage_url`: Boolean indicating if the URL is a storage URL (base64/S3) or web URL. | ||
| - `import_number`: Import batch number for tracking. | ||
| - `source_chunk_id`: Reference to the chunk where this semantic unit was found. | ||
|
|
||
| {{< info >}} | ||
| Learn more about semantic units in the [Semantic Units guide](semantic-units.md). | ||
| {{< /info >}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is intended for immediate release, it makes sense. If we would want to use it for February release, then we should also add that Semantic Units can also store other sources, such as DB entities via the VirtualGraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is intended for immediate release. VirtualGraph will be treated in a separate task/PR.
Co-authored-by: Diego M-R <[email protected]>
bluepal-pavan-parakala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work @nerpaula . I have added some comments. Please consider them.
| "vector_index_metric": "cosine", | ||
| "vector_index_use_hnsw": true, | ||
| "batch_size": 500 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some defaults are mentioned inconsistently:
- batch_size: Default 1000 (mentioned in some places, not others)
- chunk_token_size: Default 1200 (mentioned)
- chunk_overlap_token_size: Default 100 (mentioned)
- entity_types: Default ["person", "organization", "geo", "event"] (mentioned)
- community_report_num_findings: Default "5-10" (mentioned)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bluepal-pavan-parakala @diegomendez40 How can I see the default values of all parameters? How can I know if a parameter is required or optional? I don't see this information in the proto files. And I don't know how to find this information in the source code. Thus, it makes it a bit hard to ensure accuracy in the docs based on the implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nerpaula, @hkernbach has created https://effective-barnacle-wr1zqer.pages.github.io/ where we can find proto definition description for all the services.
| 3. Verify that the following collections exist: | ||
| - `knowledge_graph_vertices`: Contains the nodes of the knowledge graph i.e. documents, chunks, communities, and entities. | ||
| - `knowledge_graph_edges`: Contains the relationships between nodes i.e. relations. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider adding a section explaining:
- Which collections are vertices vs edges
- How the graph structure works
- Key generation and uniqueness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bluepal-pavan-parakala I have added which collections are vertex/edge. About graph structure and key generation, please elaborate what do you think it is necessary to add. As far as I know, the generated KG is a general graph type and the concept and data structure is described in the ArangoDB manual. As for keys, I see the collections have traditional key generators (again, this is described in the general data structure concepts of ArangoDB). Is there anything else in particular?
Description
Note
Major GraphRAG docs update focused on Importer capabilities and structure.
reference/importer.mdwith a newreference/importer/section (_index.md,importing-files.md,llm-configuration.md,parameters.md,semantic-units.md,verify-and-explore.md).POST /v1/import-multiplewith SSE streaming progress; semantic units (image/URL extraction) with configurable options; expanded parameter reference and verification guidance.../reference/importer.mdto../reference/importer/(and anchors), including ingraphrag/_index.md,technical-overview.md,web-interface.md,ai-orchestrator.md,retriever.md, andtriton-inference-server.md.{project_name}_kg,{project_name}_Documents, etc.) and remove single-file-only wording.Written by Cursor Bugbot for commit d3f79fd. This will update automatically on new commits. Configure here.