Skip to main content
Version: latest

agrag.retrieval.retrievers.chunk.ChunkRetriever

ChunkRetriever(*, graph_store:GraphStore, embedder:Embedder, settings:RetrievalSettings | None = None, tracer:Tracer | None = None) -> None

Bases: Retriever

Dense chunk search via vector similarity.

Embeds the query, searches the Chunk vector index that ingestion provisions, then loads each hit into a Chunk.

Functions:

  • retrieve – Run chunk search and return loaded results.

Attributes:

Parameters:

  • graph_store (GraphStore) – Backs chunk search and the chunk reads.
  • embedder (Embedder) – Produces query vectors.
  • 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 = 'chunk'

retrieve​

retrieve(query:str, *, filters:SearchFilters | None = None, limit:int | None = None) -> list[SearchResult]

Run chunk 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.chunk_top_k. Zero or negative returns no results without searching.

Returns:

  • list[SearchResult] – Ranked SearchResults with loaded Chunk 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.