agrag.retrieval.retrievers.community.CommunityRetriever
CommunityRetriever(*, graph_store:GraphStore, embedder:Embedder, vector_store:VectorStore | None = None, settings:RetrievalSettings | None = None, tracer:Tracer | None = None) -> None
Bases: Retriever
Dense search over community reports, for direct thematic questions.
Functions:
- retrieve – Run community-report search and return loaded results.
Attributes:
- name –
Parameters:
- graph_store (
GraphStore) – Where community nodes live. - embedder (
Embedder) – Produces query vectors. - vector_store (
VectorStore | None) – Optional VectorStore for hybrid search. - settings (
RetrievalSettings | None) – Retrieval configuration. Defaults from environment. - tracer (
Tracer | None) – Opens spans for the retriever and its children. None opens no recorded span.
name
name = 'community'
retrieve
retrieve(query:str, *, filters:SearchFilters | None = None, limit:int | None = None) -> list[SearchResult]
Run community-report search and return loaded results.
Parameters:
- query (
str) – The natural-language query text. - filters (
SearchFilters | None) – Constraints applied to the search. - limit (
int | None) – Maximum results. None uses settings.community_top_k. Zero or negative returns no results without searching.
Returns:
list[SearchResult]– Ranked SearchResults with loaded Community items. The list is empty when the limit is not positive, or when the search ran and found nothing.
Raises:
Exception– Any embedding, vector search, or graph read failure propagates, so a failed search is not mistaken for an empty one.