Skip to content

feat(memory): centrality projection over the knowledge-graph tier #263

Description

@prakashUXtech

Summary

Add a centrality projection over the knowledge-graph tier that ranks entities by how connected they are, so a soul can answer "what do I keep coming back to" and surface the hub concepts and the bridges between clusters.

Why

Same comparison source as the derivation-kind issue: graphify surfaces "god nodes" (high-degree hubs) and cross-cluster connections from its concept graph, and that view is a big part of why it reads as useful at a glance.

Our graph tier already supports neighbors, path, and subgraph (GraphView / Subgraph in graph_types.py), but there is no centrality computation. Because the architecture is journal + projections, centrality is a clean read-only projection: recompute it from the existing nodes and edges, store nothing new.

Proposal

  1. A hubs(top_n) method on GraphView that ranks entities by degree centrality.
  2. A soul graph hubs CLI subcommand that prints the ranking.
  3. Degree centrality first, computed in stdlib so it stays headless. Betweenness (the bridge signal) optional behind the existing networkx extra.

Two follow-on uses, out of scope for the first cut but worth noting:

  • Feed degree into the recall salience signal, since a hub entity is usually a more important anchor.
  • Pair with the derivation-kind tag so a hub built mostly from inferred edges can be flagged as speculative rather than grounded.

Scope

One GraphView method, one CLI subcommand, no persisted state, no required new dependency. Betweenness gated behind the networkx extra.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions