agent-control README

The project's README from github.com/loulanyue/agent-control. As one markdown file: README.md.

🚀 Agent Control

Modern, High-Performance Control Plane & Task Orchestration Platform for Autonomous AI Agents

License Python Version FastAPI MCP Compatible Docker PRs Welcome

English | 中文说明


🌟 Highlights

Agent Control is a production-grade, asynchronous AI Agent Control Plane and orchestration engine designed to manage autonomous agents, distributed task dispatching, heartbeat leasing, DAG workflow execution, and data collection pipelines at scale.


🏗️ Architecture

graph TD
    subgraph Clients["LLM & Orchestration Clients"]
        A1["Claude Desktop / Cursor"]
        A2["Antigravity / AutoGPT"]
        A3["Web Dashboard"]
    end

    subgraph Protocol["Interface Layer"]
        B1["MCP Server (JSON-RPC)"]
        B2["FastAPI REST APIs (/docs)"]
    end

    subgraph Core["Agent Control Plane Core"]
        C1["Agent Registry & Heartbeats"]
        C2["Task Dispatcher & Leasing"]
        C3["DAG Workflow Engine"]
        C4["Rule & Deduplication Engine"]
        C5["Cron Scheduler Worker"]
    end

    subgraph Workers["Agents & Pipelines"]
        W1["Coding & Refactoring Agents"]
        W2["Talent Notice Crawlers"]
        W3["Enterprise Bidding Scrapers"]
    end

    subgraph Storage["Persistence Layer"]
        DB[("MySQL / SQLite / PostgreSQL")]
    end

    A1 -->|Stdio MCP| B1
    A2 -->|HTTP REST| B2
    A3 -->|HTTP REST| B2
    B1 --> Core
    B2 --> Core
    Core <--> Workers
    Core <--> DB

⚡ Quickstart

# Clone the repository
git clone https://github.com/loulanyue/agent-control.git
cd agent-control

# Run with local environment (auto creates venv & installs dependencies)
./start.sh

Visit the services:

Option 2: Docker Compose

Launch the complete stack (FastAPI + MySQL 8.0) with a single command:

docker-compose up -d

Option 3: Manual Installation (Python 3.10+)

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

# Copy environment configuration
cp .env.example .env

# Run FastAPI server
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

🐍 Python SDK (agent-control-sdk)

Agent Control includes an official, fully-typed Python SDK for programmatic task dispatching, agent fleet management, and DAG monitoring:

# Install directly from the repository
pip install -e .

SDK Quickstart

from agent_control_sdk import AgentControlClient, TaskPriority

# 1. Connect to the Control Plane
client = AgentControlClient(base_url="http://localhost:8000")

# 2. Inspect cluster metrics
metrics = client.system.metrics()
print(f"Agents: {metrics.total_agents} | Tasks: {metrics.total_tasks}")

# 3. List online agents
agents = client.agents.list(status="online")
for agent in agents["items"]:
    print(f"Agent: {agent.name} ({agent.agent_type})")

# 4. Dispatch an autonomous task
task = client.tasks.dispatch(
    title="Extract semiconductor job profiles",
    objective="Crawl top 20 chip design companies and normalize skill requirements",
    priority=TaskPriority.HIGH
)
print(f"Dispatched Task #{task.id} (Public ID: {task.public_id})")

# 5. Inspect DAG workflows
graphs = client.graphs.list()
print(f"Active DAG definitions: {graphs['total']}")

🔌 Model Context Protocol (MCP) Integration (10 Built-in Tools)

Agent Control includes a native Model Context Protocol (MCP) server (mcp_server.py) enabling LLMs (Claude Desktop, Cursor, Claude Code) to orchestrate tasks, inspect workflows, and query database state.

10 Standardized MCP Tools:

Claude Desktop Configuration

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "agent-control": {
      "command": "python3",
      "args": ["/path/to/agent-control/mcp_server.py"],
      "env": {
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "13306",
        "DB_USER": "root",
        "DB_PASSWORD": "",
        "DB_NAME": "agent_control"
      }
    }
  }
}

🛠️ Management CLI Commands

start.sh provides convenient lifecycle commands:

