Add bender kg command and knowledge graph subsystem#306
Draft
aottavianoTT wants to merge 1 commit into
Draft
Conversation
…igns Introduces the `bender kg` command and six supporting crates: - bender-kg-models: IR types (ModuleData, PortInfo, ParamInfo, InstantiationInfo, …) - bender-kg-extract: SystemVerilog → IR extraction pipeline via bender-slang - bender-kg-store: Grafeo-backed graph + HNSW vector + BM25 text store - bender-kg-similarity: dense module embeddings (Model2Vec / ONNX) - bender-kg-core: orchestration layer with typed Engine query API - bender-kg-mcp: stdio MCP server exposing all queries as MCP tools The kg subsystem supports build, incremental update, and a rich query surface (module search, hierarchy traversal, port/parameter/signal tracing, structural similarity, connectivity checks) consumable from both the CLI and AI assistants.
bender kg command and knowledge graph subsystem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a knowledge graph (KG) pipeline that parses SystemVerilog designs via
bender-slanginto a queryable graph, exposed viabender kgCLI and an MCP server for AI assistant integration.Architecture
The pipeline is split across six new crates:
bender-kg-modelsModuleData,PortInfo,ParamInfo,InstantiationInfo, …) used as the common data contract between cratesbender-kg-extractbender-slangto parse SV source files and emit structured IRbender-kg-storebender-kg-similaritybender-kg-coreEngineAPI; callers issue structured queries and get typed results backbender-kg-mcpbender-kg-corein a stdio MCP server so AI assistants can call all queries as MCP toolsQuery surface
Once the KG is built (or incrementally updated), it supports: