io.github.cruxible-ai/cruxible-core

编码与调试

by cruxible-ai

具备 receipts 的确定性决策引擎:用 YAML 定义规则、查询图谱并返回可验证 proof。

什么是 io.github.cruxible-ai/cruxible-core

具备 receipts 的确定性决策引擎:用 YAML 定义规则、查询图谱并返回可验证 proof。

README

<p align="center"> <a href="https://cruxible.ai"> <img src="assets/cruxible_logo.png" alt="Cruxible" width="400"> </a> </p>

Cruxible Core

PyPI version Python 3.11+ License: MIT

Deterministic decision engine with DAG-based receipts. Build entity graphs, query with MCP, get auditable proof.

Define entity graphs, queries, and constraints in YAML. Run them locally from CLI or MCP, and get receipts proving exactly why each result was returned.

code
┌──────────────────────────────────────────────────────────────┐
│  AI Agent (Claude Code, Cursor, Codex, ...)                  │
│  Writes configs, orchestrates workflows                      │
└──────────────────────┬───────────────────────────────────────┘
                       │ calls
┌──────────────────────▼───────────────────────────────────────┐
│  MCP Tools                                                   │
│  init · validate · ingest · query · feedback · evaluate ...  │
└──────────────────────┬───────────────────────────────────────┘
                       │ executes
┌──────────────────────▼───────────────────────────────────────┐
│  Cruxible Core                                               │
│  Deterministic. No LLM. No opinions. No API keys.            │
│  Config → Graph → Query → Receipt → Feedback                 │
└──────────────────────────────────────────────────────────────┘

Quick Example

1. Define a domain in YAML:

yaml
entity_types:
  Drug:
    properties:
      drug_id: { type: string, primary_key: true }
      name:    { type: string }
  Enzyme:
    properties:
      enzyme_id: { type: string, primary_key: true }
      name:      { type: string }

relationships:
  - name: same_class
    from: Drug
    to: Drug
  - name: metabolized_by
    from: Drug
    to: Enzyme

named_queries:
  suggest_alternative:
    entry_point: Drug
    returns: Drug
    traversal:
      - relationship: same_class
        direction: both
      - relationship: metabolized_by
        direction: outgoing

2. Load data and run a deterministic query:

"Suggest an alternative to simvastatin"

3. Get a receipt — structured proof of every answer:

Raw receipt DAG rendered for readability:

code
Receipt RCP-17b864830ada

Query: suggest_alternative for simvastatin

Step 1: Entry point lookup
  simvastatin -> found in graph

Step 2: Traverse same_class (both directions)
  Found 6 statins in the same therapeutic class:
  n3  atorvastatin   n4  rosuvastatin   n5  lovastatin
  n6  pravastatin    n7  fluvastatin    n8  pitavastatin

Step 3: Traverse metabolized_by (outgoing) for each alternative
  n9   atorvastatin -> CYP3A4   (CYP450 dataset)
  n10  rosuvastatin -> CYP2C9   (CYP450 dataset, human approved)
  n11  rosuvastatin -> CYP2C19  (CYP450 dataset)
  n12  lovastatin -> CYP2C19    (CYP450 dataset)
  n13  lovastatin -> CYP3A4     (CYP450 dataset)
  n14  pravastatin -> CYP3A4    (CYP450 dataset)
  n15  fluvastatin -> CYP2C9    (CYP450 dataset)
  n16  fluvastatin -> CYP2D6    (CYP450 dataset)
  n17  pitavastatin -> CYP2C9   (CYP450 dataset)

Results: atorvastatin, rosuvastatin, lovastatin, pravastatin, fluvastatin, pitavastatin
Duration: 0.41ms | 2 traversal steps

Get Started

bash
pip install "cruxible-core[mcp]"

Or use uv tool install "cruxible-core[mcp]" if you prefer uv.

Add the MCP server to your AI agent:

Claude Code / Cursor (project .mcp.json or ~/.claude.json / .cursor/mcp.json):

json
{
  "mcpServers": {
    "cruxible": {
      "command": "cruxible-mcp",
      "env": {
        "CRUXIBLE_MODE": "admin"
      }
    }
  }
}

Codex (~/.codex/config.toml):

toml
[mcp_servers.cruxible]
command = "cruxible-mcp"

[mcp_servers.cruxible.env]
CRUXIBLE_MODE = "admin"

Try a demo

bash
git clone https://github.com/cruxible-ai/cruxible-core
cd cruxible-core/demos/drug-interactions

Each demo is a starter kit with a config, prebuilt graph, example queries, and receipts. If you're new, start with drug-interactions.

First, load the instance:

"You have access to the cruxible MCP, load the cruxible instance"

Then try:

  • "Check interactions for warfarin"
  • "What's the enzyme impact of fluoxetine?"
  • "Suggest an alternative to simvastatin"

Every query produces a receipt you can inspect.

Why Not Just Write Code?

Cruxible is useful when the same decision logic needs to be reviewed, replayed, adapted, and trusted over time. It gives you:

  • A declarative spec surface in YAML
  • Deterministic execution over entity graphs
  • Receipts proving why a result was returned
  • Constraints, evaluation, and feedback without rebuilding custom infrastructure

The same way Terraform replaced hand-rolled infrastructure scripts with plans, state, and diffs, Cruxible replaces ad-hoc decision code with declarative configs, deterministic execution, and auditable receipts.

Why Cruxible

LLM agents aloneWith Cruxible
Relationships shift depending on how you askExplicit knowledge graph you can inspect
No structured memory between sessionsPersistent entity store across runs
Results vary between identical promptsDeterministic execution, same input → same output
No audit trailDAG-based receipt for every decision
Constraints checked by vibesDeclared constraints programmatically validated before results
Discovers relationships only through LLM reasoningDeterministic candidate detection finds missing relationships at scale — LLM assists where judgment is needed
Learns nothing from outcomesFeedback loop calibrates edge weights over time

Features

  • Receipt-based provenance: every query produces a DAG-structured proof showing exactly how the answer was derived.
  • Constraint system: define validation rules that are checked by evaluate. Feedback patterns can be encoded as constraints.
  • Feedback loop: approve, reject, correct, or flag individual edges. Rejected edges are excluded from future queries.
  • Candidate detection: property matching and shared-neighbor strategies for discovering missing relationships at scale.
  • YAML-driven config: define entity types, relationships, queries, constraints, and ingestion mappings in one file.
  • Zero LLM dependencies: purely deterministic runtime. No API keys, no token costs during execution.
  • Full MCP server: complete lifecycle via Model Context Protocol for AI agent orchestration.
  • CLI mirror: core MCP tools have CLI equivalents for terminal workflows.
  • Permission modes: READ_ONLY, GRAPH_WRITE, ADMIN tiers control what tools a session can access.

Demos

DemoDomainWhat it demonstrates
sanctions-screeningFintech / RegTechOFAC screening with beneficial ownership chain traversal.
drug-interactionsHealthcareMulti-drug interaction checking with CYP450 enzyme data.
mitre-attackCybersecurityThreat modeling with ATT&CK technique and group analysis.

Documentation

Technology

Built on Pydantic (validation), NetworkX (graph), Polars (data ops), SQLite (persistence), and FastMCP (MCP server).

Cruxible Cloud: Managed deployment with expert support. Coming soon.

License

MIT

<!-- mcp-name: io.github.cruxible-ai/cruxible-core -->

常见问题

io.github.cruxible-ai/cruxible-core 是什么?

具备 receipts 的确定性决策引擎:用 YAML 定义规则、查询图谱并返回可验证 proof。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描111.8k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描111.8k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描111.8k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.8k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论