Author: Mikhail Deynekin – https://Deynekin.com – Mikhail@Deynekin.com
Version: 1.0.0 (2026-04-27)
License: MIT
Consensus-AI is a PHP 8.4 web application implementing an OpenCorum-style AI council for deliberative intelligence. It uses multiple LLMs simultaneously through BotHub.chat API, combines their outputs via a structured consensus engine, and surfaces full transparency through an interactive "Details" diagram for every answer.
Inspired by OpenCorum and the CAIS API.
- Multi-model, multi-role council sessions via BotHub.chat (OpenAI-compatible)
- SKILLS system: declarative JSON workflows defining agent roles, prompts, and consensus rules
- Auto-selection or auto-creation of the most relevant SKILL per query
- Vector memory: chunk storage + retrieval for short-term and long-term context
- Full audit trail: every model response, every step, every consensus score persisted in MySQL
- Interactive "Details" button: clickable DAG showing the entire council flow
- PHP 8.4 strict types, readonly properties, enums throughout
- MySQL 8.x via PDO with prepared statements and explicit transactions
Consensus-AI/
├── README.md
├── docs/
│ ├── Part1-Architecture.md # Overall concept, functional requirements, tech stack
│ ├── Part2-Skills.md # SKILL JSON schema + 4 concrete SKILLS
│ ├── Part3-Database-Interfaces.md # MySQL DDL + PHP interfaces
│ ├── Part4-CouncilEngine-API.md # CouncilEngine layers + API endpoints
│ ├── Part5-Controllers-Flow.md # HTTP controllers + downgrade mitigation
│ └── Part6-CouncilEngine.md # Full CouncilEngine PHP 8.4 module
├── src/
│ ├── Application/
│ │ ├── Council/
│ │ │ └── CouncilEngine.php
│ │ ├── Skill/
│ │ └── Memory/
│ ├── Domain/
│ │ ├── Council/
│ │ ├── Skill/
│ │ └── Memory/
│ ├── Infrastructure/
│ │ └── LLM/
│ └── Http/
│ └── Controller/
└── db/
└── schema.sql
User Query
│
▼
[L0] Skill Router ──► Auto-create SKILL if needed
│
▼
[L1] Query Distribution ──► Parallel calls to multiple roles + models
│
▼
[L2] Response Normalization ──► JSON schema enforcement per role
│
▼
[L3] Consensus Analysis ──► Agreement scores, conflict detection
│
▼
[L4] Decision Synthesis ──► Final answer + audit trail
│
▼
Final Answer + [Details] button
| Slug | Purpose | Roles |
|---|---|---|
webapp_architect |
PHP+MySQL+vector store architecture | Solution Architect, Scalability Expert, Security Engineer |
db_performance_optimizer |
MySQL query/schema optimization | Query Profiler, Storage Designer, Migration Planner |
php_code_refiner |
PHP 8.4 code refactoring | Senior PHP Reviewer, Error-Handling Specialist, Future-Proofing Reviewer |
ux_frontend_collaborator |
Modern 2026 UI/UX design | UX Designer, UI Engineer, Interaction Designer |
- Clone the repository
- Configure
.envwith your BotHub API key and MySQL credentials - Run
db/schema.sqlagainst your MySQL 8.x instance - Configure a vector store (Qdrant recommended, or MySQL-inline fallback)
- Start the PHP built-in server or deploy to your web server
All design decisions, schemas, and module breakdowns are documented in docs/.