awslabs / awslabs/graphrag-toolkit

[BUG] Semantic-guided read paths read chunk.value directly and break under an external ChunkStore

Open
#505 0 comments 0 reactions 1 assignee Claimed by @noel-improv View on GitHub
bug
Dominant language
Python
Stars
442
Forks
106
Avg merge
2d 3h
Merged PRs (30d)
41

Description

**Package version:** 3.18.5
**Package:** lexical-graph
**Python version:** 3.12
**OS:** Linux

## Description

#437 moved the traversal-based read paths onto `ChunkStore`. The semantic-guided stack still reads `chunk.value` off the graph, so it breaks once a deployment configures an external chunk store and `ChunkGraphBuilder` stops writing that property (`indexing/build/chunk_graph_builder.py:80-88`).

Two queries fetch chunk nodes with no property list, which defaults to `['*']` (`storage/graph/graph_utils.py:130`) and drags the full text back on every call:

- `retrieval/utils/chunk_utils.py:60` — `get_chunks_query`
- `retrieval/utils/statement_utils.py:124` — `get_statements_query`

Three consumers index `['value']` on the result and raise `KeyError` once the property is gone:

- `retrieval/retrievers/deprecated/semantic_guided_chunk_retriever.py:173`
- `retrieval/retrievers/deprecated/semantic_guided_retriever.py:218`
- `retrieval/post_processors/statement_enhancement.py:103`, which feeds that text to the LLM as synthesis context

`StatementEnhancementPostProcessor` is not deprecated, and it ships in the docs, an example notebook, and the integration tests.

#437 skipped `get_chunks_query` on purpose: "left as-is since its only caller is deprecated." That held while the property was still written.

## Steps to reproduce

Needs the S3 backend from #465. `InGraphChunkStore` is the only store on `main` and it still writes `chunk.value`.

Set `GraphRAGConfig.s3_chunk_store`, index a document set, then query through `SemanticGuidedRetriever` — with `StatementEnhancementPostProcessor` enabled, or with a chunk retriever. Both hit `KeyError: 'value'`.

## Expected

The semantic-guided paths resolve chunk text through `ChunkStore`, the way `keyword_vss_provider.py` and `traversal_based_base_retriever.py` do.

## Proposed fix

- Wire `statement_enhancement.py` to `ChunkStore`.
- Wire the semantic-guided retrievers, or delete them along with `get_chunks_query`, which has no other caller.
- Name the properties in whichever `node_result` calls survive, so these queries stop pulling text they may not use.

This should land before an external chunk store becomes the default.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.