Documentation
¶
Overview ¶
Package community provides community detection algorithms for GraphRAG. Following Microsoft GraphRAG design, communities enable hierarchical summarization and global search capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetectorOption ¶
type DetectorOption func(*LouvainDetector)
func WithMaxLevels ¶
func WithMaxLevels(levels int) DetectorOption
func WithMinCommunitySize ¶
func WithMinCommunitySize(size int) DetectorOption
type LouvainDetector ¶
type LouvainDetector struct {
// contains filtered or unexported fields
}
LouvainDetector implements community detection using the Louvain algorithm. This is a greedy optimization algorithm that attempts to maximize modularity.
func NewLouvainDetector ¶
func NewLouvainDetector(graphStore core.GraphStore, opts ...DetectorOption) *LouvainDetector
NewLouvainDetector creates a new Louvain-based community detector.
func (*LouvainDetector) Detect ¶
func (d *LouvainDetector) Detect(ctx context.Context, graphStore core.GraphStore) ([]*core.Community, error)
Detect identifies communities in the graph using a simplified Louvain approach. Returns communities hierarchically (level 0 = finest granularity).
Click to show internal directories.
Click to hide internal directories.