-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
Subcog current knowledge graph is flat - entities and relationships exist at a single level. Zep Graphiti engine implements a three-tier hierarchical structure that enables:
- Community-level insights
- Aggregated relationship patterns
- Scalable graph queries
- Topic clustering
This hierarchy is: Episodes -> Entities -> Communities
Proposed Solution
Implement a community subgraph tier:
Graph Hierarchy:
- Episode Subgraph: Individual memories/events
- Entity Subgraph: Extracted entities and relationships (current)
- Community Subgraph: Aggregated clusters of related entities
Community Features:
- Automatic clustering of related entities
- Community summarization
- Inter-community relationships
- Hierarchical navigation
Benefits:
- "Zoom out" to see big picture
- Faster queries via community-level filtering
- Emergent topic discovery
- Scalable to large graphs
Proposed API:
pub struct Community {
id: CommunityId,
name: String,
summary: String,
members: Vec<EntityId>,
parent: Option<CommunityId>,
}MCP tools:
subcog_communities:
action: detect # Run community detection algorithm
algorithm: louvain
min_size: 3
subcog_community_get:
community_id: "comm_123"
include: ["members", "relationships", "summary"]
subcog_graph:
operation: visualize
level: community # Show community-level view
depth: 2Enhanced recall with community context:
subcog_recall:
query: "database decisions"
community_boost: true # Boost results from same communityAlternatives Considered
- Flat graph only (current) - does not scale
- Manual tagging for grouping - tedious
- External graph analytics - lose integration
Additional Context
- Zep hierarchical graph: https://arxiv.org/abs/2501.13956
- Community detection algorithms: Louvain, Leiden
- Enhances existing graph capabilities
Breaking Change: No
Priority: Nice to have
Contribution: Yes, with guidance
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request