The fastest path to a working governance cycle is four steps: clone the repository, install the package in editable mode, run the speaker sanity check, and then wire up your own members and proposals using the public API. This guide walks through each step and ends with a complete, runnable Python example drawn directly from the reference implementation.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xcoder-es/governance-layer/llms.txt
Use this file to discover all available pages before exploring further.
Install the package
The If you prefer uv, the project is fully compatible:Optional extrasThe The
governance-layer package is installed from source in editable mode. Python 3.10 or later is required.rl extra adds PyTorch and Stable-Baselines3 for the RL adversary experiment:minigrid extra adds MiniGrid and pygame-ce for the visual grid-world scenarios:Core governance functionality — the Neural Parliament, Ulysses Contracts, and Identity Layer — requires neither
rl nor minigrid. Install the base package unless you specifically need benchmark environments or the RL adversary.Run the speaker demo
The bundled CLI provides a quick sanity check that exercises the Speaker state machine end-to-end with three members and three competing proposals:You should see output similar to:If the safety member’s veto threshold blocks the high-reward proposal and the parliament reaches consensus on the safe action, the setup is working correctly.
Write your first governance cycle
Import the public API, construct your parliament, create proposals, and call
run_governance_cycle(). The example below mirrors the speaker demo exactly as it appears in the reference implementation.Explore the Streamlit dashboard
The governance package ships with a multi-page Streamlit application that visualises the formal model, lets you run the Neural Parliament interactively, and displays benchmark results.The dashboard opens in your browser and provides three tabs:
- Formal Model — Browse the layered specification and testable predictions.
- Parliament Live — Submit proposals and watch the Speaker deliberate in real time.
- Benchmarks — Explore results across all four experimental scenarios and five strategies.
The dashboard uses
MemoryBackend by default (ephemeral, no dependencies). To persist ontology entities and decision logs across sessions, add a .env file with NEO4J_URI, NEO4J_USER, and NEO4J_PASSWORD — the dashboard auto-detects credentials and upgrades to Neo4jBackend.Next Steps
Architecture
Understand the four-layer stack before wiring custom members into your own agent loop.
Neural Parliament
Learn how to implement
ParliamentMember, set veto thresholds, and configure proposal budgets.Ulysses Contracts
Lock pre-committed constraints before high-stakes episodes to prevent self-amendment under pressure.
Identity Layer
Anchor a four-tier commitment ontology so the agent’s core values survive multi-round deliberation.