Λογότυπο Graphenium

Graphenium

Κοινότητα
lambda-alpha-labs

Local pre-flight linter and architecture gate for AI agents. Uses tree-sitter, Stack Graphs, and Datalog to mechanically block structural drift, layering bypasses, and scope creep on virtual ASTs before code changes land.

Εκδότηςlambda-alpha-labs
ΑποθετήριοGraphenium
ΓλώσσαRust
Forks
4
Αστέρια
25
Διαθέσιμα εργαλεία
0
Τύπος μεταφοράςstdio
Κατηγορίες
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Συνδέστε εργαλεία σε ροές εργασίας AI

    Το Graphenium παρέχει δυνατότητες MCP που μπορούν να χρησιμοποιηθούν από συμβατές εφαρμογές-πελάτες AI και πράκτορες AI.

  • 0 διαθέσιμα εργαλεία

    Περιηγηθείτε παρακάτω στις ενέργειες που μπορούν να κληθούν, μαζί με τα ονόματα και τις περιγραφές τους, όταν παρέχονται από τον διακομιστή.

  • Ρυθμίσεις έτοιμες για αντιγραφή

    Χρησιμοποιήστε τα αποσπάσματα εγκατάστασης για να ρυθμίσετε αυτόν τον διακομιστή στην εφαρμογή-πελάτη MCP που προτιμάτε.

  • Δείκτες ενδιαφέροντος για τον ανοιχτό κώδικα

    25 αστέρια και 4 διακλαδώσεις στο συνδεδεμένο αποθετήριο.

Graphenium is a local, pre-flight linter and external architecture gate for AI coding agents.

It enforces structural compliance on AI assistants (such as Claude Code, Cursor, Aider, and Grok) by mechanically blocking code changes that violate your module boundaries, bypass your service layers, or introduce architectural drift.

Standard developer tools help agents find files. Graphenium prevents agents from creating architectural debt.

text
Without Graphenium (Vibe-Coding)        With Graphenium (Containment)
--------------------------------        -----------------------------
Agent edits files blindly               Agent validates design pre-flight
Agent ignores architectural layers      Graphenium blocks direct boundary violations
Constraints decay in long chats         External Datalog engine enforces strict rules
Reviewer hunts for bypassed layers      Reviewer gets deterministic scope-creep audits
CI checks only test passing             CI fails on architectural drift

Binary: gm
Schema: 0.2.0
Status: AST + Stack Graphs resolver stable, pre-flight policy engine stable, zero-drift delta gating stable, telemetry overlay experimental


Why Graphenium Exists: The Containment Gap

AI coding agents are highly efficient at local edits, but they suffer from structural blindness and context decay. Over a long chat session, an agent will lose track of your system instructions and optimize for the path of least resistance (e.g., writing a raw database call inside an HTTP controller to make a local test pass).

Relying on "soft" guardrails like CLAUDE.md or system prompts to maintain design patterns does not work. When context windows get full, these constraints are dropped.

Graphenium establishes external engineering governance. It operates outside the LLM context, treating architectural boundaries as a strict, compiled contract.


The Core Technical Lifecycle: Design-then-Verify

Graphenium enforces an explicit three-step compiler loop on the agent:

  1. Declare Intent (Pre-Flight Spec): Before editing any code, the agent registers its planned changes (classes, methods, and dependencies) in a virtual planning workspace.
  2. Transitive Policy Solving: Graphenium's engine runs a local Datalog solver to analyze the proposed virtual AST. If the design bypasses an intermediary architectural layer or uses banned symbols, Graphenium blocks the plan and provides structural feedback.
  3. Zero-Drift Delta Gating: Even without a .graphenium/policy.json file, Graphenium applies in-memory modularity analysis (ΔQ) and surprise edge profiling to reject plans that mathematically degrade community structure.
  4. Post-Facto Compliance Audit: After the agent writes the code, Graphenium parses the physical modifications, ensuring that the agent did not touch files outside the declared scope, introduce unplanned dependencies, or fail to implement its declared spec.

Quick Start

sh
# 1. Initialize workspace
# Generates .grapheniumignore with standard project defaults
gm init

# 2. Build local AST and Stack Graphs index (No LLM keys required)
gm run . --no-semantic --no-viz

# 3. Diagnose codebase health and import resolution
gm doctor --graph graphenium-out/graph.json --resolution

# 4. Analyze structural neighborhoods
gm query "authentication flow" --budget 2000

