graphify-dotnet

mcp
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 9 GitHub stars
Code Basarisiz
  • fs module — File system access in .github/workflows/squad-heartbeat.yml
  • fs module — File system access in .github/workflows/squad-issue-assign.yml
  • rm -rf — Recursive force deletion command in .github/workflows/squad-promote.yml
Permissions Gecti
  • Permissions — No dangerous permissions requested
Purpose
This tool is a .NET port of an AI-powered knowledge graph builder. It analyzes your local codebase through AST parsing and semantic analysis, mapping out the project's structure and concepts into an interactive graph.

Security Assessment
Overall Risk: Medium. The tool inherently requires broad file system access to read and analyze your codebase, which is its intended function. However, the automated scan flagged a `rm -rf` (recursive force deletion) command inside a GitHub Actions workflow (`squad-promote.yml`). While this is likely just part of a CI/CD cleanup script and poses no direct threat to your local machine during normal use, it represents sloppy automation hygiene. Additionally, because the tool extracts concepts from your files using external AI providers (like Azure OpenAI or Ollama), your proprietary code might be sent over the network to third-party APIs depending on your configuration. No hardcoded secrets or dangerous application-level permissions were detected.

Quality Assessment
The project is very new and currently has low community visibility with only 9 stars. However, it is actively maintained, with repository updates pushed as recently as today. It benefits from a clear README, solid documentation, and a standard MIT license. The codebase relies on modern, reputable libraries like the GitHub Copilot SDK and Microsoft.Extensions.AI.

Verdict
Use with caution: The tool is functional and actively updated, but you should verify your AI provider settings to prevent unintentionally leaking sensitive source code to external models, and be aware of its low community maturity.
SUMMARY

A .NET 10 port of graphify - AI knowledge graph builder for codebases using GitHub Copilot SDK and Microsoft.Extensions.AI

README.md

graphify-dotnet

CI Build
License: MIT
GitHub stars

🔍 Build AI-powered knowledge graphs from any codebase. Understand structure you didn't know was there.

💡 Origin story — This project traces back to Andrej Karpathy's tweet on using LLMs to build personal knowledge bases: ingesting raw sources, compiling them into structured Markdown wikis, and navigating knowledge through graph views instead of keyword search. That idea inspired graphify by @safishamsi, which was then showcased by @socialwithaayan — and that's what kicked off this .NET port.

graphify-dotnet is a .NET 10 port of the Python graphify project — an AI knowledge graph builder for codebases. It reads your files (code, docs, papers, images), extracts concepts and relationships through AST parsing and semantic analysis, builds a knowledge graph with community detection, and exports to multiple formats. Navigate codebases by structure instead of keyword search.

Features

  • Multi-stage pipeline: detect → extract → build → cluster → analyze → report → export
  • Hybrid extraction: AST-based code parsing (tree-sitter) + AI semantic extraction for docs/images
  • Graph clustering: Louvain community detection to find natural groupings in your codebase
  • Multiple export formats: JSON, HTML (vis.js interactive graph), SVG, GraphML, Wiki, Obsidian vault, Neo4j Cypher
  • MCP server: Model Context Protocol server for AI assistant integration
  • Confidence tracking: Every inferred edge tagged with confidence score (EXTRACTED, INFERRED, AMBIGUOUS)
  • SHA256 caching: Only re-process changed files
  • Language support: Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, Ruby, Kotlin, Scala, PHP, Swift, Lua
  • Multimodal: Handles code, markdown, PDFs, and images (diagrams, screenshots, whiteboard photos)
  • Multi-provider AI: Azure OpenAI, Ollama, and GitHub Copilot SDK via unified ChatClientFactory
  • Global dotnet tool: Install with dotnet tool install -g graphify-dotnet and run from anywhere
  • Incremental watch mode: File change detection with SHA256 caching — only re-processes what changed

Getting Started

Requirements: .NET 10 SDK

Quick Install (Global Tool)

dotnet tool install -g graphify-dotnet
graphify run .

Build from Source

# Clone the repository
git clone https://github.com/elbruno/graphify-dotnet.git
cd graphify-dotnet

# Build the solution
dotnet build graphify-dotnet.slnx

# Run the CLI
dotnet run --project src/Graphify.Cli -- run .

AI Providers

graphify-dotnet supports multiple AI backends through a unified ChatClientFactory. Pick the one that fits your needs:

Provider Best For Guide
Azure OpenAI Enterprise, private endpoints Setup Guide
Ollama Local/offline, privacy Setup Guide
Copilot SDK GitHub Copilot subscribers, zero-config Setup Guide

Usage

Basic Commands

# Build a knowledge graph from current directory
graphify run .

# Watch for changes, incrementally update graph
graphify watch .

# Build from a specific folder
graphify run ./your-project

# Export all formats
graphify run . --format json,html,svg,neo4j,obsidian,wiki,report

# Run benchmarks
graphify benchmark graphify-out/graph.json

# View configuration
graphify config show

Build from Source

dotnet run --project src/Graphify.Cli -- run .
dotnet run --project src/Graphify.Cli -- run ./your-project --format json,html,report -v

AI Provider Configuration

# Run with default Azure OpenAI (configured via env vars or secrets)
graphify run . --provider azureopenai

# Run with Ollama (local models)
graphify run . --provider ollama

# Run with GitHub Copilot SDK (no API keys needed)
graphify run . --provider copilotsdk

# Copilot SDK with a specific model
graphify run . --provider copilotsdk --model gpt-4o

# Specify endpoint and API key (Azure OpenAI)
graphify run . --provider azureopenai --endpoint https://myresource.openai.azure.com/ --api-key sk-... --deployment gpt-4o

# Custom Ollama endpoint
graphify run . --provider ollama --endpoint http://custom:11434 --model codellama

