community

package
v1.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 3 Imported by: 0

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL