Files
myWiki/concepts/agent-workspace-filesystem.md

50 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Agent 工作空间文件系统 (Agent Workspace Filesystem)"
created: 2026-07-04
updated: 2026-07-04
type: concept
tags: [agent, filesystem, interface, workspace, token-efficiency]
sources: ["https://nokv.io/blog/agents-want-filesystems"]
---
# Agent 工作空间文件系统 (Agent Workspace Filesystem)
为 Agent 暴露类 POSIX 语义的工作空间接口(路径寻址、目录列举、按需读取、局部搜索),让 Agent 以人类工程师熟悉的方式「找东西」ls → grep → read → 引用行号。
## 为什么需要
LLM 的训练数据中大量存在 shell、Unix 工具、Git、日志排查语料——模型天然擅长「进入目录 → 列文件 → 搜关键词 → 打开局部内容 → 引用行号」的工作模式。
相比之下SQL 要求 Agent **先理解整张地图再写出正确路线**——对复合探索任务前置认知成本schema 理解、join 路径推理)会转化为 token 消耗。
## Progressive Disclosure 模式
文件系统接口的精髓是 [[progressive-disclosure|渐进式披露]]
1. **低成本发现**`ls` 看结构,`stat` 看元数据,`catalog` 看字段
2. **按需读取**:找到目标后才 `read` 打开内容
3. **范围限定搜索**:全局 `grep` 发现 + 目录内 `grep` 精准提取
4. **稳定句柄**`/runs/abc/stdout.log` — 既是名字也是地址
## 实验证据
NoKV benchmark同一份数据875 run, 80.6 万行指标),文件系统形态接口 vs 原生 SQL
- **-45% token**
- **-39% 成本**
- 复合探索任务上 2.39× 更低 token 消耗
## 与数据库的关系
不是替代,而是**分层**
- 底层:数据库负责可靠性、事务、持久化
- 上层:元数据控制层提供 Agent-friendly workspace 视图
## 参考
- [[agents-want-filesystems-nokv-2026|新智元报道Agents Want Filesystems]]
- [[nokv|NoKV]]
- [[progressive-disclosure|渐进式披露]]
- [[agent-interface-design|Agent 接口设计]]
- [[workspace-first-architecture|Workspace-first 架构]]
- [[token-efficiency|Token 效率]]