Command Description
./start.sh Run in foreground dev mode with live reload
./start.sh start Run as background daemon process
./start.sh stop Gracefully stop the running daemon
./start.sh restart Restart the background service
./start.sh status Check service PID, port status, and healthcheck
./start.sh logs Follow live daemon logs (tail -f)

📚 REST API Overview

Endpoint Method Description
/api/v1/agents/register POST Register a new agent with capabilities
/api/v1/agents/{id}/heartbeat POST Refresh agent lease and report status
/api/v1/tasks POST Dispatch a new task to the queue
/api/v1/tasks/claim POST Agent claims an eligible pending task
/api/v1/graphs POST Create a DAG multi-agent workflow
/api/v1/graphs/{id}/trigger POST Trigger execution of a workflow
/api/v1/rules GET Retrieve and evaluate agent rules

Explore all endpoints with interactive testing at http://localhost:8000/docs.


📖 Agent Control 控制面平台 (中文说明)

Agent Control 是一个专为智能体集群与自动化流水线设计的生产级控制面系统。

核心特性

  1. 多 Agent 状态机与租约机制:支持分布式心跳汇报、任务租约锁定、超时自动转移与故障驱逐。
  2. DAG 图工作流编排:支持定义包含依赖关系的多步骤图任务,实现跨 Agent 协作。
  3. 原生 MCP 协议支持:内置 mcp_server.py,支持直接与 Claude Desktop、Cursor 等客户端通过标准工具协议对话。
  4. 统一可观测看板:开箱即用可视化面板(/dashboard),实时监控采集作业、任务生命周期及集群指标。
  5. 开箱即用:支持 SQLite 极速体验,支持 MySQL/PostgreSQL 生产环境部署,提供完善的 Docker 与运维脚本。

🌐 Ecosystem & Integrations

Agent Control is designed to seamlessly interoperate with the broader agent and developer tooling ecosystem:


🤝 Contributing

Contributions, bug reports, and feature requests are very welcome! Please check our Contributing Guide and Code of Conduct.

📄 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

agent-control (loulanyue/agent-control)

Searching Database…

这是什么?Agent Control 是一个面向自主 AI 智能体的生产级控制平面和编排引擎,负责分布式任务分发、心跳租约、DAG 工作流执行和数据爬取流水线,并内置面向 Claude Desktop 和 Cursor 等 LLM 客户端的 MCP 服务器。
它是我导入的框架,还是我要运行的独立服务?它是一个基于 FastAPI、Uvicorn 和 SQLAlchemy 2.0 构建的独立服务器,以服务方式运行,对外提供 REST API、网页仪表盘和 MCP 服务器。另有一个独立的、完全带类型的 Python SDK(agent-control-sdk),用于与该运行中的服务通信。
怎么把它跑起来?有三种方式:一键启动脚本、用单条命令拉起完整 FastAPI + MySQL 8.0 技术栈的 Docker Compose,或者在 Python 3.10+ 上手动安装。
需要真正的数据库吗,还是试用 SQLite 就够了?SQLite 零配置开箱即用,适合本地原型验证;企业生产部署支持 MySQL 或 PostgreSQL。手动安装需要 Python 3.10+。
内置爬虫是通用的,还是绑定特定数据源?自带的爬虫是为特定用例构建的,例如政府人才资质公告和企业招标数据,并非通用爬虫,因此要抓取其他网站需要自行改造。
MCP 集成实际是怎么工作的?Agent Control 自带一个原生 MCP 服务器(mcpserver.py),暴露 10 个标准化工具,让 Claude Desktop、Cursor 或 Claude Code 可以通过 JSON-RPC stdio 列出智能体和任务、分发任务、查看 DAG 图、拉取系统指标,并执行安全的 MySQL 读写查询。
Python SDK 能做什么?官方 agent-control-sdk 完全带类型,让你以编程方式分发任务、管理智能体集群并监控 DAG 工作流执行,而无需直接调用 REST API。
仪表盘能看到什么?开箱即用的响应式仪表盘可实时查看智能体状态、任务状态、爬取运行情况和集群指标。
有真实项目在用它吗?有——Dream XI AI(一个多智能体协作平台)使用 Agent Control 作为其分布式控制平面和调度引擎,Awesome Claude Notes 和 Spec Kit ZH 等项目也引用了它。
Creator
loulanyue
Size
1 MB
Stars
195
Age
19d
Commits · 90 Days