Version: 0.0.4
agrag.retrieval.retrievers.entity.EntityRetriever
EntityRetriever(*, graph_store:GraphStore, embedder:Embedder, vector_store:VectorStore | None = None, settings:RetrievalSettings | None = None, entity_labels:Sequence[str] | None = None, tracer:Tracer | None = None) -> None
Bases: Retriever
Dense entity search via vector similarity.
Embeds the query, searches via the GraphStore-native or
VectorStore path, then resolves every hit through
resolve_entity so the caller can trust item.id is live.
The native path searches one vector index per entity label, so it
needs the labels ingestion provisioned indexes for: the label
filter when the caller sets one, otherwise entity_labels.
Functions:
- retrieve – Run entity search and return hydrated results.
Attributes:
- name –
Parameters:
- graph_store (
GraphStore) – Backs entity search when vector_store is absent. - embedder (
Embedder) – Produces query vectors. - vector_store (
VectorStore | None) – Optional VectorStore for hybrid search. - settings (
RetrievalSettings | None) – Retrieval configuration; defaults from environment. - entity_labels (
Sequence[str] | None) – The schema entity labels native search runs against. None uses settings.entity_labels. - tracer (
Tracer | None) – Opens the retriever and its children's spans. None opens no recorded span.
name
name = 'entity'
retrieve
retrieve(query:str, *, filters:SearchFilters | None = None, limit:int | None = None) -> list[SearchResult]
Run entity search and return hydrated 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.entity_top_k. Zero or negative returns no results without searching.
Returns:
list[SearchResult]– Ranked SearchResults with resolved entity ids.
Raises:
ValueError– Native search was selected and neither the filter nor the configuration names an entity label.