Detect Patterns (Experimental)

Detects structural patterns in a knowledge graph including relationship frequencies, multi-hop paths, co-occurrences, hubs, and clusters. When a query is provided, uses hybrid search to discover seed nodes, detects triple-frequency patterns, and returns resolved edges ranked by relevance.

Request

Pattern detection request
detectobjectOptional

Which pattern types to detect with type-specific configuration. Omit to detect all types with defaults. Ignored when query is set.

edge_limitintegerOptional1-100

Max resolved edges per pattern. Default: 10, Max: 100. Only used with query.

graph_idstringOptional
Graph ID when detecting patterns on a named graph
limitintegerOptional1-200

Max patterns to return. Default: 50, Max: 200

min_occurrencesintegerOptional>=1

Minimum occurrence count to report a pattern. Default: 2

querystringOptional1-400 characters

Search query for discovering seed nodes via hybrid search. When set, forces triple-frequency detection only and enables edge resolution with cross-encoder reranking. Mutually exclusive with seeds.

query_limitintegerOptional1-50

Max seed nodes from search. Default: 10, Max: 50. Only used with query.

recency_weightenumOptional

Exponential half-life decay applied to edge created_at timestamps. Valid values: none, 7_days, 30_days, 90_days. Default: none

Allowed values:
search_filtersobjectOptional

Filters which edges/nodes participate in pattern detection. Reuses the same filter format as /graph/search.

seedsobjectOptional
Seed selection. If omitted, analyzes the entire graph. Mutually exclusive with query.
user_idstringOptional
User ID when detecting patterns on a user graph

Response

Detected patterns
metadataobject or null
Statistics about the detection run
nodeslist of objects or null

Resolved nodes referenced by pattern edges (deduplicated). Only populated when query is set.

patternslist of objects or null

Detected patterns, sorted by weighted_score descending

Errors