graphify icon indicating copy to clipboard operation
graphify copied to clipboard

feat:Hierarchical Knowledge Aggregation for Graphify

Open ljinshuan opened this issue 7 months ago • 5 comments

Close https://github.com/safishamsi/graphify/issues/265

Hierarchical Knowledge Aggregation for Graphify

Issue Origin: Single flat knowledge graph cannot represent hierarchical project structure. Large-scale codebases need layered knowledge with bottom-up aggregation and intelligent query routing.

1. Problem Statement: Why Hierarchical Knowledge Aggregation?

Graphify originally supported only a single flat knowledge graph — all source files (code, docs, images) are extracted, merged into one graph.json, and served via MCP as a flat graph.

This reveals three core problems in large-scale projects:

  1. Information Overload 🤯: A 500+ file project produces a graph with thousands of nodes. LLM query token budgets are wasted on irrelevant details, and key architectural information is buried.

  2. Lack of Abstraction Levels 🏗️: Microservice architectures are naturally hierarchical (services → domains → system), but flat graphs cannot represent this. Asking "what is the system architecture?" vs. "how does auth function call work?" requires completely different abstraction levels.

  3. Inefficient Queries 🐌: Every query searches the entire graph, unable to leverage hierarchical structure to narrow scope.

Core Insight: Knowledge should be layered like geographic maps — bottom layers are street-level detail, upper layers are city-level overviews. Upper layer graph = own content + lower layer summary, forming a strict layered DAG.

ljinshuan avatar Apr 12 '26 15:04 ljinshuan

👋 Friendly reminder — this PR has been sitting here for a while and we've already resolved merge conflicts multiple times to keep it in sync with upstream/v4.

At this point, we'd really appreciate a decision on whether this feature aligns with the project's direction:

✅ If this is something you want — a quick review and merge would be amazing. The feature is ready and has been kept up-to-date through multiple conflict resolutions.

❌ If this isn't the right fit — no hard feelings at all! Just let us know and we'll gladly close this PR to keep the backlog clean.

Either way, a response would be greatly appreciated so we can stop burning cycles on conflict resolution and move forward. 🙏

Thanks for your time!

#265

ljinshuan avatar Apr 16 '26 15:04 ljinshuan

I would double on that. I am unable to use graphify due my vault having too many files. I can however run graphify multiple times in different levels, but that breaks the main proposal of the project.

3esmit avatar Apr 20 '26 13:04 3esmit

I would double on that. I am unable to use graphify due my vault having too many files. I can however run graphify multiple times in different levels, but that breaks the main proposal of the project.

https://github.com/safishamsi/graphify/issues/425#issuecomment-4273276460 。 This issue aims to solve similar problems. The author mentioned in this issue that this feature is included in the v5.0 roadmap. We can look forward to it. @safishamsi

ljinshuan avatar Apr 20 '26 17:04 ljinshuan

Is this feature available now? If so, how do I use it? Also, does it support dynamic updates, such as when I add a new microservice?

yongquan-huang avatar May 18 '26 06:05 yongquan-huang

Is this feature available now or is no longer in the roadmap? This is a much needed feature so been waiting...

shahshubh avatar Jun 14 '26 07:06 shahshubh