Skip to main content

MRS-Core: A deterministic modular reasoning engine.

Project description

Modular Reasoning System (MRS-Core)

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

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

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

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


Why MRS-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

MRS-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

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

MRS is a reasoning substrate.


Features

Deterministic Reasoning Chains

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

Transparent Logs & History

MRS 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 mrs-core

Quick Start

from mrs.engine import MRSCoreEngine
from mrs.presets import get_preset

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

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

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

Example Output

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

[EVAL CHARS=95 WORDS=14]

PHASE: rewrite

Running a Manual Operator Chain

from mrs.engine import MRSCoreEngine

engine = MRSCoreEngine()

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

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

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

Using Presets

MRS-Core includes preset chains:

  • simple
  • reasoning
  • full_chain
from mrs.engine import MRSCoreEngine
from mrs.presets import get_preset

engine = MRSCoreEngine()

for name in ["simple", "reasoning", "full_chain"]:
    ops = get_preset(name)
    result = engine.run_chain(ops, "MRS-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

mrs-core/
    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 MRS-Core Is Not

MRS-Core is NOT:

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

MRS-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 System (MRS-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

mrs_core-0.1.2.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

mrs_core-0.1.2-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file mrs_core-0.1.2.tar.gz.

File metadata

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

File hashes

Hashes for mrs_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c36e78c92a5924c0b1c6466505adc11662ac0ac82b570178ef993c4a7249a957
MD5 8853f32f2c663c524dc602c9e3393127
BLAKE2b-256 de3303d48afdb28fb34273f45863d58ade2e511f457c978ad188d9c8ee77a0a1

See more details on using hashes here.

File details

Details for the file mrs_core-0.1.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for mrs_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd3c876d74cea8b02f968c619e4d8792930b2f9fe4f0c8c2ee585bdf0c5b906a
MD5 d6b6dbd7affb2d352906d5899ca0ad3d
BLAKE2b-256 e98b79a670f4136e7db106113db3b7ffa5d2f0bbcb6ed50c3504200d0fcb8eb3

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