# 5. Start the MCP server for AI coding agents
gm serve --graph graphenium-out/graph.json --watch

Installation

sh
# From a local checkout
cargo install --locked --path .

# Or use the platform installer
curl -fsSL https://raw.githubusercontent.com/lambda-alpha-labs/Graphenium/main/install.sh | sh

Requires Rust 1.81 or later. Tree-sitter language grammars are compiled and bundled.


Core Technical Capabilities

1. AST-Proven Provenance (Facts vs. Heuristics)

Most AI developer tools use LLMs to guess how modules depend on each other, leading to hallucinations. Graphenium establishes an index of compiler-proven truth using Tree-sitter and Stack Graphs. Every relationship carries explicit provenance:

  • EXTRACTED (AST-Proven): Compiler-backed facts (imports, type inheritance, explicit call signatures).
  • INFERRED (Heuristics): Semantic leads that the agent is forced to verify.
  • AMBIGUOUS (Collisions): Identifier collisions that force the agent to halt and inspect source files directly.

2. Datalog-Powered Policy Solving

Static linters can check direct imports, but they are blind to multi-hop architectural bypasses. Graphenium solves this by compiling your codebase structure into logical facts and running an embedded Datalog inference engine (src/analyze/query.rs & stdlib.dl).

It uses first-order logic and fixed-point iteration to mathematically prove boundary violations over an infinite number of dependency hops.

3. Zero-Drift Delta Gating (Topological Entropy Guardrails)

Even without explicit policy rules, Graphenium applies in-memory modularity analysis to every planning workspace. The delta engine compares physical-only and virtual (plan-overlay) subgraphs, computing Louvain modularity deltas (ΔQ) and profiling surprise edges. Plans that degrade community structure or introduce architectural shortcuts (cross-community, peripheral→hub) are rejected automatically.

Available via evaluate_delta_gate (MCP), validate_plan (orchestrator), and gm check --delta --plan <id> (CLI).

4. Declarative Structural Governance

Enforce system design boundaries at commit-time or in CI. You declare rules in .graphenium/policy.json at the root of your repository:

json
{
  "rules": [
    {
      "type": "forbidden_dependency",
      "from_pattern": "src/controllers/**",
      "to_pattern": "src/db/**",
      "reason": "Controllers must use services, not access DB directly"
    },
    {
      "type": "strict_layering",
      "layers": [
        "src/serve/**",
        "src/analyze/**",
        "src/extract/**",
        "src/model/**"
      ],
      "reason": "Respect tiered architecture: serve -> analyze -> extract -> model"
    }
  ]
}

Use gm check --plan <id> --strict to run pre-flight policy checks and post-facto compliance audits in CI.

sh
# Topological delta gate (zero-config modularity protection)
gm check --delta --plan <id>

Technical Safeguards: Friction & Loop Mitigations

Traditional static analysis tools and natural-language guardrails (like CLAUDE.md or system prompts) fail when context windows fill up, leading to agent "vibe-coding" and rapid token consumption. Graphenium implements three structural safeguards to prevent developer friction and agent deadlock:

1. Mitigating the "Agent Deadlock" Loop (Pre-Flight Virtual ASTs)

  • The Friction: If an agent is blocked by a strict linter, it can fall into a token-wasting trial-and-error cycle (Propose → Blocked → Tweak → Blocked).
  • Graphenium's Mechanism: Graphenium prevents this loop by isolating change evaluations to a virtual planning workspace (create_planning_workspace). The agent registers its intent — classes, methods, and imports — before editing any physical files. Graphenium's pre-flight solver evaluates this virtual AST in milliseconds.
  • If a violation is found, the agent does not receive a vague natural-language rejection. It receives structured, compiler-proven topological path violations (e.g., demonstrating the exact transitively bypassed service layers). This allows the agent to correctly refactor its design plan in memory before wasting LLM tokens on physical file rewrites.

2. Solving "Policy Rot" (Zero-Config Topological Delta Gating)

  • The Friction: Declaring and maintaining strict architectural rules in a static JSON file (policy.json) introduces manual configuration overhead that fast-moving teams often neglect.
  • Graphenium's Mechanism: If no .graphenium/policy.json file is present in the repository, Graphenium dynamically falls back to Zero-Drift Delta Gating (gm check --delta). Instead of relying on static directory regexes, Graphenium uses its native Louvain community-detection engine to evaluate your codebase's current structural cohesion.
  • When an agent proposes a virtual plan, Graphenium calculates the modularity delta (ΔQ) and surprise coupling score of the new edges. It gracefully accepts your existing legacy complexity as the baseline, but mechanically blocks the agent from introducing new topological decay. No configuration files are required to protect your system's modularity.

