@@ -682,10 +682,12 @@ def detect_patterns(
682682 self ,
683683 * ,
684684 detect : typing .Optional [DetectConfig ] = OMIT ,
685+ edge_limit : typing .Optional [int ] = OMIT ,
685686 graph_id : typing .Optional [str ] = OMIT ,
686- include_examples : typing .Optional [bool ] = OMIT ,
687687 limit : typing .Optional [int ] = OMIT ,
688688 min_occurrences : typing .Optional [int ] = OMIT ,
689+ query : typing .Optional [str ] = OMIT ,
690+ query_limit : typing .Optional [int ] = OMIT ,
689691 recency_weight : typing .Optional [RecencyWeight ] = OMIT ,
690692 search_filters : typing .Optional [SearchFilters ] = OMIT ,
691693 seeds : typing .Optional [PatternSeeds ] = OMIT ,
@@ -695,25 +697,35 @@ def detect_patterns(
695697 """
696698 Detects structural patterns in a knowledge graph including relationship frequencies,
697699 multi-hop paths, co-occurrences, hubs, and clusters.
700+ When a query is provided, uses hybrid search to discover seed nodes,
701+ detects triple-frequency patterns, and returns resolved edges ranked by relevance.
698702
699703 Parameters
700704 ----------
701705 detect : typing.Optional[DetectConfig]
702706 Which pattern types to detect with type-specific configuration.
703- Omit to detect all types with defaults.
707+ Omit to detect all types with defaults. Ignored when query is set.
708+
709+ edge_limit : typing.Optional[int]
710+ Max resolved edges per pattern. Default: 10, Max: 100. Only used with query.
704711
705712 graph_id : typing.Optional[str]
706713 Graph ID when detecting patterns on a named graph
707714
708- include_examples : typing.Optional[bool]
709- Include example node/edge UUIDs per pattern. Default: false
710-
711715 limit : typing.Optional[int]
712716 Max patterns to return. Default: 50, Max: 200
713717
714718 min_occurrences : typing.Optional[int]
715719 Minimum occurrence count to report a pattern. Default: 2
716720
721+ query : typing.Optional[str]
722+ Search query for discovering seed nodes via hybrid search.
723+ When set, forces triple-frequency detection only and enables edge resolution
724+ with cross-encoder reranking. Mutually exclusive with seeds.
725+
726+ query_limit : typing.Optional[int]
727+ Max seed nodes from search. Default: 10, Max: 50. Only used with query.
728+
717729 recency_weight : typing.Optional[RecencyWeight]
718730 Exponential half-life decay applied to edge created_at timestamps.
719731 Valid values: none, 7_days, 30_days, 90_days. Default: none
@@ -723,7 +735,7 @@ def detect_patterns(
723735 Reuses the same filter format as /graph/search.
724736
725737 seeds : typing.Optional[PatternSeeds]
726- Seed selection. If omitted, analyzes the entire graph.
738+ Seed selection. If omitted, analyzes the entire graph. Mutually exclusive with query.
727739
728740 user_id : typing.Optional[str]
729741 User ID when detecting patterns on a user graph
@@ -747,10 +759,12 @@ def detect_patterns(
747759 """
748760 _response = self ._raw_client .detect_patterns (
749761 detect = detect ,
762+ edge_limit = edge_limit ,
750763 graph_id = graph_id ,
751- include_examples = include_examples ,
752764 limit = limit ,
753765 min_occurrences = min_occurrences ,
766+ query = query ,
767+ query_limit = query_limit ,
754768 recency_weight = recency_weight ,
755769 search_filters = search_filters ,
756770 seeds = seeds ,
@@ -1686,10 +1700,12 @@ async def detect_patterns(
16861700 self ,
16871701 * ,
16881702 detect : typing .Optional [DetectConfig ] = OMIT ,
1703+ edge_limit : typing .Optional [int ] = OMIT ,
16891704 graph_id : typing .Optional [str ] = OMIT ,
1690- include_examples : typing .Optional [bool ] = OMIT ,
16911705 limit : typing .Optional [int ] = OMIT ,
16921706 min_occurrences : typing .Optional [int ] = OMIT ,
1707+ query : typing .Optional [str ] = OMIT ,
1708+ query_limit : typing .Optional [int ] = OMIT ,
16931709 recency_weight : typing .Optional [RecencyWeight ] = OMIT ,
16941710 search_filters : typing .Optional [SearchFilters ] = OMIT ,
16951711 seeds : typing .Optional [PatternSeeds ] = OMIT ,
@@ -1699,25 +1715,35 @@ async def detect_patterns(
16991715 """
17001716 Detects structural patterns in a knowledge graph including relationship frequencies,
17011717 multi-hop paths, co-occurrences, hubs, and clusters.
1718+ When a query is provided, uses hybrid search to discover seed nodes,
1719+ detects triple-frequency patterns, and returns resolved edges ranked by relevance.
17021720
17031721 Parameters
17041722 ----------
17051723 detect : typing.Optional[DetectConfig]
17061724 Which pattern types to detect with type-specific configuration.
1707- Omit to detect all types with defaults.
1725+ Omit to detect all types with defaults. Ignored when query is set.
1726+
1727+ edge_limit : typing.Optional[int]
1728+ Max resolved edges per pattern. Default: 10, Max: 100. Only used with query.
17081729
17091730 graph_id : typing.Optional[str]
17101731 Graph ID when detecting patterns on a named graph
17111732
1712- include_examples : typing.Optional[bool]
1713- Include example node/edge UUIDs per pattern. Default: false
1714-
17151733 limit : typing.Optional[int]
17161734 Max patterns to return. Default: 50, Max: 200
17171735
17181736 min_occurrences : typing.Optional[int]
17191737 Minimum occurrence count to report a pattern. Default: 2
17201738
1739+ query : typing.Optional[str]
1740+ Search query for discovering seed nodes via hybrid search.
1741+ When set, forces triple-frequency detection only and enables edge resolution
1742+ with cross-encoder reranking. Mutually exclusive with seeds.
1743+
1744+ query_limit : typing.Optional[int]
1745+ Max seed nodes from search. Default: 10, Max: 50. Only used with query.
1746+
17211747 recency_weight : typing.Optional[RecencyWeight]
17221748 Exponential half-life decay applied to edge created_at timestamps.
17231749 Valid values: none, 7_days, 30_days, 90_days. Default: none
@@ -1727,7 +1753,7 @@ async def detect_patterns(
17271753 Reuses the same filter format as /graph/search.
17281754
17291755 seeds : typing.Optional[PatternSeeds]
1730- Seed selection. If omitted, analyzes the entire graph.
1756+ Seed selection. If omitted, analyzes the entire graph. Mutually exclusive with query.
17311757
17321758 user_id : typing.Optional[str]
17331759 User ID when detecting patterns on a user graph
@@ -1759,10 +1785,12 @@ async def main() -> None:
17591785 """
17601786 _response = await self ._raw_client .detect_patterns (
17611787 detect = detect ,
1788+ edge_limit = edge_limit ,
17621789 graph_id = graph_id ,
1763- include_examples = include_examples ,
17641790 limit = limit ,
17651791 min_occurrences = min_occurrences ,
1792+ query = query ,
1793+ query_limit = query_limit ,
17661794 recency_weight = recency_weight ,
17671795 search_filters = search_filters ,
17681796 seeds = seeds ,
0 commit comments