Version: latest
agrag.evidence.discover.discover
discover(store:GraphStore, embedder:Embedder, query:str, *, mode:DiscoveryMode, limit:int, scope:frozenset[str], timeout:float | None = None) -> DiscoveryResult
Find up to limit visible passages that match a query.
The lexical leg matches the words of the query against chunk text. The
semantic leg embeds the query and searches the chunk embeddings. The hybrid
mode runs both and fuses them. Discovery returns status index_not_ready
when a needed index is missing or not ONLINE. It returns empty_scope
without searching when scope is empty.
Parameters:
- store (
GraphStore) – The graph store to search. - embedder (
Embedder) – Embeds the query for the semantic leg. The lexical leg does not use it. - query (
str) – The query text. Lucene syntax is not applied: each word is searched as a plain term. - mode (
DiscoveryMode) – Which legs to run. - limit (
int) – The most hits to return. Must be positive. - scope (
frozenset[str]) – Keys of the documents that may be searched. - timeout (
float | None) – Server-side transaction timeout in seconds for each store read. None uses the server's default.
Returns:
DiscoveryResult– The hits, best first, with the status, truncation flag, index state andDiscoveryResult– any failed legs.
Raises:
ValueError–limitis not positive.