Skip to main content

agrag.common.data_models.community.Community

Bases: DataPoint

A cluster of entities detected by hierarchical Leiden, with an LLM report.

Attributes:

  • title (str) – A short, human-readable name for the community.
  • summary (str) – A prose summary of what the community is about.
  • rating (float) – An importance rating for this community, 0-10.
  • rating_explanation (str) – One sentence explaining the rating.
  • findings (list[str]) – Distinct factual claims the report supports.
  • member_ids (list[UUID]) – Ids of every Entity in this community, ordered by internal weighted degree descending (see compute_communities). The highest-centrality, most representative members first.
  • internal_weight (float) – Total weight of edges where both endpoints are members of this community. A free-to-compute importance signal with no extra query and no new dependency. Used in place of raw member count to decide which communities get a real LLM report. A small but densely-attested community can matter more than a larger sparse one.
  • embedding (list[float] | None) – The community's dense vector, computed from title and summary. None before the report/embedding stage runs.

Functions:

  • to_node_record – Return this community as a GraphStore write record.

created_at​

created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))

embedding​

embedding: list[float] | None = None

embedding_text​

embedding_text: str

Return the text this community's embedding is computed from.

findings​

findings: list[str] = Field(default_factory=list)

id​

id: UUID

internal_weight​

internal_weight: float = Field(default=0.0, ge=0.0)

member_ids​

member_ids: list[UUID] = Field(default_factory=list)

metadata​

metadata: dict[str, Any] = Field(default_factory=dict)

rating​

rating: float = Field(ge=0.0, le=10.0)

rating_explanation​

rating_explanation: str

summary​

summary: str

title​

title: str

to_node_record​

to_node_record() -> NodeRecord

Return this community as a GraphStore write record.