{
  "markdown": "# Hivemind\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![npm version](https://img.shields.io/npm/v/@quantulabs/hivemind.svg)](https://www.npmjs.com/package/@quantulabs/hivemind)\n\nMulti-model AI consensus platform that queries GPT-5.2, Claude Opus 4.5, and Gemini 3 Pro simultaneously to deliver synthesized, high-confidence responses.\n\n---\n\n## MCP Server for Claude Code\n\nUse Hivemind directly in Claude Code to get perspectives from GPT-5.2 and Gemini 3 Pro. Claude acts as the orchestrator and synthesizes the responses.\n\n### Requirements\n\n- [Node.js](https://nodejs.org/) >= 18\n- [Claude Code](https://claude.ai/code) CLI installed\n- At least one API key: [OpenAI](https://platform.openai.com/api-keys) or [Google AI](https://aistudio.google.com/apikey)\n\n> **Note:** No Anthropic API key needed - Claude is already your host!\n\n### Installation\n\n```bash\nnpm install -g @quantulabs/hivemind\nclaude mcp add hivemind -- hivemind\n```\n\n### Configuration\n\nYou need at least one API key, but both are recommended for better consensus:\n- [OpenAI](https://platform.openai.com/api-keys) (GPT-5.2)\n- [Google AI](https://aistudio.google.com/apikey) (Gemini 3 Pro)\n\n**Option 1: Paste directly (recommended)**\n```bash\n/hive-config sk-proj-xxx...   # OpenAI key\n/hive-config AIzaSy...        # Google key\n```\n\n**Option 2: Config file**\n\nCreate `~/.config/hivemind/.env`:\n```bash\nOPENAI_API_KEY=sk-...\nGOOGLE_API_KEY=AIza...\n\n# Optional: Override default models\nOPENAI_MODEL=gpt-5.1\nGOOGLE_MODEL=gemini-2.5-flash\n```\n\n> A `.env.example` template is included in the package.\n\n<details>\n<summary>Using with other MCP clients (non-Claude Code)</summary>\n\nFor standalone MCP usage, you can also add an Anthropic key to include Claude in the consensus:\n```bash\nANTHROPIC_API_KEY=sk-ant-...\n```\nDisable Claude Code mode via `/hive-config` > Settings > Claude Code Mode.\n</details>\n\n### Usage\n\n```bash\n/hive \"Why is my WebSocket connection dropping?\"\n```\n\nClaude orchestrates the consensus from GPT-5.2 and Gemini 3 Pro responses.\n\n### Available Tools\n\n| Tool | Description |\n|------|-------------|\n| `hivemind` | Query models and get synthesized consensus |\n| `configure_keys` | Set API keys (stored securely) |\n| `check_status` | Check configuration and active providers |\n| `configure_hive` | Toggle grounding search and settings |\n| `check_stats` | View token usage and cost statistics |\n\n### Claude Code Commands\n\n- `/hive <question>` - Orchestrate multi-model consensus with Claude as the synthesizer\n- `/hive-config` - Configure API keys and settings\n- `/hivestats` - View usage statistics\n\n### Automatic Hivemind Fallback\n\nCopy `CLAUDE.md.example` to your project's `.claude/CLAUDE.md` to enable automatic Hivemind consultation when Claude is stuck (after 3+ failed attempts).\n\n### Prompt Caching\n\nAll providers use optimized caching for cost reduction on follow-up queries:\n\n| Provider | Type | Savings | Min Tokens |\n|----------|------|---------|------------|\n| OpenAI | Automatic | 50% | 1024 |\n| Gemini 2.5+ | Implicit | 90% | - |\n| Anthropic | Explicit | 90% | 1024 |\n\n---\n\n## Web Interface\n\nA full-featured web app with solo mode, hivemind mode, and conversation history.\n\n### Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/QuantuLabs/hivemind.git\ncd hivemind\n\n# Install dependencies (requires Bun >= 1.0)\nbun install\n\n# Start development server\nbun dev\n```\n\nOpen `http://localhost:3000`, click the settings icon, and enter your API keys.\n\n### Features\n\n- **Multi-Model Consensus**: Query 3 leading AI models simultaneously\n- **Deliberation Algorithm**: Up to 3 rounds of refinement to reach consensus\n- **Solo Mode**: Chat with individual models (GPT, Claude, Gemini)\n- **Hivemind Mode**: Get synthesized responses from all models\n- **Conversation History**: Persistent chat sessions\n- **Dark/Light Theme**: Full theme support\n- **Secure Storage**: API keys encrypted with AES-GCM in browser\n\n### Security\n\n- API keys are encrypted using AES-GCM with PBKDF2 key derivation\n- Keys are stored locally in browser localStorage (never sent to servers)\n- Session persistence uses sessionStorage (cleared on browser close)\n\n---\n\n## How Consensus Works\n\n1. **Initial Query**: All 3 models receive the same question\n2. **Analysis**: An orchestrator analyzes responses for agreements/divergences\n3. **Refinement**: If no consensus, models see other perspectives and refine (up to 3 rounds)\n4. **Synthesis**: Final response synthesizes agreed points and addresses divergences\n\n## Supported Models\n\n### OpenAI\n- GPT-5.2 (default)\n- GPT-5.1, GPT-5, GPT-5 Mini, GPT-5 Nano\n- O4 Mini\n\n### Anthropic\n- Claude Opus 4.5 (default)\n- Claude Sonnet 4.5, Claude Opus 4, Claude Sonnet 4\n\n### Google\n- Gemini 3 Pro (default)\n- Gemini 3 Flash, Gemini 2.5 Pro/Flash/Flash Lite, Gemini 2.0 Flash\n\n## Project Structure\n\n```\nhivemind/\n├── apps/\n│   └── web/              # Next.js 14 frontend\n├── packages/\n│   ├── core/             # Shared consensus logic & providers\n│   └── mcp/              # Model Context Protocol server\n└── .claude/              # Claude Code integration\n```\n\n## Development\n\n```bash\n# Run all tests\nbun test\n\n# Run tests with coverage\nbun test:coverage\n\n# Build all packages\nbun build\n\n# Lint code\nbun lint\n```\n\n## License\n\nMIT\n\n---\n\nDeveloped by [QuantuLabs](https://github.com/QuantuLabs)\n",
  "bytes": 5374,
  "sha": "d110364877350dc9df9cd69ae903e4a6bd3b5d75091a2914180e035f962639ad",
  "repo_slug": "quantulabs/hivemind",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_quantulabs_hivemind_17202183/readme"
}