Modular Reasoning Framework: Multi-stage constraint layer for autonomous agents
Project description
Modular Reasoning Framework (MRF)
MRF is a lightweight, transparent, multi-stage reasoning scaffold for autonomous agents. It provides a decomposable structure built from reusable computational primitives (Transform, Evaluate, Filter, Summarize, Reflect, Inspect, Rewrite) to make agent behavior traceable and reliable.
Why MRF
Autonomous agents fail because:
- No reasoning structure
- No constraint layer
- No diagnostics
MRF introduces explicit stages, bounded operations, and full visibility into how reasoning unfolds.
Features
• Reusable Operators
Transform
Evaluate
Filter
Summarize
Reflect
Inspect
Rewrite
• Multi-Stage Pipeline
Understanding → Planning → Execution → Synthesis → Verification
• Diagnostics
Stage logs
Confidence tracking
Goal alignment
Failure detection
• Security-Relevant Mitigation
MRF is not an alignment system, but adds structure that reduces unbounded behavior, prompt-injection surfaces, and silent drift.
Install
pip install mrf-core
Quick Start
from mrfcore.pipeline import ReasoningPipeline
pipeline = ReasoningPipeline(verbose=True) result = pipeline.run("Plan a three-step morning routine.")
print(result["answer"]) print(result["confidence"]) print(result["valid"])
Inspecting a Stage
pipeline.inspect_stage(result, "understanding")
Custom Pipeline
from mrfcore.phases import UnderstandingPhase, PlanningPhase, ExecutionPhase from mrfcore.pipeline import Pipeline
pipeline = Pipeline([ UnderstandingPhase(), PlanningPhase(), ExecutionPhase() ])
result = pipeline.run("Help me clean my desk efficiently.")
Project Structure
mrfcore/ operators/ base.py transform.py evaluate.py filter.py summarize.py reflect.py inspect.py rewrite.py engine.py pipeline.py phases.py presets.py diagnostics.py exceptions.py examples/ tests/
What MRF Is Not
Not alignment Not a safety guarantee Not a sandbox Not a replacement for secure execution layers MRF adds structure
Contributing
PRs welcome
License
License
This project is licensed under the Apache License 2.0.
Copyright 2026 Ryan Sabouhi
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0
Notice
This software contains original work developed as part of the
Modular Reasoning Framework (MRF) by Ryan Sabouhi.
See the NOTICE file for additional attribution details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mrf_core-1.0.0.tar.gz.
File metadata
- Download URL: mrf_core-1.0.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa6f8d15c598c1c8515c83d385f5693f16b4ec18f7a8324cfea35f474f2d37f2
|
|
| MD5 |
df015f018ebf4e2a3a7ae570d556f01b
|
|
| BLAKE2b-256 |
d33d835882823095356c938a55af87980dc2a33aa49efa8ce3b11b850fd82460
|
File details
Details for the file mrf_core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mrf_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c893cf6e251470e64e120e3a9be12d5a655caa8857f4dd683f4b5f233cce7595
|
|
| MD5 |
c6d652105ca95eaffb9d75aa0af2f1dd
|
|
| BLAKE2b-256 |
13894dee37422ff9cf72a12a0ad46f7a4d124e559947347a11f80bec58a6c257
|