Skip to content

Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.

fix: forward source_ids/tags scope in AutoHypergraph.search

dex0shubham44e70e5e379a
diff --git a/hyperextract/types/hypergraph.py b/hyperextract/types/hypergraph.py
index 541c2c1..9f4037c 100644
--- a/hyperextract/types/hypergraph.py
+++ b/hyperextract/types/hypergraph.py
@@ -795,12 +795,16 @@ class AutoHypergraph(
if top_k_nodes > 0:
if not self._node_memory.has_index():
raise ValueError("Node index not built. Call build_index() first.")
- nodes = self.search_nodes(query, top_k=top_k_nodes)
+ nodes = self.search_nodes(
+ query, top_k=top_k_nodes, source_ids=source_ids, tags=tags
+ )
if top_k_edges > 0:
if not self._edge_memory.has_index():
raise ValueError("Edge index not built. Call build_index() first.")
- edges = self.search_edges(query, top_k=top_k_edges)
+ edges = self.search_edges(
+ query, top_k=top_k_edges, source_ids=source_ids, tags=tags
+ )
return nodes, edges