← Files

Consensus-AI#

Author: Mikhail Deynekin – https://Deynekin.com – Mikhail@Deynekin.com
Version: 1.0.0 (2026-04-27)
License: PolyForm Noncommercial 1.0.0

Overview#

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.

Key Features#

Repository Structure#

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

Architecture (4-Layer Council)#

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

Built-in SKILLS#

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

Quick Start#

  1. Clone the repository

  2. Configure .env with your BotHub API key and MySQL credentials

  3. Run db/schema.sql against your MySQL 8.x instance

  4. Configure a vector store (Qdrant recommended, or MySQL-inline fallback)

  5. Start the PHP built-in server or deploy to your web server

Documentation#

All design decisions, schemas, and module breakdowns are documented in docs/.