Skip to main content

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

Project description

Cruxible

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.

┌──────────────────────────────────────────────────────────────┐
│  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:

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:

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

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):

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

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

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

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

Try a demo

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 alone With Cruxible
Relationships shift depending on how you ask Explicit knowledge graph you can inspect
No structured memory between sessions Persistent entity store across runs
Results vary between identical prompts Deterministic execution, same input → same output
No audit trail DAG-based receipt for every decision
Constraints checked by vibes Declared constraints programmatically validated before results
Discovers relationships only through LLM reasoning Deterministic candidate detection finds missing relationships at scale — LLM assists where judgment is needed
Learns nothing from outcomes Feedback 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

Demo Domain What it demonstrates
sanctions-screening Fintech / RegTech OFAC screening with beneficial ownership chain traversal.
drug-interactions Healthcare Multi-drug interaction checking with CYP450 enzyme data.
mitre-attack Cybersecurity Threat 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cruxible_core-0.1.3.tar.gz (388.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cruxible_core-0.1.3-py3-none-any.whl (88.2 kB view details)

Uploaded Python 3

File details

Details for the file cruxible_core-0.1.3.tar.gz.

File metadata

  • Download URL: cruxible_core-0.1.3.tar.gz
  • Upload date:
  • Size: 388.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cruxible_core-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c2a83a70aae808a3e8c1d18e9bb9ca315e4f7f14b3512de7e779dfc8742394c1
MD5 3cecf94f6e7c77d17175ce5288addeb7
BLAKE2b-256 c5503a4b1573e62230e45eddcaa7c86f927cf9f2deb5efa6429366be857efc4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruxible_core-0.1.3.tar.gz:

Publisher: publish.yml on cruxible-ai/cruxible-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cruxible_core-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cruxible_core-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 88.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cruxible_core-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e844c4a53f56c43de8cf0fb0c44e5575a6ac5a48516ba8e7abeae82a9f21d0c0
MD5 587933274e570ef932e89ff5518acc77
BLAKE2b-256 15d7b7416be9213e5462a4f0b0857f2576ba70532290754c00fef5baa2704865

See more details on using hashes here.

Provenance

The following attestation bundles were made for cruxible_core-0.1.3-py3-none-any.whl:

Publisher: publish.yml on cruxible-ai/cruxible-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page