Engineers building retrieval-augmented generation systems currently face a frustrating architectural crossroads. When implementing knowledge graphs, they must typically commit to a specific indexing philosophy before a single token is processed. If they choose a global summarization approach to capture high-level themes, they often sacrifice the granular precision needed for specific entity queries. If they opt for a lightweight, query-time retrieval method, they risk missing the broader context of the corpus. This binary choice forces teams to guess the nature of their users' queries before the system is even deployed, often leading to costly re-indexing cycles when the initial strategy fails to meet production needs.
The Unified Infrastructure for Knowledge Graphs
AWS Labs has addressed this friction with the release of `unified-kg-rag-on-aws`, an open-source implementation stack that allows Microsoft GraphRAG and HKUDS LightRAG to coexist within a single environment. Rather than forcing a choice at the indexing stage, this stack enables developers to maintain a single graph index and toggle between different retrieval strategies at the moment of the query. The entire pipeline is hosted on a coordinated AWS architecture where AWS Bedrock handles LLM orchestration, Amazon Neptune manages the graph data, and Amazon OpenSearch provides the necessary vector search capabilities, all supported by Amazon S3 for storage.
To streamline deployment, the project provides an automated infrastructure setup via the AWS Cloud Development Kit (CDK) located in the `iac/` directory of the repository. This ensures that the complex interplay between the graph database and the vector store is configured consistently across environments. The full source code and deployment guides are available via the official GitHub repository at https://github.com/awslabs/unified-kg-rag-on-aws.
The Strategy Shift and the Performance Paradox
The true technical pivot of this stack lies in how it handles the fundamental tension between GraphRAG and LightRAG. GraphRAG operates on a heavy-indexing principle, pre-generating community summaries during the indexing phase to reduce the computational load during the query phase. LightRAG takes the opposite approach, keeping the indexing process lean and instead employing a dual-layer keyword search at query time to synthesize responses. By unifying these on a single Neptune-backed graph, AWS Labs allows users to switch between these behaviors using a simple `--search-strategy` flag.
When testing this implementation against the MuSiQue and 2WikiMultihopQA datasets—using 100 questions per set across three iterations—the results revealed an unexpected performance gain. While the LightRAG modes remained statistically consistent with the original project, the local implementation of GraphRAG actually outperformed the original version, showing a token-F1 score increase of 0.11. This improvement stems from a critical change in how context is fed to the LLM. While the original GraphRAG relies primarily on entity descriptions to build context, the AWS implementation includes the original source paragraphs. This modification caused the rate of ground-truth paragraphs appearing in the top five results to jump from 47% in the original version to 80% in the unified stack.
For practitioners, the environment is managed through the `uv` package manager to ensure dependency stability. Configuration is handled via a `config.yaml` file where endpoints for Bedrock, Neptune, OpenSearch, and S3 are defined. The deployment and ingestion process follows a strict sequence:
git clone https://github.com/awslabs/unified-kg-rag-on-aws.git && cd unified-kg-rag-on-aws
uv sync --extra dev
cp config-template.yaml config.yaml
run-ingestion --source-directory ./sourceOnce the data is ingested, the ability to cross-validate strategies becomes the primary tool for optimization. A developer can test a global summary query and a mixed-mode entity query back-to-back to determine which strategy yields the highest accuracy for their specific dataset:
run-rag --query "코퍼스 전반의 주요 리스크를 요약해줘" --search-strategy global
run-rag --query "배상 한도와 관련된 엔터티는?" --search-strategy mixThis capability transforms the RAG pipeline from a static configuration into a dynamic experiment, allowing teams to find the exact equilibrium between query latency and response precision without ever re-indexing their data.
This architecture signals a shift toward hybrid retrieval systems where the index is a permanent asset and the search strategy is a tunable parameter.