# View current configuration
graphify config show

Advanced Options

# Verbose mode (detailed progress for each file)
graphify run . -v

# Custom output directory
graphify run . --output my-output-dir

# Specific export formats
graphify run . --format json,html,svg

# All formats at once
graphify run . --format json,html,svg,neo4j,obsidian,wiki,report

Configuration

graphify-dotnet uses a layered configuration system for AI provider settings:

Priority order (highest to lowest):

  1. CLI arguments — e.g., --provider ollama --model codellama
  2. Environment variables — e.g., GRAPHIFY__Provider=ollama
  3. User secrets — e.g., dotnet user-secrets set "Graphify:Provider" "AzureOpenAI"
  4. appsettings.json — Configuration file in the app directory
  5. Defaults — Built-in fallback values

Common configuration examples:

# Using environment variables
export GRAPHIFY__Provider=AzureOpenAI
export GRAPHIFY__AzureOpenAI__Endpoint=https://myresource.openai.azure.com/
export GRAPHIFY__AzureOpenAI__ApiKey=sk-...
export GRAPHIFY__AzureOpenAI__DeploymentName=gpt-4o

# Using environment variables (Copilot SDK — no keys needed)
export GRAPHIFY__Provider=CopilotSdk

# Using user secrets
dotnet user-secrets set "Graphify:Provider" "Ollama"
dotnet user-secrets set "Graphify:Ollama:Endpoint" "http://localhost:11434"

# Using CLI arguments (highest priority)
graphify run . --provider azureopenai --endpoint https://... --api-key sk-... --deployment gpt-4o

# View active configuration
graphify config show

For detailed setup guides, see:

Architecture

graphify-dotnet implements a multi-stage pipeline:

┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐
│  Detect  │ -> │ Extract  │ -> │  Build   │ -> │ Cluster  │
│  Files   │    │ Features │    │  Graph   │    │ (Louvain)│
└──────────┘    └──────────┘    └──────────┘    └──────────┘
                                                       │
                                                       v
┌──────────┐    ┌──────────┐    ┌──────────┐    ┌──────────┐
│  Export  │ <- │  Report  │ <- │ Analyze  │ <- │ Clustered│
│ Formats  │    │Generator │    │  Graph   │    │  Graph   │
└──────────┘    └──────────┘    └──────────┘    └──────────┘

Pipeline Stages:

  1. Detect: Scan directories and identify file types (code, docs, images)
  2. Extract: AST parsing for code + AI semantic extraction for docs/images
  3. Build: Construct graph from extracted nodes and edges
  4. Cluster: Apply Louvain community detection to find natural groupings
  5. Analyze: Calculate centrality metrics, identify god nodes and surprising connections
  6. Report: Generate human-readable summary with suggested questions
  7. Export: Output to JSON, HTML, SVG, Wiki, Obsidian, Neo4j

See ARCHITECTURE.md for detailed component documentation.

Export Formats

graphify supports 7 export formats, each optimized for different use cases:

Format CLI Flag Output Description Guide
JSON json graph.json Machine-readable graph data Guide
HTML html graph.html Interactive vis.js viewer Guide
Report report GRAPH_REPORT.md Human-readable analysis Guide
SVG svg graph.svg Static vector image Guide
Neo4j neo4j graph.cypher Cypher import script Guide
Obsidian obsidian obsidian/ Markdown vault with wikilinks Guide
Wiki wiki wiki/ Agent-crawlable wiki pages Guide

Default formats: json,html,report — use --format to customize.

See Export Formats Overview for detailed comparison and usage.

Worked Example

The samples/mini-library/ directory contains a complete worked example — a small C# library demonstrating the repository pattern. Run the pipeline and see all 7 output formats:

# Generate all formats from the sample project
graphify run samples/mini-library --format json,html,svg,neo4j,obsidian,wiki,report

# Or build from source
dotnet run --project src/Graphify.Cli -- run samples/mini-library --format json,html,svg,neo4j,obsidian,wiki,report -v

Pre-generated output is available at samples/mini-library/graphify-out/:

samples/mini-library/graphify-out/
├── GRAPH_REPORT.md    # Analysis report (god nodes, communities, insights)
├── graph.json         # Full graph data (47 nodes, 79 edges)
├── graph.html         # Interactive vis.js viewer — open in browser
├── graph.svg          # Static vector image
├── graph.cypher       # Neo4j import script
├── obsidian/          # Obsidian vault (35 .md files with wikilinks)
└── wiki/              # Agent-crawlable wiki (index + community pages)

Results: 6 C# files → 47 nodes, 79 edges, 7 communities detected. 100% EXTRACTED (AST-only, no AI provider needed).

Building from Source

# Prerequisites
# - .NET 10 SDK or later

# Clone and build
git clone https://github.com/elbruno/graphify-dotnet.git
cd graphify-dotnet

# Restore dependencies
dotnet restore graphify-dotnet.slnx

# Build solution
dotnet build graphify-dotnet.slnx --configuration Release

# Run tests
dotnet test graphify-dotnet.slnx

# Run the CLI
dotnet run --project src/Graphify.Cli -- run .

Documentation

Setup Guides

Export Format Guides

Architecture

License

This project is licensed under the MIT License. See LICENSE file for details.

👋 About the Author

Made with ❤️ by Bruno Capuano (ElBruno)

Acknowledgments

  • Andrej Karpathy's tweet on LLM-powered personal knowledge bases — the original idea that started the chain.
  • This tweet by @socialwithaayan showcasing graphify by @safishamsi — which directly inspired this .NET port.

This project is a .NET 10 port of safishamsi/graphify, reimagined with C# idioms, .NET 10 features, and the Microsoft.Extensions.AI abstraction layer.

Yorumlar (0)

Sonuc bulunamadi