复制安装命令
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
The standard virtual filesystem for AI agents.
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
来源文件:README.md
ToolFS is a specialized virtual filesystem framework designed for Large Language Model (LLM) agents. It unifies disparate interfaces—files, persistent memory, semantic search (RAG), and code execution (WASM skills)—into a single, POSIX-compliant /toolfs namespace.
By mapping complex state and capabilities to filesystem operations, ToolFS leverages the LLM's inherent understanding of path structures and file manipulation, significantly reducing the complexity of tool integration.
Current AI agent architectures often suffer from "tool bloat," where managing dozens of disparate APIs becomes a bottleneck. ToolFS solves this by providing:
/toolfs) for files, session-bounded memory, vector-based RAG queries, and autonomous skills.ToolFS acts as an abstraction layer between the Agent and its environment:

ToolFS Internal Architecture
[ Agent ] <──> [ /toolfs Virtual Path ] <──> [ ToolFS Core ]
│
┌──────────────┬──────────────┬───────┴──────┬──────────────┐
▼ ▼ ▼ ▼ ▼
[ Local FS ] [ Memory KV ] [ RAG Store ] [ WASM Skills ] [ Snapshots ]
go get github.com/IceWhaleTech/toolfs
Combine memory, RAG, and file access in a few lines:
package main
import (
"github.com/IceWhaleTech/toolfs"
)
func main() {
// Initialize with a root mount point
fs := toolfs.NewToolFS("/toolfs")
// Isolated session with path-level permissions
session, _ := fs.NewSession("agent-007", []string{"/toolfs/data", "/toolfs/memory", "/toolfs/rag"})
// Persistent Context (Memory)
fs.WriteFileWithSession("/toolfs/memory/last_query", []byte("How to build an agent?"), session)
// Semantic Retrieval (RAG)
// Simply read a virtual path!
results, _ := fs.ReadFileWithSession("/toolfs/rag/query?text=agent+design&top_k=3", session)
// Skill Execution
// Chains multiple operations: search memory -> execute skill -> save result
ops := []toolfs.Operation{
{Type: "search_memory", Query: "preferences"},
{Type: "execute_code_skill", SkillPath: "/toolfs/skills/processor"},
}
fs.ChainOperations(ops, session)
}
Optimized for high-frequency agent loops. Tested on Apple M4 Pro.
| Operation | Throughput | Latency | Overhead |
|---|---|---|---|
| Memory Access | 1,200,000+ ops/s | <1 μs | 0 allocations |
| Path Resolution | 35,000,000+ ops/s | <30 ns | Cache-driven |
| RAG Search | 170,000+ ops/s | ~6 μs | Highly efficient |
| File I/O (Small) | 110,000+ ops/s | ~9 μs | Local-first |
While both focus on agent state, they serve different primary roles:
| Feature | ToolFS | AgentFS |
|---|---|---|
| Primary Goal | Unified Tool/Storage Abstraction | Structured State & Audit Trails |
| Storage Engine | Virtual Layer (File, Memory, RAG) | SQLite-backed |
| Tool Execution | Native & WASM Skills (Unified API) | Focus on CRUD of state |
| Audit Model | Per-path/Per-session logs | Transactional SQL logs |
Intersection: Both can be used together—AgentFS for deep structured memory, and ToolFS for providing a standard filesystem-like API to that memory alongside other tools.
ToolFS is inspired by the pattern of using filesystems as the primary interface for autonomous agents:
Built for the future of Autonomous Agents.
name: toolfs-rag
description: Semantic search over vector databases for document retrieval. Use this skill when the user requests searching documents, finding relevant content, or performing semantic queries such as "Search for information about X", "Find documents related to Y", or "Query the knowledge base".
metadata:
author: toolfs
version: "1.0.0"
module: ragSemantic search over vector databases for document retrieval. RAG (Retrieval-Augmented Generation) enables finding relevant documents and content based on semantic similarity rather than exact keyword matches.
ToolFS Path:
/toolfs/rag/query?text=<query_text>&top_k=<number>
Parameters:
text or q: The search query (URL-encoded)top_k: Number of results to return (default: 5)Example:
GET /toolfs/rag/query?text=ToolFS%20skill%20architecture&top_k=3
// Response
{
"query": "ToolFS skill architecture",
"top_k": 3,
"results": [
{
"id": "doc-001",
"content": "ToolFS provides a skill system that supports WASM modules for sandboxed execution. Skills can be mounted to virtual paths and executed through the Skill API.",
"score": 0.95,
"metadata": {
"source": "documentation",
"section": "skills",
"title": "Skill System Overview"
}
},
{
"id": "doc-002",
"content": "The skill architecture allows mounting custom handlers to virtual paths, enabling extensible functionality within the ToolFS framework.",
"score": 0.87,
"metadata": {
"source": "documentation",
"section": "architecture",
"title": "Architecture Design"
}
},
{
"id": "doc-003",
"content": "WASM skills are executed in a sandboxed environment with resource limits and security constraints to ensure safe operation.",
"score": 0.82,
"metadata": {
"source": "documentation",
"section": "sandboxing",
"title": "Security Model"
}
}
]
}
Use RAG skill when you need to:
Common use cases:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
text or q | string | Yes | - | Search query text (URL-encoded) |
top_k | integer | No | 5 | Number of results to return |
Each result includes:
RAG operations return standardized result structures:
{
"type": "rag",
"source": "/toolfs/rag/query",
"content": {
"query": "...",
"top_k": 3,
"results": [...]
},
"success": true,
"error": "error message if failed"
}
When presenting RAG search results:
✓ RAG search completed
Query: ToolFS skill architecture
Results: 3 matches found
1. doc-001 (score: 0.95)
Source: documentation > skills
Title: Skill System Overview
Content: ToolFS provides a skill system that supports WASM modules...
2. doc-002 (score: 0.87)
Source: documentation > architecture
Title: Architecture Design
Content: The skill architecture allows mounting custom handlers...
3. doc-003 (score: 0.82)
Source: documentation > sandboxing
Title: Security Model
Content: WASM skills are executed in a sandboxed environment...
If search returns no results:
If results are not relevant:
top_k to see more optionsThis skill is part of ToolFS. See main SKILL.md for overview.
评论 (0)
暂无评论,成为第一个评论者吧!