genworker

CI Python Mode Transport

The local-first runtime for digital workers that hold roles, follow rules, and evolve under governance.

Quick Start API Configuration Deployment Architecture

genworker 是一个面向“数字员工 / 数字工人”场景的 filesystem-first runtime。

它不是把一个通用 Agent 包一层 prompt 再长期运行,而是把“岗位”作为系统里的主对象来运行:

默认形态下,它保留了多 Worker、Skill、Tool、MCP、会话与自治运行时的核心能力,同时把依赖压到最小:

Core Characteristics

What You Can Do With It

How It Is Different

维度 常见个人助手 / 通用 Agent genworker
主体 一个用户的 agent 或 workspace 一个组织里的岗位 / worker
角色定义 prompt + 工具配置 系统注册的岗位对象
记忆边界 围绕“我”的全局记忆池 岗位经验与租户数据分层隔离
学习方式 自动沉淀,往往自动生效 提议、审核、生效、衰减的生命周期
多角色协作 multi-agent 通信或路由 职责边界、协作关系、归属路由
主动性 cron / 定时触发 目标驱动 / 状态偏离驱动
工作模式 对话、任务、事件常常分散实现 对话、任务、事件、巡检共享执行管线

Best Fit

Not For

如果你的目标是“给自己用的 AI 伙伴”,Hermes、OpenClaw 一类个人助手轨道通常更合适;如果你的目标是“给组织用、占岗位、可治理、可追溯的数字员工”,genworker 更适合。

Documentation

What You Get

Default Operating Model

默认运行方式非常直接:

这意味着你可以先在一台普通开发机上跑通,再决定是否引入反向代理、外部存储或更复杂的部署拓扑。

Three-Minute Quick Start

1. Install

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

2. Prepare Config

最小可运行配置:

cp configs/config.example.env configs/config_local.env

如果你已经习惯只维护 configs/config_local.env,也可以直接编辑它;运行时会优先读取 configs/ 下的分层配置。根目录 .env.example 主要用于给容器、CI 或外部启动包装器做参考,不是 start.py 的主配置入口。

3. Start

python start.py

默认是本地轻量模式:

4. Verify

curl -s http://127.0.0.1:8000/health
curl -s http://127.0.0.1:8000/readiness
curl -s http://127.0.0.1:8000/api/v1/debug/runtime

如果你看到 /readiness 返回成功,并且 /api/v1/debug/runtime 里能看到默认 worker 和当前 profile,说明主链路已经启动完成。

First Requests

对话流示例:

curl -s -N -X POST "http://127.0.0.1:8000/api/v1/chat/stream" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "你好,帮我概括一下今天应该优先处理什么",
    "thread_id": "chat-001",
    "tenant_id": "demo",
    "worker_id": "analyst-01"
  }'

任务流示例:

curl -s -N -X POST "http://127.0.0.1:8000/api/v1/worker/task/stream" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "检查我的收件箱并整理待办",
    "tenant_id": "demo",
    "worker_id": "analyst-01"
  }'

更多接口说明见 docs/API.md

Configuration

配置说明见 docs/CONFIGURATION.md

重点规则:

可直接参考的模板:

Core Runtime Model

genworker 看成四层会更容易理解:

  1. Entry Layer: HTTP / SSE / IM / Event / Scheduler
  2. Runtime Layer: WorkerRouter、Session、Task、Memory、ToolPipeline
  3. Workspace Layer: workspace/ 中的 tenant、worker、skill、persona 定义
  4. Infra Layer: Redis、OpenViking、MySQL、外部平台与代理层

默认本地模式只强依赖前 3 层。

Runtime Profiles

Profile 用途 Redis MySQL OpenViking IM
local 最小本地开发与调试 off off off off
local_memory 本地文件系统 + 语义记忆实验 off off on off
advanced 增强型运行时 on off off off
enterprise 完整企业形态模板 on on off on

这些 profile 只是模板,不会锁死你的部署方式;最终仍以进程环境变量为最高优先级。

Repository Layout

.
├── configs/                  # 分层配置与 profile 模板
├── docs/                     # 架构与配置文档
├── frontend/                 # 前端静态资源
├── src/                      # 运行时实现
├── tests/                    # 单元 / 集成测试
├── workspace/                # 默认运行时工作区
├── workspace.example/        # 示例工作区模板
└── start.py                  # 本地启动入口

Development Notes

架构细节见 docs/ARCHITECTURE.md