3. Resolving Agent Integration Friction (Direct Skill-Folder Injection)

  • The Friction: Standard stateless MCP setups mean agents can easily bypass sequential "three-step" design loops (Declare → Solve → Post-audit), requiring manual developer mediation.
  • Graphenium's Mechanism: Graphenium circumvents this integration barrier by programmatically injecting its behavioral rules directly into the agentic runtime. During installation (install.sh or install.ps1), Graphenium copies its standard system skill instruction set (skills/graphenium/SKILL.md) directly into Claude Code's native skill directory (~/.claude/skills/graphenium/SKILL.md).
  • This ensures that the moment the assistant handshakes with Graphenium, it ingests explicit, structured operating parameters on how to manage virtual workspaces and resolve topological violations, without requiring the developer to configure system prompts manually.

Language Support

Graphenium supports mixed repositories with Rust, Python, Go, JavaScript, TypeScript, Java, C, C++, and C#.

C# projects receive build-boundary awareness through .sln and .csproj parsing, enabling Graphenium to model assemblies, namespaces, and project references as structural boundaries.


MCP Setup

Integrate Graphenium directly into your agent's execution loop. For tools that spawn MCP from the project directory, use the scripts/graphenium-mcp launcher (rebuilds only when the index is missing, keeping startup instantaneous).

sh
install -m 755 scripts/graphenium-mcp ~/.local/bin/graphenium-mcp

Claude Code

sh
claude mcp add graphenium --scope user -- gm serve --graph /path/to/graphenium-out/graph.json --watch

Grok

Configure in ~/.grok/config.toml:

toml
[mcp_servers.graphenium]
command = "/Users/<you>/.local/bin/graphenium-mcp"
args = []
enabled = true

Cursor

Add to ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "graphenium": {
      "command": "gm",
      "args": ["serve", "--graph", "/path/to/graphenium-out/graph.json", "--watch"]
    }
  }
}

Detailed Documentation Map

Root

DocumentPurpose
AI_SETUP.mdStep-by-step assistant setup playbook.
CONTRIBUTING.mdContributor guidelines and module reference.
CHANGELOG.mdRelease history and milestone summary.
SECURITY.mdLocal-first security guarantees and vulnerability reporting.
MANIFEST.mdComplete package manifest indexing all documentation.

Core Documentation (docs/)

DocumentPurpose
docs/GETTING_STARTED.mdInstallation, initial codebase indexing, and MCP setup.
docs/AGENT_WORKFLOWS.mdContainment workflows: pre-flight, in-edit planning, and verification.
docs/CI_AND_GOVERNANCE.mdEnforcing architecture policies in CI pipelines.
docs/COMMAND_REFERENCE.mdComplete CLI syntax and configuration arguments.
docs/MCP_TOOLS.mdBehavior specifications for MCP clients.
docs/ARCHITECTURE.mdIndexing pipelines, C# project references, and Datalog evaluation.
docs/TRUST_MODEL.mdUnder-the-hood details of AST-proven vs heuristic confidence.
docs/BENCHMARKING.mdPerformance metrics: latency, token budgets, and scaling limits.
docs/COMPARISON.mdWhy Graphenium is distinct from grep, AST tools, and GraphRAG.
docs/POSITIONING.mdMarket positioning, target personas, and competitive differentiation.
docs/HARNESS_ADAPTER.mdEmbedding Graphenium's structural engine as a library.
docs/WORKED_EXAMPLES.mdCase studies proving containment on real repositories.
docs/GRAPH_REPORT.mdInterpreting the generated codebase audit report.
docs/DOCUMENTATION_MAP.mdFull documentation ecosystem overview.

Agent Integration

DocumentPurpose
skills/graphenium/SKILL.mdAgentic skill instructions and containment behavior rules.
contrib/harness-adapter/README.mdEmbedding Graphenium's engine inside AI coding harnesses.

Case Studies (worked/)

DocumentPurpose
worked/README.mdOverview of structural containment case studies.
worked/TEMPLATE.mdTemplate for documenting new codebase case studies.
worked/graphenium-self-analysis/README.mdGraphenium self-analysis: applying the containment engine to itself.
worked/graphenium-self-analysis/sample-queries.mdSample query output on Graphenium's own codebase.

