query: add connectivity pipe stage

BFS-based connectivity analysis as a query pipeline stage. Shows
connected components, islands, and sample paths between result nodes
through the full graph (max 4 hops).

  poc-memory query "content ~ 'made love' | connectivity"
  poc-memory query "(content ~ 'A' OR content ~ 'B') | connectivity"

Also documented in query --help.
This commit is contained in:
ProofOfConcept 2026-03-11 17:04:59 -04:00
parent 0e971dee61
commit 9a0908fbc6
2 changed files with 109 additions and 1 deletions

View file

@ -143,6 +143,7 @@ PIPE STAGES:
| limit N cap results
| select F,F,... output fields as TSV
| count just show count
| connectivity show graph structure between results
FUNCTIONS:
community('key') community id of a node
@ -151,11 +152,12 @@ FUNCTIONS:
EXAMPLES:
key ~ 'inner-life' substring match on keys
content ~ 'made love' full-text search
content ~ 'made love' | connectivity find clusters among results
(content ~ 'A' OR content ~ 'B') | connectivity
degree > 15 | sort degree | limit 10 high-degree nodes
key ~ 'journal' AND degree > 10 | count count matching nodes
neighbors('identity') WHERE strength > 0.5 | sort strength
* | sort weight asc | limit 20 lowest-weight nodes
node_type = semantic | sort degree all semantic nodes by degree
")]
Query {
/// Query expression (e.g. "key ~ 'inner-life'")