Skip to main content

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.

The Governance Layer is a Python 3.10+ package distributed as an editable source install. It has no private index dependencies — everything comes from PyPI. The steps below take you from a fresh clone to a running speaker demo, with optional extras for reinforcement-learning experiments.
1

Clone the repository

Clone the repo and change into the project directory.
git clone https://github.com/xcoder-es/governance-layer.git && cd governance-layer
2

Install the package

Choose between a standard pip editable install or the faster uv workflow. Both install the same core dependencies.
pip install -e .
The core install brings in all runtime dependencies: gymnasium, neo4j, streamlit, altair, pytest, pytest-cov, pandas, certifi, and hypothesis.
3

Install optional extras (if needed)

Two optional extras are available for RL and grid-world experiment support.

[rl] — Reinforcement Learning

Pulls in torch>=2.0 and stable-baselines3>=2.3.
pip install -e ".[rl]"

[minigrid] — MiniGrid Environments

Pulls in minigrid>=3.1 and pygame-ce>=2.4.
pip install -e ".[minigrid]"
You can combine extras in a single command:
pip install -e ".[rl,minigrid]"
4

Configure environment variables

An .env.example file is included at the project root with Neo4j Aura placeholders. If you plan to use the persistent ontology backend, copy it and fill in your credentials.
cp .env.example .env
Then edit .env with your Neo4j connection details:
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
NEO4J_USER=neo4j
NEO4J_PASSWORD=your-password-here
The .env file is gitignored. If you skip this step the package still works — the dashboard automatically falls back to the in-memory MemoryBackend.
5

Verify the installation

Run the Neural Parliament speaker demo to confirm everything is wired up correctly.
python -m src.governance.runner speaker
A successful run prints a step-by-step trace of the parliament deliberating on a sequence of proposals. If you see output without import errors, the install is complete.

Core dependencies

All of the following are automatically installed as part of the base pip install -e . or uv sync step.
PackageMinimum versionPurpose
gymnasium>=0.29RL environment interface
neo4j>=5.20Optional persistent ontology backend
streamlit>=1.35Research dashboard UI
altair>=5.4Chart rendering in dashboard
pytest>=8.0Test runner
pytest-cov>=5.0Coverage reporting
pandas>=2.0Data handling in benchmarks
certifi>=2024.0SSL certificates for Neo4j Aura
hypothesis>=6.161Property-based and fuzz tests

Python version support

The package requires Python 3.10 or later. The CI matrix tests against 3.10, 3.11, and 3.12. Python 3.9 and below are not supported because the codebase uses match/case statements and modern union type syntax.

Build docs developers (and LLMs) love