Refactor: enhance graphrag - part 2 (#14972)

### What problem does this PR solve?
1. expose batch_chunk_token_size for configuration
2. retrieve chunks when build subgraph for the doc, not retreive all
docs chunks at the begining
3. get all chunks for a document, used to be hard coded 10000
4. delete not used method run_graphrag

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring

Follow on: #14617
This commit is contained in:
Wang Qi
2026-05-18 16:10:21 +08:00
committed by GitHub
parent b12eaee38b
commit 13b422037f
15 changed files with 82 additions and 118 deletions

View File

@@ -1,3 +1,4 @@
import { FormLayout } from '@/constants/form';
import { DocumentParserType } from '@/constants/knowledge';
import { useTranslate } from '@/hooks/common-hooks';
import { cn } from '@/lib/utils';
@@ -12,6 +13,7 @@ import { useCallback, useMemo } from 'react';
import { useFormContext, useWatch } from 'react-hook-form';
import { EntityTypesFormField } from '../entity-types-form-field';
import { FormContainer } from '../form-container';
import { SliderInputFormField } from '../slider-input-form-field';
import {
FormControl,
FormField,
@@ -191,6 +193,19 @@ const GraphRagItems = ({
)}
/>
<SliderInputFormField
name="parser_config.graphrag.batch_chunk_token_size"
label={t('graphRagBatchChunkTokenSize')}
tooltip={t('graphRagBatchChunkTokenSizeTip')}
max={8196}
min={512}
step={1}
defaultValue={4096}
layout={FormLayout.Horizontal}
sliderTestId="ds-settings-graph-batch-chunk-token-size-slider"
numberInputTestId="ds-settings-graph-batch-chunk-token-size-input"
></SliderInputFormField>
<FormField
control={form.control}
name="parser_config.graphrag.resolution"