Skip to content

codeweave

CRDT 驱动的多智能体并发编码平台 —— 让多个 AI Agent 在同一代码库上「真正并发」协作。

License Python Zero-deps core

为什么需要 codeweave

传统多智能体编码是「轮流操作」:Agent A 写完,Agent B 才能接手,串行瓶颈明显。 codeweave 基于 CRDT(无冲突复制数据类型),让多个 LLM Agent 在同一共享工作区上 真正并发编辑:字符级无锁合并、模块级分工、冗余鲁棒、并行探索,最终所有副本 确定性收敛到一致状态。

核心特性

  • 字符级 CRDT 协同编辑:树形 RGA + 版本向量 + 墓碑删除,并发编辑天然收敛
  • 完整 CRDT 工具箱:RGA 文本 / LWW Register / G-Counter / PN-Counter / OR-Set / OR-Map / 目录树
  • 多智能体编排:9 个 LLM Provider + 任务规划 + 并发执行 + 冗余投票 + 并行探索
  • 冲突检测与解决:确定性合并 + 策略化裁决(CRDT/ours/theirs/last-writer/concat)
  • 零依赖内核:核心逻辑纯 Python 标准库,离线即可运行
  • 双形态控制面:FastAPI 优先,未安装自动回退 stdlib HTTP 服务器
  • 完整工程化:Python/TypeScript SDK、React 深色控制台、Docker/K8s/Helm/CI/CD

快速开始

git clone https://github.com/huzjie/codeweave.git
cd codeweave

# 环境自检(离线可跑)
python -m codeweave.cli.main doctor

# 多智能体并发生成代码(mock 模式)
python -m codeweave.cli.main run "实现一个 API 服务" --provider mock --agents 3

# 启动控制面
python -m codeweave.cli.main serve

5 行代码体验 CRDT

from codeweave import TextDoc

a = TextDoc("agent-1", "hello")
b = TextDoc("agent-2")
b.apply(a.insert(5, " world"))   # 广播操作
merged = a.merge(b)              # 合并收敛
print(merged.text())             # 'hello world'

架构

console(React) · sdk(Python/TS)
            ↓
api(FastAPI + stdlib fallback) · cli
            ↓
agents · conflict · sync
            ↓
workspace (vfs · file · snapshot)
            ↓
crdt (rga · version · ormap · lww · tree)

目录结构

codeweave/
├── crdt/           # CRDT 内核(零依赖)
├── doc/            # diff/editor/cursor
├── workspace/      # 虚拟文件系统
├── agents/         # Provider + 编排
├── conflict/       # 冲突检测与解决
├── sync/           # 同步协议与传输
├── api/            # FastAPI + stdlib 兜底
├── cli/            # 命令行
sdk/                # Python / TypeScript SDK
console/            # React 深色控制台
deploy/             # Docker / K8s / Helm
docs/               # 完整文档
tests/              # 单元测试

文档

License

Apache-2.0,详见 LICENSE

About

CRDT 驱动的多智能体并发编码平台:让多个 AI Agent 在同一代码库上真正并发协作

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages