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、会话与自治运行时的核心能力,同时把依赖压到最小:
workspace/ 与 configs/Role-first, not agent-first: 主体不是“agent 实例”,而是“岗位 / worker”Organization-aware: 多个 AI 不是简单 multi-agent 通信,而是有职责边界、协作关系和归属路由Governable by design: 权限、审计、信任分级、人在回路是系统能力,不靠 prompt 口头约束Learning with approval: 学习不是自动沉淀自动生效,而是“提议 -> 审核 -> 生效”Goal-driven autonomy: 主动性不是单纯 cron 到点执行,而是围绕结构化目标做状态偏离判断One runtime, many triggers: 对话、任务、事件、巡检共享同一条岗位执行管线| 维度 | 常见个人助手 / 通用 Agent | genworker |
|---|---|---|
| 主体 | 一个用户的 agent 或 workspace | 一个组织里的岗位 / worker |
| 角色定义 | prompt + 工具配置 | 系统注册的岗位对象 |
| 记忆边界 | 围绕“我”的全局记忆池 | 岗位经验与租户数据分层隔离 |
| 学习方式 | 自动沉淀,往往自动生效 | 提议、审核、生效、衰减的生命周期 |
| 多角色协作 | multi-agent 通信或路由 | 职责边界、协作关系、归属路由 |
| 主动性 | cron / 定时触发 | 目标驱动 / 状态偏离驱动 |
| 工作模式 | 对话、任务、事件常常分散实现 | 对话、任务、事件、巡检共享执行管线 |
如果你的目标是“给自己用的 AI 伙伴”,Hermes、OpenClaw 一类个人助手轨道通常更合适;如果你的目标是“给组织用、占岗位、可治理、可追溯的数字员工”,genworker 更适合。
POST /api/v1/chat/streamPOST /api/v1/worker/task/streamGET /healthGET /readinessGET /api/v1/debug/runtime默认运行方式非常直接:
configs/ 管理分层配置workspace/ 管理 tenant、worker、skill、personapython start.py 直接启动运行时/health、/readiness、/api/v1/debug/runtime 观察当前状态这意味着你可以先在一台普通开发机上跑通,再决定是否引入反向代理、外部存储或更复杂的部署拓扑。
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
最小可运行配置:
cp configs/config.example.env configs/config_local.env
如果你已经习惯只维护 configs/config_local.env,也可以直接编辑它;运行时会优先读取 configs/ 下的分层配置。根目录 .env.example 主要用于给容器、CI 或外部启动包装器做参考,不是 start.py 的主配置入口。
python start.py
默认是本地轻量模式:
RUNTIME_PROFILE=localREDIS_ENABLED=falseMYSQL_ENABLED=falseOPENVIKING_ENABLED=falseIM_CHANNEL_ENABLED=falsecurl -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,说明主链路已经启动完成。
对话流示例:
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。
配置说明见 docs/CONFIGURATION.md。
重点规则:
configs/ 读取,不依赖当前 shell 所在目录LOG_DIR 如果写相对路径,会按项目根目录解析workspace 根目录固定为 <project>/workspacestart.py 会在启动前切回项目根目录,避免从其他目录启动时路径漂移可直接参考的模板:
.env.exampleconfigs/config.example.envconfigs/profiles/local.envconfigs/profiles/local_memory.envconfigs/profiles/advanced.envconfigs/profiles/enterprise.env把 genworker 看成四层会更容易理解:
workspace/ 中的 tenant、worker、skill、persona 定义默认本地模式只强依赖前 3 层。
| 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 只是模板,不会锁死你的部署方式;最终仍以进程环境变量为最高优先级。
.
├── configs/ # 分层配置与 profile 模板
├── docs/ # 架构与配置文档
├── frontend/ # 前端静态资源
├── src/ # 运行时实现
├── tests/ # 单元 / 集成测试
├── workspace/ # 默认运行时工作区
├── workspace.example/ # 示例工作区模板
└── start.py # 本地启动入口
python start.py 启动API_BEARER_TOKEN 或 API_KEY/health 只看进程是否活着,/readiness 看默认主链路是否可服务workspace.example/ 适合用于初始化新的 Worker 目录结构tests/ 同时包含单元测试和集成测试,适合作为二次开发回归基线架构细节见 docs/ARCHITECTURE.md。