AGFS:致敬 Plan 9 “万物皆文件”理念的 Agent 文件系统
PingCAP 联合创始人兼 CTO 黄东旭最近发布了名为「AGFS」的开源项目。
根据介绍,AGFS(Aggregated File System / Agent File System)尝试以“文件系统统一抽象”方式聚合现代多种后端服务。项目灵感来自 Plan 9 的“万物皆文件(Everything is a file)”理念,希望在当下 AI Agent 与分布式应用快速增长的背景下,提供统一的访问接口。
黄东旭在 REDDME 写道:
“万物皆文件”,向 Plan9 致敬,但以 RESTful API 的形式呈现。
本项目的初衷是寻求一种统一方法,在分布式环境中协调和编排多个 AI Agent。最终发现 bash+ 文件系统实为最佳方案,例如以下有趣模式
task_loop:https://github.com/c4pt0r/agfs/blob/master/agfs-mcp/demos/task_loop.py
AGFS 通过虚拟文件系统结构,将 对象存储(如 S3)、SQL 数据库、KV 存储、队列、流式数据、甚至 agent 心跳管理 等资源抽象成目录与文件,开发者可使用类似 ls、cat、cp 等传统文件操作访问并组合这些服务。
AGFS 服务端架构:
┌───────────────────────────────────────────────────────────────────┐
│ AGFS Server │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ RESTful API (/api/v1/*) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ MountableFS │ │
│ │ (Plugin Mount Management & Routing) │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ ↓ │
│ ┌────────────────────┴────────────────────┐ │
│ ↓ ↓ ↓ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ MemFS │ │ QueueFS │ │ ProxyFS │ │
│ │ /memfs │ │ /queuefs │ │ /proxyfs/* ├────┐ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ KVFS │ │ StreamFS │ │ S3FS │ │ │
│ │ /kvfs │ │ /streamfs │ │ /s3fs/* │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │
│ │ SQLFS │ │ ServerInfo │ │ LocalFS │ │ │
│ │ /sqlfs │ │/serverinfo │ │ /local │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │ │
│ │ │
│ ┌──────────────────────────────────────────────────────┐ │ │
│ │ HTTAGFS - HTTP File Server (:9000) │ │ │
│ │ /httagfs-* (serves any AGFS path via HTTP) ├─────┼───┼──→ Browser
│ └──────────────────────────────────────────────────────┘ │ │ curl
└───────────────────────────────────────────────────────────────┼───┘
│
HTTP Federation (ProxyFS) │
↓ │
┌─────────────────────┐ │
│ Remote AGFS Server │ ←──────────────┘
└─────────────────────┘
项目目前提供多语言实现(C++、Go、Python、Rust 等)、可跨平台运行的 server 组件,以及一个类 shell 的交互式客户端。开发者可直接通过发行版下载或使用 Docker 部署。
- agfs-shell:https://github.com/c4pt0r/agfs/tree/master/agfs-shell
- agfs-server:https://github.com/c4pt0r/agfs/blob/master/agfs-server
AGFS 的设计重点在于构建一种高度可组合的“通用接口层”,适用于多 agent 编排、任务管理和跨系统集成等场景。虽然项目仍处于早期阶段,但其在分布式系统与 AI 工作流中的潜在应用价值引发关注。
开源地址:https://github.com/c4pt0r/agfs