Contact & Enterprise


License

MIT. See docs/LICENSE.md.

Εγκατάσταση

TypingMind
{
  "mcpServers": {
    "graphenium": {
      "command": "gm",
      "args": [
        "serve",
        "--graph",
        "/absolute/path/to/graphenium-out/graph.json"
      ]
    }
  }
}

Χρησιμοποιήστε το MCP Graphenium με πολλά μοντέλα AI

Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας. Έτσι, μόλις συνδεθεί το Graphenium, μπορείτε να το χρησιμοποιείτε με διαφορετικά μοντέλα AI στο TypingMind, αντί να το ρυθμίζετε ξεχωριστά για κάθε μοντέλο. Αυτή η ενσωμάτωση MCP εκτελείται τοπικά στη συσκευή σας μέσω του συνδέσμου MCP του TypingMind.

Οδηγός ρύθμισης για τη χρήση του τοπικού συνδέσμου

Επιλέξτε αυτή τη μέθοδο όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές ή ιδιωτικούς πόρους στον υπολογιστή σας.

1

Ανοίξτε τις ρυθμίσεις MCP

Στο TypingMind, μεταβείτε στις «Ρυθμίσεις», έπειτα στις «Σύνθετες ρυθμίσεις» και στο «Model Context Protocol» και επιλέξτε «Ρύθμιση συνδέσμου».

  1. Ανοίξτε το TypingMind στο πρόγραμμα περιήγησής σας.
  2. Κάντε κλικ στο εικονίδιο «Ρυθμίσεις».
  3. Μεταβείτε στις «Σύνθετες ρυθμίσεις».
  4. Ανοίξτε την ενότητα Model Context Protocol.
  5. Κάντε κλικ στην επιλογή «Ρύθμιση συνδέσμου» και επιλέξτε «Αυτή η συσκευή».
Οθόνη ρύθμισης συνδέσμου MCP του TypingMind με επιλεγμένη την επιλογή «Αυτή η συσκευή»
2

Εκτελέστε την εντολή του συνδέσμου

Επιλέξτε «Αυτή η συσκευή», αντιγράψτε την εντολή από το TypingMind και εκτελέστε την στο Τερματικό. Διατηρήστε τη διεργασία σε λειτουργία όσο χρησιμοποιείτε το MCP.

  1. Αντιγράψτε την εντολή ρύθμισης που εμφανίζεται στο TypingMind.
  2. Ανοίξτε το Τερματικό στο macOS ή το Windows Terminal στα Windows.
  3. Επικολλήστε και εκτελέστε την εντολή.
  4. Εγκρίνετε την εγκατάσταση του πακέτου, αν το Τερματικό σάς ζητήσει επιβεβαίωση για να συνεχίσει.
  5. Διατηρήστε ανοιχτό το παράθυρο του Τερματικού και τη διεργασία σε λειτουργία όσο χρησιμοποιείτε εργαλεία MCP.
3

Προσθέστε το Graphenium ως διακομιστή

Όταν η κατάσταση του συνδέσμου είναι «Έτοιμος», κάντε κλικ στο «Αλλαγή servers» και επικολλήστε τις ρυθμίσεις του διακομιστή MCP.

  1. Περιμένετε μέχρι η κατάσταση του συνδέσμου να εμφανιστεί ως «Έτοιμος».
  2. Κάντε κλικ στο «Αλλαγή servers».
  3. Επικολλήστε τις ρυθμίσεις του διακομιστή MCP Graphenium.
  4. Αποθηκεύστε τη λίστα διακομιστών.
  5. Κάντε ανανέωση αν θέλετε να επιβεβαιώσετε ότι ο σύνδεσμος παραμένει έτοιμος για χρήση.
