{
  "markdown": "<div align=\"center\">\n\n<img alt=\"GraQle — Query your architecture. Prove your AI's decisions.\" src=\"https://raw.githubusercontent.com/quantamixsol/graqle/master/assets/hero-dark-hq.png\" width=\"800\">\n\n# GraQle — query your architecture, prove your AI's decisions\n\n> Index any codebase as a knowledge graph so AI agents reason about **architecture** instead of grepping files. Every decision they make — at build-time or in production — gets a cryptographic receipt anchored to a public transparency log. One Python package, two surfaces: **dev intelligence** for engineers, **runtime governance** for regulators.\n\n[![PyPI](https://img.shields.io/pypi/v/graqle?color=%2306b6d4&label=PyPI)](https://pypi.org/project/graqle/)\n[![Python 3.10+](https://img.shields.io/badge/python-3.10+-06b6d4.svg)](https://python.org)\n[![LLM Backends](https://img.shields.io/badge/backends-14-06b6d4.svg)]()\n[![Model Agnostic](https://img.shields.io/badge/model-agnostic-06b6d4.svg)]()\n[![EU AI Act–aligned](https://img.shields.io/badge/EU%20AI%20Act-aligned-22c55e.svg)](./docs/compliance/eu-ai-act/)\n[![Patent-pending](https://img.shields.io/badge/patent-pending%20EP26167849.4-7c3aed.svg)](#patent--license)\n\n```bash\npip install graqle\n```\n\n[Website](https://graqle.com) · [Quickstart](#90-second-quickstart) · [Runtime governance](#run-time--attach-governance-to-a-deployed-ai-in-one-line) · [EU AI Act docs](./docs/compliance/eu-ai-act/) · [Changelog](./CHANGELOG.md) · [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=graqle.graqle-vscode)\n\n<!-- mcp-name: io.github.quantamixsol/graqle -->\n\n</div>\n\n---\n\n## Two surfaces, one substrate\n\n|  | **Build-time** (dev intelligence) | **Run-time** (production governance) |\n|---|---|---|\n| Governs | how your AI **writes code** | what your deployed AI **decides** |\n| Trigger | a code change | a production decision (loan, hiring, triage, …) |\n| Emits | reviewed, impact-analysed, audit-logged changes | a tamper-evident, third-party-verifiable record per decision |\n| Built on | typed code knowledge graph + multi-agent reasoning | Layer 5 cryptographic substrate (RFC 8785 JCS → RFC 6962 Merkle → ed25519 → Sigstore Rekor) |\n| Status | **GA** | **GA** — `attest()` capture (v0.60.0) + FastAPI middleware / `@governed` (v0.61.0) + continuous anchoring worker `graqle govern serve` (**v0.62.0**) |\n\n> **Build-time governance proves *we hold ourselves to this standard* — GraQle is developed through its own governance. Run-time governance lets you hold *your deployed AI* to the same cryptographically-verifiable standard. Same substrate, both surfaces.**\n\n---\n\n## 90-second quickstart\n\n### Build-time — query your codebase as a graph\n\n```bash\n# 1. Scan any codebase into a knowledge graph\ngraq scan repo .\n# → typed graph: functions, classes, modules, imports, calls — full architecture mapped in seconds\n\n# 2. Ask GraQle to audit it\ngraq run \"find every authentication bypass risk\"\n# → Graph-of-agents activates across relevant nodes\n# → Traces cross-file attack chains the LLM alone cannot see\n# → Returns: confidence score + evidence trail + active nodes + tool hints\n\n# 3. Fix it — GraQle shows exact before/after for each file (governed)\n\n# 4. Teach it back — the graph never forgets\ngraq learn \"cancel endpoint must require admin auth\"\n# → Lesson persists. Every future audit activates this rule.\n```\n\n### Run-time — attach governance to a deployed AI in one line\n\n```python\nfrom graqle.governance.runtime import GovernedRuntime\n\ngov = GovernedRuntime(salt=\"your-deploy-salt\")\n\ndef score_application(app):\n    decision = model.predict(app)                # your deployed AI, untouched\n    gov.attest(                                  # <-- the one added line\n        domain=\"loan\", model_id=\"credit-risk-v4\",\n        inputs={\"applicant_ref\": gov.pseudonymize_ref(app.id)},   # PII-safe\n        output={\"decision\": decision.label, \"reason_code\": decision.reason},\n    )\n    return decision\n```\n\nEach call produces a durable, PII-safe governed record. Its leaf hash is computed with the same shipped primitive the build-time batcher uses, so a runtime record is byte-compatible with the cryptographic substrate (RFC 8785 JCS → RFC 6962 Merkle → ed25519 → Sigstore Rekor). Capture is out-of-band — it adds **0 ms to your write path**.\n\nSee [`examples/runtime_attest_production_decisions.py`](./examples/runtime_attest_production_decisions.py) and [`examples/runtime_govern_serve_anchoring.py`](./examples/runtime_govern_serve_anchoring.py).\n\n### Run it as a continuous service (v0.62.0)\n\n```bash\n# Long-lived anchoring worker — flushes batches + drains the replay queue every tick\ngraqle govern serve --config graqle.yaml\n\n# Cron-style one-shot tick (single flush + single replay-drain)\ngraqle govern serve --once\n\n# Article-72-style monitoring snapshot — JSON suitable for any external monitor\ngraqle govern health\n# → { \"running\": true, \"ticks\": 47, \"records_anchored\": 3120, \"replay_queue_depth\": 0, ... }\n```\n\nThe serve loop writes `.graqle/govern.health.json` atomically after every tick — pipe it into your existing monitoring (Prometheus, Datadog, an oncall dashboard, a simple curl).\n\n> **Independently verifiable, by anyone.** Committed batches anchor to the public Sigstore Rekor transparency log. Any third party can verify a record — auditor, regulator, counter-party — **without access to your infrastructure, or ours.** Verification doesn't depend on Quantamix staying online.\n\n---\n\n## 💰 Token economics — a worked case study\n\nA 4-developer team on a 50,000-node enterprise codebase **burns ~$40 per developer per day** on flat-file AI-coding tokens in 2026. The same team using GraQle's substrate:\n\n| Scenario | Annual (4 devs) | Saving |\n|---|---|---|\n| Flat-file baseline (Cursor / Claude Code default) | **$42,240** | — |\n| GraQle + frontier API (Sonnet 4.6) | **$19,874** | **−53%** |\n| GraQle + local SLM (Year 2, 90% migrated) | **$5,174** | **−88%** |\n\nEvery number is auditable. Every assumption is sourced (Anthropic pricing, Cursor power-user data, Microsoft's killed Claude Code pilot, NCBI biomedical-KG research showing >50% token reduction, Qwen3-Coder SWE-Bench benchmarks). Scale linearly to a 40-developer enterprise: **~$224k/year saved in Year 1, ~$371k/year in Year 2**.\n\nPlus six things Cursor / Copilot / Codex do not offer at any subscription tier: cryptographic audit trail, EU AI Act Article 26 readiness (€15M fine exposure), patent-defensible substrate, survive-vendor-disappearance, multi-agent governance, public Sigstore Rekor anchoring.\n\n→ **[Read the full case study](./docs/case-study-token-economics.md)** — math, sources, and a `bash` snippet to re-run it on your own team's numbers.\n\n---\n\n## What is GraQle\n\nA **governance-led multi-agent reasoning system for code**, with a built-in cryptographic audit substrate for the AI you ship to production. Scan any codebase into a persistent knowledge graph. Every module becomes a reasoning agent. Agents decompose, debate, and synthesize answers with clearance-level governance. Every change — and every production decision — is impact-analysed, gate-checked, and cryptographically committed.\n\n> *AI assistants see files. GraQle sees architecture. That's why it catches the cross-file bugs they can't, and why its audit trail survives every level of tampering.*\n\n**Built for engineering teams who need:**\n\n- **Cross-file reasoning** — impact analysis, lesson recall, dependency-aware refactor (the kind of thing that requires reading 5 files; we read the graph instead).\n- **Auditable AI decisions** — confidence scores, evidence trails, tamper-evident logs anchored to a public transparency log.\n- **EU AI Act–aligned behaviour out of the box** — for European customers, regulated deployments, and analyst-grade due diligence.\n- **Model-agnostic operation** — 14 LLM backends, offline-capable via Ollama, runs entirely on your machine by default. No telemetry. Code stays on your machine.\n\n---\n\n## How it works\n\n1. **Scan** → AST + dependency analysis builds a typed graph (functions, classes, modules, imports, calls).\n2. **Activate** → A pre-reasoning safety layer scores each node for relevance, confidence, and risk **before** the LLM runs.\n3. **Reason** → Multiple agents debate. Outputs carry `confidence`, `graph_health`, `active_nodes`, evidence pointers.\n4. **Gate** → Governance gates (CG-01..CG-20) intercept write-class operations. Plans required. Risks surfaced. Trade-secret + path-traversal hardening enforced.\n5. **Audit** → Every tool call is logged to `.graqle/governance/audit/` with redaction + secret scanning.\n6. **Commit** → For runtime decisions, the audit record gets canonicalised (RFC 8785), Merkle-rooted (RFC 6962), ed25519-signed, and anchored to the public Sigstore Rekor log.\n7. **Learn** → Lessons become weighted edges. The graph remembers across sessions, teams, and git operations.\n\nThe pipeline runs through five named phases — **ANCHOR → ACTIVATE → GENERATE → VALIDATE → COMMIT**. Each phase is governance-gated, evidence-attached, and audit-logged.\n\nAPI defaults: `confidence_threshold=0.65` (refusal floor), `gate_threshold=0.60` (gate-status floor). Both are configurable per-call.\n\n---\n\n## Model agnostic\n\nAnthropic · OpenAI · AWS Bedrock · Ollama · Gemini · Groq · DeepSeek · Together · Mistral · OpenRouter · Fireworks · Cohere · Azure OpenAI · custom HTTP.\n\n```yaml\n# graqle.yaml — smart task routing\nbackends:\n  reasoning:  anthropic/claude-sonnet-4-6   # quality work\n  embedding:  bedrock/titan-v2              # cheap + fast\n  summaries:  ollama/llama3                 # local + free\n```\n\nRuns **fully offline** with Ollama. No telemetry. Code stays on your machine. API keys stay in your local `graqle.yaml`.\n\n---\n\n## Governance gate — drop-in for Claude Code, Cursor, VS Code\n\n```bash\ngraq init              # sets up a governed project (writes the constitution → CLAUDE.md)\ngraq gate-install      # one-time, project-local — enforce it for Claude Code\n```\n\n**`graq init` writes the GraQle constitution into your project**, so your AI tool\nbehaves like a disciplined senior engineer from the very first command: governed\ntools only (every change is checked), a defined *investigate → plan → review →\napply → learn* workflow, built-in token-cost rules, and the project's known\npitfalls baked in. One rulebook — shipped as\n[`graqle/data/constitution/`](./graqle/data/constitution/) — renders for every\nclient (Claude Code → `CLAUDE.md`, OpenAI Codex → `AGENTS.md`, Cursor →\n`.cursorrules`, Windsurf → `.windsurfrules`), so editing it once keeps them all\nin sync.\n\n`gate-install` then routes every native write/edit/bash through GraQle's governance gates and adds a `permissions` backstop to `.claude/settings.json`. Plans required for risky changes. Trade-secret scanning on git commits. Path-traversal hardening on subprocess capture. CG-01 through CG-20 — all on, all auditable.\n\n→ [Governance Gate spec](./docs/governance-gate.md)\n\n---\n\n## MCP-first\n\n```jsonc\n// .mcp/config.json\n{ \"graqle\": { \"command\": \"graq\", \"args\": [\"mcp\", \"serve\"] } }\n```\n\n**76+ MCP tools** — every operation Claude Code / Cursor / VS Code Copilot needs is exposed as a governed tool with confidence scores, evidence pointers, and audit-trail entries. No prompt engineering, no glue code.\n\n---\n\n## 🇪🇺 EU AI Act–aligned\n\n**Articles 6, 9, 12, 13, 14, 15, 25, 50 become applicable on 2026-08-02.** GraQle gives your high-risk AI system the signals, audit trail, and disclosure primitives it needs — so the parts of your compliance file you can quote from us, you can quote *today*.\n\n```bash\n# One switch flips every EU-AI-Act-aware subsystem at once\ngraq compliance switch on        # shell snippet → eval to enable\ngraq compliance switch status    # what's actually armed, in one envelope\ngraq compliance switch off       # symmetric disable\n\n# Per-subsystem CLI surface\ngraq compliance status                                      # legacy + new subsystems block\ngraq compliance export --since 2026-08-01 --sha256-sidecar  # Article 12 evidence\ngraq compliance baseline-doc generate --output baseline.jsonl  # Q16.1 baseline\ngraq compliance periodic-assessment run --period-start ... --period-end ...  # Q16.3\ngraq compliance feedback record --rating 5 --note \"...\"     # Q16.5 observation\ngraq compliance eur-lex-check                               # weekly drift guard\n```\n\n| Article | What GraQle provides | Where |\n|---|---|---|\n| **Art 4** — AI literacy | Integration guidance for providers + deployers | [Art 4 doc](./docs/compliance/eu-ai-act/article-04-ai-literacy.md) |\n| **Art 9** — Risk management | Periodic-assessment artefacts with auto-remediation triggers | `graq compliance periodic-assessment run` |\n| **Art 11** — Technical documentation | Dated, content-addressed baseline document at deployment | `graq compliance baseline-doc generate` |\n| **Art 12** — Record-keeping | JSONL audit export + SHA-256 tamper-detection sidecar | `graq compliance export` |\n| **Art 13** — Deployer transparency | `graph_health` + `confidence` on every reasoning envelope | every `graq_reason` call |\n| **Art 14** — Human oversight | **Confidence-gated refusal** of auto-apply + claim-limits vocabulary | `GRAQLE_EU_AI_ACT_MODE=on` + `graq edit/apply/auto` |\n| **Art 15** — Accuracy / robustness / cybersecurity | 17 named defences + 7 measurable claims | `graq compliance status --include-robustness` |\n| **Art 25** — Value-chain responsibility | Intended-purpose declarations + PCT (Proof-Claims Token) `x-ai-eu` extension (11 fields) | [Art 25 doc](./docs/compliance/eu-ai-act/article-25-value-chain.md) + `graq pct issue/validate` |\n| **Art 43** — Conformity assessment | Substrate evidence inputs (baseline-doc + audit log + periodic assessment + robustness + Article 14 gate) for the *deployer's* Annex VI internal-control file | [Art 43 doc](./docs/compliance/eu-ai-act/article-43-conformity-assessment.md) |\n| **Art 50** — Transparency for users | Auto banner + `ai_disclosure` machine field | `GRAQLE_EU_AI_ACT_MODE=on` |\n| **Art 72** — Post-market monitoring | `graqle govern serve` continuous anchoring + `graqle govern health` snapshot | **v0.62.0** |\n\n**Three substantive non-claims kept legally clean:**\n\n- GraQle is **NOT** itself a high-risk AI system (no Annex III category applies).\n- GraQle is **NOT** a GPAI provider under Article 51 (we use third-party LLMs, we don't place one on the EU market).\n- We **provide signals, audit primitives, and conformity-assessment evidence inputs**. We never say *compliant* or *certified*. The discipline is enforced in code — `TestNonClaimsInvariants` blocks any release that introduces a `compliant`/`certified` field.\n\n→ **[Full Article-by-Article mapping in docs/compliance/eu-ai-act/](./docs/compliance/eu-ai-act/)**\n\n### Contributions welcome on the compliance docs\n\nThe EU AI Act docs are deliberately open to contribution — **corrections, translations (DE/FR/ES/IT have highest demand), compliance gap reports from deployers building Annex VI internal-control files, and cross-framework mappings (NIST AI RMF, ISO 42001, ENISA, etc.) are all welcome.** See [CONTRIBUTING-COMPLIANCE.md](./CONTRIBUTING-COMPLIANCE.md) for the contribution guide, the vocabulary discipline the CI enforces, and what kinds of changes go through which review path.\n\n---\n\n## Security & integrity\n\n| | |\n|---|---|\n| **No telemetry** | GraQle does not phone home, collect usage data, or send analytics. |\n| **No code upload** | Source never leaves your machine unless you opt in to cloud sync. |\n| **Secret scanning** | 200+ regex patterns + Shannon-entropy detection + AST scan on every output candidate. |\n| **PyPI Trusted Publishing** | OIDC-only — no long-lived API tokens in our pipeline. |\n| **Sigstore signatures** | Every wheel signed by our GitHub Actions identity. Verify with `graq trustctl verify --version <v>`. |\n| **CycloneDX SBOM** | Attached to every GitHub Release. |\n| **`.pth`-file guard** | Publish pipeline rejects any wheel containing `.pth` files (the LiteLLM-class attack vector). |\n| **Reproducible builds** | `SOURCE_DATE_EPOCH`-pinned, rebuild from tagged source and compare checksums. |\n| **Survive-disappearance** | Production audit records anchor to public Sigstore Rekor — verifiable even if Quantamix disappears. |\n\n→ Full disclosure policy: [SECURITY.md](./SECURITY.md) · Report vulnerabilities to **security@quantamixsolutions.com**\n\n---\n\n## What's new in v0.75.0\n\n**The EU AI Act layer is complete.** GraQle now offers an optional, configurable\nEU AI Act (Reg. (EU) 2024/1689) compliance layer — **off by default**, enforced\nthrough a tamper-evident, irreversible latch.\n\n- **Configurable + irreversible latch** (`governance.eu_ai_act` in `graqle.yaml`):\n  once enabled, the layer cannot be silently disabled and `blocking` cannot be\n  downgraded to `advisory`. The latch is an **ed25519-signed, hash-chained**\n  record (`.graqle/eu_ai_act_latch.jsonl`) — not a hand-editable flag — so a\n  tamper attempt fails closed and can never turn it off.\n- **Enforced compliance phase (CG-EU-AIA)** wired into the gate: when enabled,\n  AIA-relevant **write** tools pass an Article-14 human-oversight check.\n  `blocking` + low confidence → refused with an **audited per-action override**\n  path; `advisory` → recorded + advised, never blocked. **Reads, planning, and\n  reasoning are never gated.**\n- **Light-touch + honest by design** — a record-keeping / traceability **aid**\n  (supports Art. 12 / 72), not a hard wall, and not a substitute for human\n  compliance judgement. The latch *supports* the Act's expectations; it is **not\n  \"required by the Act.\"**\n\nThis completes GraQle's universal-governance arc (constitution-as-code →\nevery client → universal server gate → cost-is-observability → EU AI Act layer).\n\n→ [Full v0.75.0 changelog](./CHANGELOG.md)\n\n---\n\n## What's new in v0.73.0\n\n**Cost is observability, never a quality gate.** GraQle never cuts reasoning or\ndebate quality to save money. Every cost path is now **advisory**: it measures\nand surfaces spend (the cost-savings story) but never halts still-valuable work.\n\n- **Reasoning** continues past budget to natural convergence / `max_rounds`; the\n  cost of continuing is measured (`continuation_cost_usd` in result metadata).\n- **Multi-backend debate** no longer stops on budget — it runs to `max_rounds`\n  and reports over-budget rounds instead.\n- **Advisory per-session cost meter** in the MCP server surfaces `session_cost_usd`\n  and a one-time over-budget note — purely observational, never blocks a tool,\n  and hardened against malformed cost values.\n- Runaway protection stays value-based (`max_rounds` + the absolute LLM-call\n  ceiling), never price-based.\n\n→ [Full v0.73.0 changelog](./CHANGELOG.md)\n\n---\n\n## What's new in v0.72.0\n\n**One constitution, every AI client.** The governance rulebook now renders into\nevery supported client from a single source — including **OpenAI Codex** via\n`AGENTS.md`, which previously had no instruction file. Run `graq init` and your\nAI tool pair-programs with a disciplined senior engineer from the first command,\nwhichever tool you use.\n\n- **The constitution** ([`graqle/data/constitution/`](./graqle/data/constitution/)) — governed-tools-only rules, the 9-phase workflow, the full MCP tool inventory, token-cost rules, learned-behaviour workarounds, and a configurable (off-by-default) EU AI Act section. Modular Markdown; edit once, every client stays in sync.\n- **Per-client rendering:** Claude Code → `CLAUDE.md`, **OpenAI Codex → `AGENTS.md`** (new), Cursor → `.cursorrules`, Windsurf → `.windsurfrules`. Append-under-marker and idempotent — an existing file is never clobbered.\n- **`graq gate-install`** adds a non-destructive `permissions` backstop to `.claude/settings.json` (deny native write/exec, allow the governed `graq_*` tools) behind the existing PreToolUse hook.\n\n→ [Full v0.72.0 changelog](./CHANGELOG.md)\n\n---\n\n## Recent releases\n\n- **v0.62.0** — Runtime R2: `graqle govern serve` continuous anchoring worker + `govern health` Article-72 monitoring snapshot.\n- **v0.61.0** — Runtime R1: FastAPI middleware + `@governed` decorator. Drop-in governance for any FastAPI app.\n- **v0.60.0** — Runtime R0 Mode A: `GovernedRuntime.attest()` and PII-safe `pseudonymize_ref()`.\n- **v0.59.0** — Layer 5 cryptographic substrate GA: RFC 8785 canonicalisation + RFC 6962 Merkle commitments + ed25519 signatures + Sigstore Rekor anchoring + local replay queue.\n- **v0.58.0** — EU AI Act Wave 3 substrate (Article 43 conformity-assessment evidence) + OPSF PCT alignment + `GRAQLE_WORKTREE_ROOT` for parallel-worktree dev.\n- **v0.57.0** — EU AI Act Wave 2: `graq compliance switch` single entry-point, Article 14 confidence-gated refusal, claim-limits vocabulary, EUR-Lex drift guard.\n\n→ [Full changelog](./CHANGELOG.md)\n\n---\n\n## Pricing\n\n| Tier | What you get |\n|---|---|\n| **Free** | Local-only graphs · core SDK · governance gates · EU AI Act surfaces · `attest()` runtime · `govern serve` anchoring (self-hosted, anchored to public Rekor) |\n| **Pro — $19/mo** | Cloud sync · priority models · hosted Rekor relay |\n| **Team — $29/dev/mo** | Shared KGs · team-wide lessons · audit log retention · SOC 2 evidence pack |\n| **Enterprise** | On-prem · custom backends · dedicated support · regulated-deployment SLAs · [contact us](mailto:sales@quantamixsolutions.com) |\n\nThe free tier is real: the verifier, the runtime attestation path, and the continuous anchoring worker are all in the open-source SDK. Paid tiers add operational scale, team features, and a managed Rekor relay.\n\n---\n\n## Patent & license\n\nCore methods are patent-pending: **EP26167849.4** (filed 2026-03-25), **EP26162901.8** (CIP), and **EP26166054.2** (CogniGraph divisional). The SDK source is fully auditable under the GraQle License — see [LICENSE](./LICENSE). Reimplementation of the patented methods outside this SDK requires a separate patent license.\n\n→ [github.com/quantamixsol/graqle](https://github.com/quantamixsol/graqle) — issues, discussions, contributions welcome.\n\n---\n\n<div align=\"center\">\n\n**GraQle is built by [Quantamix Solutions](https://quantamixsolutions.com).**\n*Query your architecture. Prove your AI's decisions.*\n\n</div>\n",
  "bytes": 22172,
  "sha": "1e8769b7170a3508a7a959fed8d9e9e379827dba6d49bffe55de5d7b6b052dfa",
  "repo_slug": "quantamixsol/graqle",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_graqle_graqle_2fa87353/readme"
}