A web-based application for managing AI agents and facilitating automatic debates/discussions between agents using a "Round Robin with Timeout" schema to generate the best answers for users.
- Multi-Agent Management: Configure and manage AI agents with different providers (Ollama, OpenAI, Anthropic, Google Gemini)
- Debate Engine: Orchestrates discussions between multiple AI agents in a round-robin format
- Moderator Support: Optional AI moderator to guide discussions, provide opening/closing remarks, and maintain discourse quality
- Multi-Provider Support: Native support for OpenAI, Anthropic Claude, Google Gemini, Ollama, and custom OpenAI-compatible APIs
- Real-time Updates: Server-Sent Events (SSE) for live debate updates
- Web Dashboard: Clean, responsive UI built with HTML, HTMX, and Tailwind CSS
- History Tracking: Complete discussion history with agent responses and timestamps
- Agent Health Checks: Ping agents to verify connectivity
- Backend: Go (Golang) with Echo framework
- Frontend: HTML5/HTMX, Tailwind CSS, Vanilla JavaScript
- Database: SQLite for lightweight, local data storage
- AI Integration: REST API supporting OpenAI format and Ollama API
- Go 1.24+ installed
- An AI provider (Ollama, OpenAI, or OpenAI-compatible API)
- Clone the repository:
git clone <repository-url>
cd CourtTableAI- Install dependencies:
go mod tidy- Build and run:
go build cmd/main.go cmd/renderer.go
./main.exe # on Windows
# or
./main # on Unix systems- Open your browser and navigate to
http://localhost:8880
-
Go to the Agents page
-
Click Add New Agent
-
Fill in the agent details:
- Name: Display name for the agent
- Provider URL: API endpoint (e.g.,
http://localhost:11434for Ollama) - API Token: Authentication token (if required)
- Model Name: Model to use (e.g.,
llama2,gpt-3.5-turbo) - Timeout: Response timeout in seconds
-
Test the connection with Test Connection
- Go to the Discussions page
- Click Start New Discussion
- Enter the discussion topic
- Select the agents to participate
- Optionally select a Moderator to guide the discussion
- Click Start Discussion
The debate engine will:
- Send the topic to the first agent
- If a moderator is selected, they will provide opening remarks
- Pass responses from one agent to the next as context
- Moderator provides interim commentary between agent responses
- Moderator summarizes each round and provides closing remarks
- Handle timeouts and errors gracefully
- Generate a final summary
- View real-time updates on the discussion detail page
- See agent responses, timestamps, and response times
- Retry failed agent responses
- Stop running discussions
- View discussion history
GET /api/agents- List all agentsPOST /api/agents- Create new agentGET /api/agents/:id- Get agent detailsPUT /api/agents/:id- Update agentDELETE /api/agents/:id- Delete agentPOST /api/agents/:id/ping- Test agent connectivity
GET /api/discussions- List all discussionsPOST /api/discussions- Create new discussionGET /api/discussions/:id- Get discussion details with logsPOST /api/discussions/:id/stop- Stop running discussionPOST /api/discussions/:id/retry/:agentId- Retry failed agent response
GET /api/discussions/:id/stream- Server-Sent Events stream
CREATE TABLE agents (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
provider_url TEXT NOT NULL,
api_token TEXT NOT NULL,
model_name TEXT NOT NULL,
timeout_seconds INTEGER DEFAULT 30,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE discussions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
topic TEXT NOT NULL,
final_summary TEXT,
status TEXT DEFAULT 'running',
agent_ids TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);CREATE TABLE discussion_logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
discussion_id INTEGER NOT NULL,
agent_id INTEGER NOT NULL,
content TEXT,
status TEXT NOT NULL,
response_time INTEGER DEFAULT 0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (discussion_id) REFERENCES discussions(id) ON DELETE CASCADE,
FOREIGN KEY (agent_id) REFERENCES agents(id) ON DELETE CASCADE
);- Provider URL:
http://localhost:11434 - Model Name: Any model available in Ollama (e.g.,
llama2,mistral)
- Provider URL: API endpoint (e.g.,
https://api.openai.com/v1) - API Token: Your API key
- Model Name:
gpt-3.5-turbo,gpt-4, etc.
The application uses a SQLite database file (court_table_ai.db) that will be created automatically on first run.
CourtTableAI/
├── cmd/
│ ├── main.go # Application entry point
│ └── renderer.go # Template renderer
├── pkg/
│ ├── database/ # Database operations
│ ├── handlers/ # HTTP handlers
│ ├── models/ # Data models
│ └── orchestrator/ # Debate engine and agent client
├── static/ # Static files (CSS, JS)
├── templates/ # HTML templates
├── go.mod # Go module file
└── go.sum # Go dependencies
go run cmd/main.go cmd/renderer.goThis project is open source and available under the MIT License.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues and questions:
- Check the existing issues
- Create a new issue with detailed information
- Include logs and configuration details