Ρυθμίσεις MCP του TypingMind με ενεργό διακομιστή και το κουμπί «Αλλαγή servers»
{
  "mcpServers": {
    "graphenium": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Χρησιμοποιήστε τη σύνδεση με διαφορετικά μοντέλα

Αποθηκεύστε τη λίστα διακομιστών, ανοίξτε τα «Πρόσθετα», ενεργοποιήστε τα εργαλεία MCP του Graphenium και έπειτα επιλέξτε οποιοδήποτε υποστηριζόμενο μοντέλο AI στο TypingMind. Χρησιμοποιήστε τα εργαλεία στη συνομιλία ή αναθέστε τα σε έναν πράκτορα AI.

  1. Ανοίξτε τη σελίδα «Πρόσθετα» στο TypingMind.
  2. Ενεργοποιήστε τα εργαλεία MCP του Graphenium.
  3. Ξεκινήστε μια συνομιλία και επιλέξτε το μοντέλο AI που θέλετε να χρησιμοποιήσετε.
  4. Χρησιμοποιήστε τα εργαλεία MCP στη συνομιλία ή αντιστοιχίστε τα σε έναν πράκτορα AI.
  5. Μεταβείτε σε άλλο μοντέλο AI όποτε χρειάζεται, χωρίς να συνδέσετε ξανά το MCP.
Συνομιλία στο TypingMind με ενεργοποιημένα εργαλεία MCP και επιλεγμένο μοντέλο AI
Θα με βοηθήσετε σε αυτό μέσω Graphenium;
Graphenium
Βεβαίως. Το διάβασα.
Δείτε τι βρήκα μέσω του Graphenium.

Συχνές ερωτήσεις

Σε τι χρησιμεύει ο διακομιστής MCP Graphenium;

Το Graphenium είναι ένας διακομιστής MCP που επιτρέπει σε συμβατές εφαρμογές AI να συνδέονται με εξωτερικά εργαλεία και πληροφορίες πλαισίου. Στο TypingMind, μπορείτε να προσθέσετε αυτόν τον διακομιστή MCP μία φορά και να κάνετε τα εργαλεία του διαθέσιμα στον χώρο εργασίας AI σας.

Μπορώ να χρησιμοποιήσω το Graphenium MCP με πολλά μοντέλα AI στο TypingMind;

Ναι. Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας, ώστε να μπορείτε να χρησιμοποιείτε το Graphenium με διαφορετικά μοντέλα AI, όπως τα Claude, ChatGPT, Gemini ή άλλα μοντέλα που έχετε ρυθμίσει στο TypingMind, χωρίς να ρυθμίζετε τον διακομιστή MCP ξεχωριστά για κάθε μοντέλο.

Γιατί να χρησιμοποιήσετε τον σύνδεσμο MCP Graphenium με το TypingMind;

Το TypingMind είναι ένα από τα καλύτερα περιβάλλοντα συνομιλίας με μεγάλα γλωσσικά μοντέλα, καθώς συγκεντρώνει πολλά μοντέλα AI, προτροπές, πρόσθετα, πράκτορες AI, κλειδιά API και εργαλεία MCP σε έναν χώρο εργασίας. Συνδέοντας το Graphenium, μπορείτε να χρησιμοποιείτε τα εργαλεία MCP του με τα μοντέλα που προτιμάτε, διατηρώντας οργανωμένη τη ροή εργασίας των συνομιλιών σας στο TypingMind.

Πώς συνδέω το Graphenium MCP στο TypingMind;

Το Graphenium λειτουργεί μέσω του τοπικού συνδέσμου MCP του TypingMind. Αυτή είναι η καλύτερη επιλογή όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές υπολογιστή, εργαλεία γραμμής εντολών ή ιδιωτικούς πόρους στον υπολογιστή σας.

Ποια εργαλεία παρέχει το Graphenium MCP στο TypingMind;

Το Graphenium διαθέτει δυνατότητες MCP που μπορείτε να ενεργοποιήσετε από τη σελίδα Πρόσθετα του TypingMind και να χρησιμοποιήσετε σε συνομιλίες ή να αναθέσετε σε πράκτορες AI.

Χρειάζεται να κοινοποιήσω τα κλειδιά API μου στο TypingMind για να χρησιμοποιήσω το Graphenium MCP;

Όχι. Το TypingMind δίνει προτεραιότητα στην τοπική λειτουργία και σας επιτρέπει να διατηρείτε τον έλεγχο των παρόχων μοντέλων, των κλειδιών API, των προτροπών και των ρυθμίσεων MCP σας. Αν το Graphenium απαιτεί έλεγχο ταυτότητας, προσθέστε τις απαιτούμενες κεφαλίδες, τις ρυθμίσεις OAuth ή τις τοπικές ρυθμίσεις για τον συγκεκριμένο διακομιστή MCP κατά τη δημιουργία της σύνδεσης.

Σχετικοί διακομιστές MCP

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