Skip to main content

MRF-Core: A deterministic operator-based reasoning engine for autonomous agents.

Project description

Modular Reasoning Framework (MRF-Core)

A deterministic, operator-based reasoning engine for LLMs and autonomous agents.

MRF-Core provides a transparent, modular, reproducible reasoning substrate built from a small set of reusable operators:

  • Transform
  • Reflect
  • Evaluate
  • Rewrite
  • Summarize
  • Inspect
  • Filter

MRF makes reasoning traceable, auditable, and deterministic—without requiring chain-of-thought exposure or hidden model internals.


Why MRF-Core Exists

Every agent framework today suffers from the same structural failures:

  • No consistent reasoning sequence
  • No deterministic backbone
  • No visibility into intermediate states
  • No enforceable phases or operator logic

MRF-Core solves this by introducing:

  • Explicit operator-level reasoning
  • Strict phase transition model
  • Complete execution trace
  • Deterministic, reproducible outputs
  • Plug-and-play integration for ANY agent system

MRF is not an alignment system.
MRF is not a sandbox.

MRF is a reasoning substrate.


Features

Deterministic Reasoning Chains

  • Operators execute in strict order.
  • Output is repeatable.

Transparent Logs & History

MRF records:

  • final text
  • operator log
  • phase trace
  • structured history of every step

Simple, Extensible Operators

  • Each operator is a small Python class registered via the Operator Registry.

Drop-In Presets

simple, reasoning, full_chain ready for production use.


Install

pip install mrf-core

Quick Start

from mrfcore.engine import MRFCoreEngine
from mrfcore.presets import get_preset

engine = MRFCoreEngine()
ops = get_preset("reasoning")

result = engine.run_chain(ops, "MRF-Core is a modular deterministic reasoning pipeline.")

print(result["text"])
print(result["log"])
print(result["phase"])

Example Output

[REFLECT] [TRANSFORM]
MRF-CORE IS A MODULAR DETERMINISTIC REASONING PIPELINE.

[EVAL CHARS=95 WORDS=14]

PHASE: rewrite

Running a Manual Operator Chain

from mrfcore.engine import MRFCoreEngine

engine = MRFCoreEngine()

ops = [
    ("transform", {}),
    ("reflect", {}),
    ("evaluate", {}),
    ("rewrite", {}),
]

result = engine.run_chain(ops, "Explain symbolic reasoning.")

print(result["text"])
print(result["history"])

Using Presets

MRF-Core includes preset chains:

  • simple
  • reasoning
  • full_chain
from mrfcore.engine import MRFCoreEngine
from mrfcore.presets import get_preset

engine = MRFCoreEngine()

for name in ["simple", "reasoning", "full_chain"]:
    ops = get_preset(name)
    result = engine.run_chain(ops, "MRF-Core preset test")
    print(f"=== {name.upper()} ===")
    print(result["text"])

Operator Anatomy

Every operator:

  • receives the current ReasoningState
  • modifies state.text
  • appends to state.log
  • updates state.phase
  • records an entry in state.history

Example:

@register_operator("reflect")
class ReflectOperator(Operator):
    phase = ("transform", "reflect")

    def run(self, state):
        state.text = f"[REFLECT] {state.text}"
        state.log.append("Reflect applied")
        return state

Project Structure

mrfcore/
    engine.py
    registry.py
    state.py
    presets.py
    exceptions.py
    operators/
        base.py
        transform.py
        reflect.py
        evaluate.py
        rewrite.py
        summarize.py
        inspect.py
        filter.py
tests/
examples/

What MRF-Core Is Not

MRF-Core is NOT:

  • an alignment system
  • a safety guarantee
  • a sandbox
  • a replacement for secure execution layers

MRF-Core IS:

  • a deterministic reasoning layer
  • an operator execution engine
  • an audit-friendly cognition scaffold
  • a missing substrate for agent stability

Contributing

PRs welcome, especially new operators, presets, or diagnostics.


License

Apache 2.0 (see LICENSE file).

Copyright 2026
Ryan Sabouhi


Notice

This software contains original work developed as part of the
Modular Reasoning Framework (MRF-Core) by Ryan Sabouhi.
See the NOTICE file for attribution details.

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

mrf_core-0.2.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

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

mrf_core-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file mrf_core-0.2.0.tar.gz.

File metadata

  • Download URL: mrf_core-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mrf_core-0.2.0.tar.gz
Algorithm Hash digest
SHA256 14a8e1776245bdbdc687ffd24ebba5b9b0e0ba5fd11edbb0210f2f7208e637de
MD5 9f632a54029be9694e1d224f40ff97e0
BLAKE2b-256 7dfccb3cec322315a49bd7ee032ddf81fa4df0c24b9a5182326c020776198b45

See more details on using hashes here.

File details

Details for the file mrf_core-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mrf_core-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mrf_core-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f50aa4bb8c3e153eb9070ddb81ebdfbfbbc32f537ae7e5dd31f10d906e35aba7
MD5 2cf3e87a96e828d81dc77243b313224b
BLAKE2b-256 f55f1c96b777a79d52b00a55c3e9b353228e8696229df3ff5ace25cbe275ad76

See more details on using hashes here.

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