SkillAtlasSkill 详情

toolfs-rag

The standard virtual filesystem for AI agents.

审核状态:已审核Quality 80Security 100

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月1日

🗃ToolFS

The standard virtual filesystem for AI agents.

English | 中文


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.

💡 Why ToolFS?

Current AI agent architectures often suffer from "tool bloat," where managing dozens of disparate APIs becomes a bottleneck. ToolFS solves this by providing:

  • Natural Abstraction: LLMs inherently understand files and directories. Mapping tools to paths simplifies intent recognition.
  • Unified State: Session history, knowledge bases, and local files share a single lifecycle.
  • Agentic Autonomy: Context-aware skill documentation allows agents to discover and chain tools without hardcoded logic.

🎯 Key Capabilities

  • Unified Namespace: A single entry point (/toolfs) for files, session-bounded memory, vector-based RAG queries, and autonomous skills.
  • Unified Skill API: Register and execute WASM-based or native skills with context-aware documentation that helps agents understand when and how to use them.
  • Session-Bounded Security: Fine-grained path-based permissions and isolated environments for multi-tenant agent deployments.
  • Atomic Snapshots: Create instant, copy-on-write snapshots of the entire agent environment for rollback, debugging, and perfect reproducibility.
  • Audit-Ready: Transparent JSON-based audit logging for every operation, ensuring compliance and observability.

🛠 Architecture

ToolFS acts as an abstraction layer between the Agent and its environment:

ToolFS Architecture

ToolFS Internal Architecture

[ Agent ] <──> [ /toolfs Virtual Path ] <──> [ ToolFS Core ]
                                                     │
               ┌──────────────┬──────────────┬───────┴──────┬──────────────┐
               ▼              ▼              ▼              ▼              ▼
         [ Local FS ]   [ Memory KV ]   [ RAG Store ]   [ WASM Skills ] [ Snapshots ]

🚀 Quick Start

1. Installation

go get github.com/IceWhaleTech/toolfs

2. Integration Example

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)
}

⚡ Performance

Optimized for high-frequency agent loops. Tested on Apple M4 Pro.

OperationThroughputLatencyOverhead
Memory Access1,200,000+ ops/s<1 μs0 allocations
Path Resolution35,000,000+ ops/s<30 nsCache-driven
RAG Search170,000+ ops/s~6 μsHighly efficient
File I/O (Small)110,000+ ops/s~9 μsLocal-first

🧩 ToolFS vs. AgentFS

While both focus on agent state, they serve different primary roles:

FeatureToolFSAgentFS
Primary GoalUnified Tool/Storage AbstractionStructured State & Audit Trails
Storage EngineVirtual Layer (File, Memory, RAG)SQLite-backed
Tool ExecutionNative & WASM Skills (Unified API)Focus on CRUD of state
Audit ModelPer-path/Per-session logsTransactional 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.

🙏 Inspirations

ToolFS is inspired by the pattern of using filesystems as the primary interface for autonomous agents:

📚 Documentation


Built for the future of Autonomous Agents.

数据与 AI文档与办公研究与检索内容与创作Agent / MCP / Skill 创作

低风险

  • 来源需自行核对维护者身份。
  • 未检测到明显脚本安装指令。
  • 未检测到明显外部权限要求。
  • 未检测到高风险命令。
  • 扫描发现:0 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/IceWhaleTech/ToolFS.git
  3. 将 "skills/rag" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/IceWhaleTech/ToolFS.git
  3. 将 "skills/rag" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/IceWhaleTech/ToolFS.git
  3. 将 "skills/rag" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/IceWhaleTech/ToolFS.git
  3. 将 "skills/rag" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/IceWhaleTech/ToolFS.git
  3. 将 "skills/rag" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
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: rag

ToolFS RAG

Semantic 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.

How It Works

  1. Vector Search: Queries are converted to embeddings and compared against document vectors
  2. Similarity Scoring: Results are ranked by semantic similarity scores
  3. Top-K Results: Returns the most relevant documents up to the specified limit
  4. Metadata Filtering: Results include metadata for context and filtering

Usage

Semantic Search

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"
      }
    }
  ]
}

When to Use This Skill

Use RAG skill when you need to:

  • Semantic Search: Find documents based on meaning, not just keywords
  • Knowledge Retrieval: Query a knowledge base or document collection
  • Context Gathering: Gather relevant context for generating responses
  • Document Discovery: Discover related content across a corpus

Common use cases:

  • "Search for information about ToolFS skills"
  • "Find documents related to vector databases"
  • "Query the knowledge base for best practices"
  • "Find relevant documentation about RAG systems"

Query Parameters

ParameterTypeRequiredDefaultDescription
text or qstringYes-Search query text (URL-encoded)
top_kintegerNo5Number of results to return

Result Structure

Each result includes:

  • id: Document identifier
  • content: Document content snippet
  • score: Similarity score (0.0 to 1.0, higher is better)
  • metadata: Optional metadata (source, title, section, etc.)

Output Format

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"
}

Present Results to User

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...

Troubleshooting

No Results Found

If search returns no results:

  1. Try a different query or rephrase the search
  2. Reduce specificity to broaden results
  3. Verify the RAG store is populated with documents
  4. Check if the query is properly URL-encoded

Low Quality Results

If results are not relevant:

  1. Increase top_k to see more options
  2. Refine the query with more specific terms
  3. Check if document embeddings are up to date
  4. Verify the RAG store contains relevant documents

Best Practices

  1. Use Semantic Queries: RAG works best with natural language queries, not just keywords
  2. Adjust top_k: Start with 5-10 results, adjust based on use case
  3. Review Scores: Higher scores (>0.8) indicate strong relevance
  4. Check Metadata: Use metadata to filter or categorize results
  5. Combine Results: Combine multiple search queries for comprehensive coverage

This skill is part of ToolFS. See main SKILL.md for overview.

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!