Motivation
LightRAG and Leiden are configured by constructing DualRetrievalConfig, KeywordExtractorConfig, and LeidenConfig and passing them to rag.lightRAG(...). A fluent builder surface (matching the existing withChunkSize/withTopK/withApproach style) makes them discoverable and consistent.
Scope
- Add builder methods (e.g.
withMergeStrategy, withKeywordLimit, withLeidenResolution, or a single withLightRAG(config:keywordConfig:) / withLeiden(config:)) that store defaults on Config.
- Have
GraphRAG.lightRAG() / detectCommunities() use those stored defaults when the caller doesn't override them (while keeping the explicit per-call parameters working).
- Keep it purely additive — no behavior change when the new methods aren't used.
Files (small, low-overlap)
Sources/GraphRAG/GraphRAG/Builder.swift, Sources/GraphRAG/GraphRAG/Config.swift. Small; only coordinate with the "LLM community summaries" issue if that one also adds a Config flag.
Acceptance criteria
- New builder methods set the defaults;
lightRAG()/detectCommunities() honor them; existing call sites unchanged.
- Unit tests for the new builder methods.
- CI green.
Context: follow-up to PRs #2 / #3. Good "starter" / parallelizable task.
Motivation
LightRAG and Leiden are configured by constructing
DualRetrievalConfig,KeywordExtractorConfig, andLeidenConfigand passing them torag.lightRAG(...). A fluent builder surface (matching the existingwithChunkSize/withTopK/withApproachstyle) makes them discoverable and consistent.Scope
withMergeStrategy,withKeywordLimit,withLeidenResolution, or a singlewithLightRAG(config:keywordConfig:)/withLeiden(config:)) that store defaults onConfig.GraphRAG.lightRAG()/detectCommunities()use those stored defaults when the caller doesn't override them (while keeping the explicit per-call parameters working).Files (small, low-overlap)
Sources/GraphRAG/GraphRAG/Builder.swift,Sources/GraphRAG/GraphRAG/Config.swift. Small; only coordinate with the "LLM community summaries" issue if that one also adds aConfigflag.Acceptance criteria
lightRAG()/detectCommunities()honor them; existing call sites unchanged.Context: follow-up to PRs #2 / #3. Good "starter" / parallelizable task.