A logic-augmentation layer for language models — not a model itself.
aGLM wraps any existing model with Socratic, epistemic, nonmonotonic, and BDI reasoning. Because the reasoning layer is pure Python, the interfaces load instantly and the language model is optional and pluggable.
AGLM is a hybridization of MASTERMIND aGLM with RAGE, distilled from the Professor Codephreak / easyAGI research lineage. Its premise is simple:
AGLM is not a language model — it augments one. Every input can be run through a cognitive pipeline (Socratic framing → epistemic belief → nonmonotonic defeasibility → BDI plan) that produces a logic-augmented prompt. That prompt is what gets handed to a model, or, with no model attached, is the deliverable itself.
The repository contains three things:
- Two consoles — working user interfaces that actually load.
- A modern
aglm/Python package — the installable Perceive-Decide-Act core. - The historical research modules — the cognitive faculties (
socratic.py,bdi.py,logic.py,MASTERMIND.py, …) that AGLM grew out of.
Both front ends run with zero heavy ML dependencies. The language model runs
in Ollama (local for modest hardware, :cloud for larger
reasoning) and is entirely optional.
# 1) Flask cognitive console — every faculty, zero heavy deps
./run_console.sh # → http://localhost:5000
# 2) AI SDK participant console — streaming chat on the Vercel AI SDK v7
./run_aisdk_console.sh # Flask brain :5000 + Next.js console :3000The AI SDK console adds a streaming chat with a model picker (local + :cloud),
an Advanced model-state panel (temperature, top-p, top-k, penalties, context
window, seed), a .history tab, and a live token counter.
| Faculty | Module | In the console |
|---|---|---|
| Socratic | reasoning.py |
premises · challenge · conclude · probing questions |
| Logic tables | logic.py |
truth tables over boolean expressions |
| Nonmonotonic | nonmonotonic.py |
default logic with retractable conclusions |
| Epistemic | epistemic.py |
belief state + revision |
| BDI | bdi.py |
Belief / Desire / Intention agent state |
| Autonomize | autonomize.py |
self-healing retry loop |
| MASTERMIND | MASTERMIND.py |
agent load · validate · execute |
| Memory | memory.py |
persist + browse ./memory/*.json |
| Prediction | prediction.py |
optional sklearn-style inference |
📖 CONSOLE.md — usage walkthrough ·
🧭 TECHNICAL.md — architecture ·
🛠 .claude/skills/aisdk/ — AI SDK v7 reference
A standalone, Apache-2.0 Python distribution of aGLM's autonomous-learning loop, distilled from the agenticplace/mindX pattern.
pip install . # core only
pip install ".[rage]" # with GATERAGE/RAGE
pip install ".[mastermind]" # with GATERAGE/mastermind
pip install ".[dev]" # pytest, ruffimport asyncio
from aglm import AGLMCore, AutonomousLoop, Decision, PerceptionContext
async def perceive(): return PerceptionContext(facts={"hour": 14})
async def decide(ctx, beliefs): return Decision(action="log", args=ctx.facts)
async def act(decision): return {"success": True}
async def main():
core = AGLMCore(perceive=perceive, decide=decide, act=act)
print(await core.cycle()) # one cycle
loop = AutonomousLoop(core, interval_seconds=300.0) # or a periodic runner
await loop.start()
await loop.stop()
asyncio.run(main())| Module | Class | Responsibility |
|---|---|---|
aglm/core.py |
AGLMCore |
Perceive · Orient · Decide · Act cycle |
aglm/beliefs.py |
BeliefSystem |
claim + confidence + source attribution |
aglm/cycle.py |
AutonomousLoop |
periodic runner with circuit breaker |
pip install ".[dev]" && pytest -vCanonical contract: docs/aglm_as_a_service.md.
RAGE remembers · aGLM decides · MASTERMIND orchestrates.
- GATERAGE/RAGE — retrieval substrate (memory)
- GATERAGE/mastermind — strategic orchestrator (planning)
- pythaiml/automindx — Professor Codephreak deployment environment
The files at the repo root document the philosophical foundation aGLM grew out of and remain preserved unchanged. The cognitive faculties are used directly by the consoles above.
| Module | Purpose |
|---|---|
MASTERMIND.py |
Core controller — loads, validates, and executes agents concurrently |
bdi.py |
Beliefs · Desires · Intentions agent framework |
socratic.py / reasoning.py |
Socratic question-and-answer reasoning over premises |
logic.py |
Formal logic operations and truth tables |
nonmonotonic.py |
Non-monotonic reasoning — beliefs adapt to contradicting evidence |
epistemic.py |
Knowledge/belief tracking and revision over time |
autonomize.py |
Self-healing autonomy with exponential backoff |
prediction.py |
Forecasting via statistical / ML models |
terminai.py · terminai_module.py |
OpenAI command-mode (cmd:) integration |
SimpleCoder.py |
Reusable code snippets and templates |
config.json |
Default allowed agency for MASTERMIND |
chunk4096.py |
Guards inputs above the 4096-token context of the original model |
Note. The legacy Gradio entrypoints (
uiux*.py,main.py) tried to load a multi-GB model before rendering and are kept for reference only. Use the consoles above instead — they are the working interfaces.
- MASTERMIND — agent creator and control agent · © codephreak, GPLv3, 2024 (NFT).
- Modern
aglm/package — Apache-2.0, © 2024–2026 GATERAGE / Professor Codephreak. - Project details: rage.pythai.net.
See LICENSE for the full text.