Skip to main content

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 presets included for immediate use and extension.


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

FINAL TEXT:
[REFLECT] [TRANSFORM] THIS IS A TEST OF MRS-CORE.
[EVAL CHARS=49 WORDS=8]

LOG:
- Transform applied
- [PHASE] start → transform
- Reflect applied
- [PHASE] transform → reflect
- Evaluate applied
- [PHASE] reflect → evaluate
- Rewrite applied
- [PHASE] evaluate → 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"])

Note: Presets are example chains, not semantic models. Operators are deterministic components; their meaning depends on the chain design. full_chain is intentionally simple and does not represent a cognitive process.


Operator Anatomy

Every operator:

  • receives the current ReasoningState
  • modifies state.text
  • appends to state.log
  • engine updates state.phase automatically based on the operator's phase transition rules
  • records an entry in state.history

Example:

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

    def run(self, state, **kwags):
        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.

Metadata

Release files for mrs-core 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mrs-core 0.1.4
File Size Uploaded Provenance
mrs_core-0.1.4.tar.gz 13.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mrs-core 0.1.4
File Interpreter ABI Platform
mrs_core-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / mrs_core-0.1.4.tar.gz

Download URL mrs_core-0.1.4.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c46aa140e611d933b0e5e29dbb2842dd39943588764180e131daa0dc7ba22e6f
BLAKE2b-256 checksum
How to use checksums
bba20299dac6d8771d8a914f0ce6deb5568e511c09df63dd5c0d1bdd24f9adb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / mrs_core-0.1.4-py3-none-any.whl

Download URL mrs_core-0.1.4-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
262805d97e6367c8aad114fef839814f6d5410d4235389d52408d0d88b765e65
BLAKE2b-256 checksum
How to use checksums
21a59d51e9091142fdefdb46bb1c45c511499bd7525c75c3d2a30ad71449444f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for mrs-core 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page