CEREBRUM

CEREBRUM: Case-Enabled Reasoning Engine with Bayesian Representations for Unified Modeling
Status
CEREBRUM is actively maintained. Its current software source version is
1.5.0. The offline unit suite runs and passes on a
uv pip install -e ".[dev]" checkout; pytest.ini deselects the opt-in live
network tests by default. The LEXICON and LLM subsystems additionally need
OPENROUTER_API_KEY and network access, so their live paths are not exercised by
the default run. The manuscript guide explains
the paper build and validation.
Contents
Repository
GitHub Repository: https://github.com/ActiveInferenceInstitute/CEREBRUM
Overview
CEREBRUM is a unified modeling framework that integrates case-based reasoning with Bayesian representations. It provides a comprehensive suite of tools for developing, testing, and deploying cognitive models that combine the strengths of case-based reasoning with probabilistic inference.
Key features include:
- Integration of symbolic case structures with Bayesian probabilistic representations
- Flexible transformation engine for model adaptation and learning
- Case-system mappings and implementation guidelines for 60+ natural and 35+ programming languages (see
docs/languages/)
- Visualization tools for model inspection and analysis
- Extensive example library demonstrating applications across domains
Project Architecture
Architecture diagram (Mermaid source): project_architecture.mermaid
Repository Structure
The CEREBRUM repository is organized into the following structure:
| Directory/File |
Description |
/src |
Source code for the CEREBRUM framework |
/src/core |
Core engine components including active inference module, neural networks, and model base classes |
/src/models |
Implementation of various model types and case definitions |
/src/utils |
Utility functions and helper classes |
/src/visualization |
Visualization tools and components |
/src/transformations |
Model transformation and adaptation algorithms |
/src/cases |
Case definition and management functionalities |
/src/examples |
Example implementations and demonstrations |
/models |
Generalized Notation Notation specifications for the generative models, with the loader/drift guard in src/core/gnn.py |
/docs |
Documentation including specifications, guides, and discussions |
/docs/examples |
Detailed documentation for example models |
/docs/languages |
Language-specific implementation guidelines |
/docs/manuscript |
Canonical paper, supplements, and pinned template render instructions |
/paper |
Legacy assembler that reads the canonical manuscript |
/paper/output |
Archived PDFs and checked-in figure assets |
/scripts |
Setup, rendering, and maintenance orchestration scripts |
Implementation Workflow
Workflow diagram (Mermaid source): implementation_workflow.mermaid
Getting Started
CEREBRUM can be used in multiple ways depending on your needs:
- Explore existing models: Check out the
/src/examples directory
- Create your own models: Follow the guides in
/docs/guides/getting_started.md
- Extend the framework: See
/docs/contributing/contributing_technical.md for development setup
Installation
We use uv for fast, reliable Python dependency management.
# Clone the repository
git clone https://github.com/ActiveInferenceInstitute/CEREBRUM.git
cd CEREBRUM
# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e .
# For development (includes testing and linting tools)
uv pip install -e ".[dev]"
# For all optional dependencies
uv pip install -e ".[all]"
Testing
All checks run through one entry point. ./run.sh lists the arms; each arm is
also what CI runs, so a local run and a CI run execute the same commands.
./run.sh setup # create .venv from uv.lock (dev + llm extras)
./run.sh lint # blocking static checks
./run.sh types # mypy on the annotated GNN loader surface
./run.sh docs # docs index freshness + relative link check
./run.sh test-fast # quick pass over the logic core
./run.sh test # full suite with coverage (what CI runs)
./run.sh gnn # pinned-upstream GNN conformance
./run.sh all # lint, types, docs, test, gnn
Measured per-arm wall times, test counts and coverage live in
docs/_generated/gate-metrics.md, which
./run.sh metrics regenerates from the run artifacts. See
docs/RUN_GUIDE.md for the arm definitions, the CI job
mapping and the current static-analysis debt.
Individual commands that the arms wrap are still fine for debugging:
# A single test file
uv run python -m pytest tests/core/test_model.py -v
# GNN specification drift guard, against a sibling GNN checkout
uv run python -m pytest tests/core/test_gnn_spec.py -v
# Run tests by marker
uv run python -m pytest -m unit
PDF Documentation
Read the published version 1.4 PDF.
The canonical manuscript contains the paper and its twelve supplements.
Requirements for PDF Generation
Use the manuscript guide to
install the tools and set up the pinned docxology template.
Generating the PDF
Follow the render and validation commands
to build from the current manuscript. The template writes
output/pdf/CEREBRUM_combined.pdf and
output/reports/validation_report.md.
Use Cases
Use-case mindmap (Mermaid source): use_cases_mindmap.mermaid
Generative model specification
The framework’s discrete generative model is specified in Generalized Notation
Notation (GNN) at
models/case_conditioned_active_inference.gnn.md.
models/README.md records the declared structure (one
hidden-state factor, one identity-likelihood modality, three controls, the
runtime A[state, observation] and B[previous_state, action, next_state]
storage orders, and the eight-case precision-focus contract), the loader in
src/core/gnn.py, and the pinned upstream revision (GNN v5.4.1, commit
1b21e17a2f0b70857d8dfbdd65ee5fe7f015ae91, also in
.github/gnn-pin.json). tests/core/test_gnn_spec.py
checks the specification against the parameters and case configurations the
framework uses. ./run.sh gnn runs the shared gnn.importers reader against
the pin and pointer, then the pinned parser; the GNN pointer
records that adopted reader.
For new model work, start from the upstream framework integration
guide
and the downstream adoption
guide.
Related Active Inference Institute repositories that already declare models this
way:
- active_inference_language_model
— case-level specifications such as
gnn/models/L4_case.gnn.md, plus mutation
variants that show how a declared model degrades.
- ActiveBlockference
— a control model validated against its own pinned GNN release.
- active_fractal_rabbit
— the reference layout this repository follows:
models/, a loader module,
and .github/gnn-pin.json.
Citation
Use the preferred paper citation or the BibTeX entry below
for the archived version 1.4 paper.
@misc{friedman2025cerebrum,
author = {Friedman, Daniel Ari},
title = {CEREBRUM: Case-Enabled Reasoning Engine with Bayesian Representations for Unified Modeling},
year = {2025},
month = {April},
version = {1.4},
doi = {10.5281/zenodo.15231156},
url = {https://zenodo.org/records/15231156}
}
License
CC BY 4.0
Acknowledgements
This work builds upon the efforts and insights of many participants within the Active Inference Institute. Special thanks are extended to Dave Douglass for his contributions related to computational linguistics, archiving, Active Inference principles, upper ontologies, and translations, which have significantly informed aspects of this project.
Contributing
We welcome contributions from researchers, developers, and enthusiasts across multiple domains:
Ways to Contribute
- 🔬 Research: Theoretical development, empirical testing, literature reviews
- 💻 Technical: Core development, language implementations, integrations, testing
- 📚 Documentation: Educational content, API docs, use cases, tutorials
- 🧩 Examples: Model examples, domain applications, interactive demonstrations
- 🌍 Community: Organizing events, content creation, mentoring, user support
For detailed contribution guidelines, process information, and more specific ideas, please see our CONTRIBUTING.md document.
To report a security vulnerability, see SECURITY.md.
InstituteOS sidecar
This repository carries a committed .aii/ sidecar with curated
InstituteOS metadata (aii-sidecar/v1): category, maturity, ecosystem relations,
key artifacts, provenance, and portable tasks. It is read by
InstituteOS tooling and
does not affect the project’s build or runtime.
Research manuscript
评论