{"id":50102504,"url":"https://github.com/ayato-labs/logichive","last_synced_at":"2026-06-14T04:01:06.607Z","repository":{"id":344482095,"uuid":"1177412729","full_name":"ayato-labs/LogicHive","owner":"ayato-labs","description":"🛡️ Professional AI Logic Hub: Accumulate, verify, and reuse high-quality code assets via MCP. Built for kill liberation from mundane tasks likes code copy \u0026 remenber logic.","archived":false,"fork":false,"pushed_at":"2026-06-07T07:43:18.000Z","size":10106,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T08:07:10.259Z","etag":null,"topics":["agentic-workflows","ai-agents","ai-automation","harness-engineering","knowledge-management","mcp","mcp-server","professional-development","python","rag"],"latest_commit_sha":null,"homepage":"https://ofuse.me/21cfc1d2","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayato-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":"CLA.md"}},"created_at":"2026-03-10T02:09:41.000Z","updated_at":"2026-06-07T07:43:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ayato-labs/LogicHive","commit_stats":null,"previous_names":["ayato-ai-for-auto/logichive","ayato-labs/logichive"],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/ayato-labs/LogicHive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayato-labs%2FLogicHive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayato-labs%2FLogicHive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayato-labs%2FLogicHive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayato-labs%2FLogicHive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayato-labs","download_url":"https://codeload.github.com/ayato-labs/LogicHive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayato-labs%2FLogicHive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34308622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-workflows","ai-agents","ai-automation","harness-engineering","knowledge-management","mcp","mcp-server","professional-development","python","rag"],"created_at":"2026-05-23T08:05:19.892Z","updated_at":"2026-06-14T04:01:06.597Z","avatar_url":"https://github.com/ayato-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogicHive (Professional AI Logic Hub)\n\n🛡️ **LogicHive** is a high-precision knowledge extraction and logic management system. It enables AI agents to accumulate, verify, and reuse high-quality code assets via the Model Context Protocol (MCP).\n\n\u003e **\"Stop rebuilding the same logic. Build a long-term intelligence asset.\"**  \n\u003e **哲学: 巨人の肩の上に乗り、真に価値ある創造に集中せよ。**\n\n---\n\n## 🏗️ The Rigor Gate: A Hybrid Approach\n\nLogicHive uses a **Hybrid Deterministic Gate** to veto non-factual AI opinions:\n- **Fact (40%)**: AST analysis. Mandatory veto power (Assertion counting, Hollow logic detection).\n- **Static (30%)**: Ruff/Radon metrics for code health.\n- **AI (20%)**: Forensic auditing by LLMs.\n- **Execution (10%)**: Isolated runtime validation.\n\n\u003e [!IMPORTANT]\n\u003e LogicHive values **verifiability over correctness**. If an AI-generated logic atom lacks assertion tests, it is rejected by the Fact Gate, preventing low-quality code from polluting your knowledge base.\n\n---\n\n## 🌟 Key Features\n\n- **Hybrid Knowledge Search**: Semantic and exact-match search for code patterns.\n- **Verification Quality Gate**: Automated testing and linting before code is \"vaulted\".\n- **MCP Streamable HTTP (SSE) Integration**: Centralized deployment serving multiple clients (Cursor, Claude Desktop) concurrently.\n- **Project Isolation**: Manage logic assets across multiple namespaces and projects.\n\n---\n\n## 💼 Business Value \u0026 ROI\n\nLogicHive turns transient AI interactions into reusable corporate assets:\n1. **API Cost Optimization**: Drastically reduces LLM input tokens by injecting precise logic atoms instead of massive code context.\n2. **Preventing Technical Debt**: Automatically blocks un-asserted, redundant, or complex code, slashing future maintenance costs.\n3. **Secure AI Governance**: Filters out security vulnerabilities and runs isolated dynamic execution tests before storing assets.\n4. **Capitalizing Organizational Knowledge**: Ensures critical domain logic is preserved and shared, eliminating project silo effects and key-person risks.\n\n---\n\n## 🚀 Workflow\n\n1. **Discovery (探索)**: Find logic atoms via LogicHive MCP.\n2. **Retrieval (抽出)**: Inject verified logic into the agent context.\n3. **Adaptation (適合)**: AI refactors logic to match current namespaces.\n4. **Professionalization (資産化)**: Refined logic is saved back.\n5. **Stabilization (安定化)**: Background tools re-verify assets 24/7.\n\n---\n\n## 🐘 Handling Heavy AI Assets (Torch, Sklearn)\n\nRegistering code that imports large libraries like `torch` or `sklearn` can hit the **20s Quality Gate Timeout**. To bypass this and maintain a fast development rhythm, use the following patterns:\n\n### 1. Lazy Import (Recommended)\nMove heavy imports inside your functions. This prevents the library from loading during the initial module-level scan by LogicHive's AST analyzer.\n\n### 2. Smart Mocking\nIf you must have top-level imports, use the `mock_imports` parameter in `save_function`. LogicHive will inject `MagicMock` for those modules during verification.\n\n---\n\n## ⚙️ Configuration\n\nLogicHive is configured via environment variables or a `.env` file, resolving in the following order:\n\n1.  **Local `.env` (Primary)**: Place `.env` in the same directory as `LogicHive-MCP.exe` (or project root).\n2.  **User Home (Fallback)**: `~/.logichive/.env` (Global settings across folder moves).\n3.  **OS Environment Variables**: Directly set variables override `.env` values.\n\n**Setup Steps:**\n1.  **Locate `.env.example`**: Copy this file to `.env`.\n2.  **Set your API Keys**: At minimum, set `GEMINI_API_KEY`.\n3.  **Place the file**: Follow the rules above based on your deployment.\n\nSee [.env.example](.env.example) and [ADR-005](docs/adr/005-configuration-resolution-strategy.md) for details.\n\n---\n\n### 🚀 自動起動の設定（タスクスケジューラー）\n\nLogicHive を常駐させたい場合は、以下のコマンドを管理者権限の PowerShell で実行することでタスクスケジューラーに登録できます。\n\n```powershell\n# 設定例（パスは適宜調整してください）\n$Action = New-ScheduledTaskAction -Execute \"C:\\Path\\To\\LogicHive-Hub.exe\"\n$Trigger = New-ScheduledTaskTrigger -AtLogOn\nRegister-ScheduledTask -Action $Action -Trigger $Trigger -TaskName \"LogicHiveAutoStart\"\n```\n\n---\n\n## 🚀 Quick Setup \u0026 120-Second Cursor Integration\n\nTo start using LogicHive immediately, follow these simple steps.\n\n\u003e [!TIP]\n\u003e **Demo Workflow in Action**  \n\u003e *(Insert Demo GIF showing LogicHive saving a verified Python function and suggesting it inside Cursor here)*\n\n### Step 1: Run the LogicHive Server\n\nLogicHive offers two friction-free distribution methods:\n\n#### Option A: Windows Native EXE (Zero Friction \u0026 No Docker)\n1. Download `LogicHive-Hub.exe` (Server) or `LogicHive-Settings.exe` (GUI) from the [Latest Release](https://github.com/ayato-labs/LogicHive/releases).\n2. Run the `LogicHive-Hub.exe` via double-click or Command Prompt:\n   ```cmd\n   LogicHive-Hub.exe\n   ```\n3. The server runs natively on `http://localhost:10880/sse`.\n\n#### Option B: OCI Container (Docker / Podman)\nRun the pre-built image using standard container runtimes:\n```bash\ndocker run -d \\\n  -p 10880:10880 \\\n  -e GEMINI_API_KEY=your_api_key_here \\\n  -v logichive_data:/app/storage/data \\\n  --name logichive-hub \\\n  ghcr.io/ayato-labs/logichive-hub:latest\n```\n\n---\n\n### Step 2: Connect to AI Clients (MCP SSE)\n\nBecause LogicHive uses the **Streamable HTTP (SSE)** transport layer, setup is instant and does not require local script execution paths.\n\n#### For Cursor\n1. Navigate to **Settings \u003e Features \u003e MCP**.\n2. Click **+ Add New MCP Server**.\n3. Configure it as follows:\n   * **Name**: `logichive`\n   * **Type**: `SSE`\n   * **URL**: `http://localhost:10880/sse`\n4. Click **Save**.\n\n#### For Claude Desktop\nAdd the following configuration block to your `%APPDATA%\\Claude\\claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"logichive\": {\n      \"url\": \"http://localhost:10880/sse\"\n    }\n  }\n}\n```\n\n#### For Generic `mcp.json`\n```json\n{\n  \"mcpServers\": {\n    \"logichive\": {\n      \"url\": \"http://localhost:10880/sse\"\n    }\n  }\n}\n```\n\n---\n\n## 🛠️ Local Development (Manual Setup)\n\nIf you prefer to run LogicHive without Docker:\n\n```powershell\n# 1. Install dependencies\nuv pip install -e .\n\n# 2. Start LogicHive MCP Server\nuv run src/mcp_server.py\n```\n\n---\n\n## 🧪 Rigorous Testing \u0026 Deep Fact Verification\n\nLogicHive employs a multi-layered, \"Zero-Trust\" testing architecture to ensure the reliability of both the hub and the assets it manages. Unlike standard test suites, we perform **Deep Fact Verification** by directly querying physical databases (SQLite/FAISS) to verify that data is correctly \"vaulted\" and retrieved.\n\n### 1. Unit Tests (Atomic Verification)\n- **Scope**: Individual functions and evaluators.\n- **Goal**: Ensure logic gates (Deterministic, Security, AI) behave correctly at the AST and logic level.\n- **Verification**: Tests invoke storage APIs and then use raw SQL to verify that the bits on the disk match the intended state.\n\n### 2. Integration Tests (Feature Workflows)\n- **Scope**: Orchestrator pipelines and background tasks.\n- **Goal**: Validate that asynchronous verification flows, deduplication, and project isolation work seamlessly together.\n- **Verification**: Simulates concurrent saves and checks that the background \"Forensic Auditor\" correctly promotes or rejects assets over time.\n\n### 3. System Tests (User End-to-End)\n- **Scope**: Full MCP tool calls and SSE transport layer.\n- **Goal**: Ensure a user can search, save, retrieve, and delete logic through the Model Context Protocol without friction.\n- **Verification**: Operates through the actual `mcp_server` interface, mimicking a real AI agent (like Cursor or Claude) using the service.\n\n### 4. Chaos \u0026 Resilience (Negative Testing)\n- **Scope**: Edge cases, performance limits, and intentional failures.\n- **Goal**: Ensure the system handles \"Evil Code\" gracefully without crashing the hub.\n- **Scenarios**:\n  - **Infinite Loops**: Code that tries to hang the server is killed by hard timeouts.\n  - **Database Locks**: Simulates high-contention or locked DB states to verify retry logic.\n  - **Heavy Imports**: Rejects code that attempts to sneak in un-mocked massive libraries like `torch` or `tensorflow` during the static gate.\n\nTo run the suite:\n```powershell\nuv run pytest tests/unit tests/integration tests/system tests/chaos\n```\n\n---\n\n## 🏢 Commercial \u0026 Enterprise Compliance (商用・ビジネス利用への対応)\n\nLogicHiveは、ビジネス環境での商用利用およびエンタープライズ導入を前提として設計されています。\nコア技術および依存関係には、商用利用に非常に寛容な **MIT** や **Apache 2.0** などのパーミッシブ・ライセンス（Permissive License）を採用しているライブラリのみを使用しており、法務的なコピーレフト汚染のリスクなく安心して導入いただけます。\n\n### 依存技術のライセンス状況と根拠\n\nLogicHiveを構成する主要な依存ライブラリと動作環境は以下の通りです。すべて商用利用可能なライセンスであることを確認済です。\n\n| コンポーネント / ライブラリ | ライセンス | 根拠となるURL (LICENSE) |\n| :--- | :--- | :--- |\n| **Ollama (ソフトウェア本体)** | MIT | [GitHub](https://github.com/ollama/ollama/blob/main/LICENSE) |\n| **Ollama Python Client** | MIT | [GitHub](https://github.com/ollama/ollama-python/blob/main/LICENSE) |\n| **ChromaDB** | Apache 2.0 | [GitHub](https://github.com/chroma-core/chroma/blob/main/LICENSE) |\n| **FastEmbed** | MIT | [GitHub](https://github.com/qdrant/fastembed/blob/main/LICENSE) |\n| **FastMCP** | MIT | [GitHub](https://github.com/jlowin/fastmcp/blob/main/LICENSE) |\n| **FastAPI** | MIT | [GitHub](https://github.com/tiangolo/fastapi/blob/master/LICENSE) |\n| **Flet** | Apache 2.0 | [GitHub](https://github.com/flet-dev/flet/blob/main/LICENSE) |\n| **Google GenAI** | Apache 2.0 | [GitHub](https://github.com/google-gemini/generative-ai-python/blob/main/LICENSE) |\n| **Loguru** | MIT | [GitHub](https://github.com/Delgan/loguru/blob/master/LICENSE) |\n| **HTTPX** | BSD 3-Clause | [GitHub](https://github.com/encode/httpx/blob/master/LICENSE.md) |\n| **Pydantic** | MIT | [GitHub](https://github.com/pydantic/pydantic/blob/main/LICENSE) |\n| **Stripe** | MIT | [GitHub](https://github.com/stripe/stripe-python/blob/master/LICENSE) |\n\n\u003e [!WARNING]\n\u003e **LLMモデルのライセンスについてのご注意**\n\u003e Ollamaソフトウェア自体はMITライセンスですが、Ollama上で実行する**各LLMモデル（Llama 3, Qwen, Gemmaなど）の商用利用条件はモデル提供者のライセンスに依存**します。商用利用の際は、自社のビジネス規模（MAUなど）が各モデルの商用利用許諾条件を満たしているか、ご自身で確認してモデルを選定してください。\n\n\u003e [!IMPORTANT]\n\u003e **セキュリティと機密性について**:\n\u003e LogicHiveのユーザーデータ（保存されたロジック資産等）は、ローカル環境のデータベース（SQLite/ChromaDB等）にのみ保持されます。AIプロバイダーへ送信されるのは、ユーザーが明示的にリクエストした範囲内のコンテキストのみであり、資産自体が外部へ漏洩する設計ではありません。\n\n---\n\n## 🛡️ Governance \u0026 License (SV-COS)\n\nLogicHive is developed under the **Single-Vendor Open Source (SV-COS)** model.\n\n- **Decision Power**: 100% of the strategic and technical roadmap is managed by **Ayato-Labs**.\n- **Licensing**: Dual-licensed under **AGPL-3.0** and **Commercial**.\n- **Contributions**: Requires [CLA Agreement](CLA.md).\n\n---\n\n## 💼 Commercial Licensing for LogicHive\n\nLogicHive is dual-licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)** and a **Commercial License**.\n\n## Why a Commercial License?\n\nThe AGPL-3.0 is a strong copyleft license. If you use this software to provide a network service (SaaS), you are obligated to release your entire source code under the same license.\n\nA Commercial License is required if you wish to:\n1.  **Avoid AGPL-3.0 Obligations**: Use LogicHive as a part of a proprietary SaaS product or internal tool without disclosing your source code.\n2.  **Embedded Use**: Integrate the logic hub into a closed-source commercial application.\n3.  **Enterprise Support**: Receive guaranteed support, priority bug fixes, and custom feature development.\n\n---\n\n## License Tiers (Estimates)\n\n| Tier | Target | Annual Fee | Features |\n| :--- | :--- | :--- | :--- |\n| **Indie** | Individuals / Revenue \u003c $100k | $500 / year | Commercial use, No source disclosure |\n| **Startup** | Startups \u003c 50 employees | $2,000 / year | Tier 1 + Priority Email Support |\n| **Enterprise** | Large Corporations / Custom needs | Contact us | Tier 2 + Custom SLA / On-premise support |\n\n---\n\n## Contact for Licensing\n\nFor inquiries regarding commercial licensing, custom deployments, or professional services, please contact Ayato-Labs:\n\n- **Email**: [licensing@ayato-studio.ai](mailto:licensing@ayato-studio.ai)\n- **Support via OFUSE**: [🛡️ Join the Community / Support via OFUSE](https://ofuse.me/21cfc1d2)\n\n---\n*Copyright (C) 2026 Ayato-Labs. All rights reserved.*\n\n---\n\n## 🇯🇵 日本語サマリー (Japanese Summary)\n\nLogicHiveは、「仕様の再構築」や「冗長な実装」から開発者を解放するための**プロフェッショナル向けロジック・ハブ**です。\n\n### 核心的な価値\n- **死んだコードの撲滅**: 良質なロジックを「共有知」へ。\n- **決定論的品質ゲート**: AIの温情を排し、AST解析(事実)が品質を担保する。\n- **巨人の肩に乗る**: 書けば書くほど開発環境が強化される「知の資産化」。\n- **デュアルライセンス**: OSSとしての普及と、商用利用での機密性保持を両立。\n\n---\n\n## 📄 License\n\nCopyright (C) 2026 Ayato-Labs.  \nLicensed under the [AGPL-3.0 License](LICENSE).\nFor commercial use, contact [Ayato Studio](https://ofuse.me/21cfc1d2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayato-labs%2Flogichive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayato-labs%2Flogichive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayato-labs%2Flogichive/lists"}