← 返回
AI智能 Key

surrealfs

SurrealFS virtual filesystem for AI agents. Rust core + Python agent (Pydantic AI). Persistent file operations backed by SurrealDB. Part of the surreal-skill...
SurrealFS 为 AI 代理提供的虚拟文件系统,采用 Rust 核心 + Python 代理(Pydantic AI),文件持久化操作基于 SurrealDB,属于 surreal-skill 系列。
24601
AI智能 clawhub v1.2.1 3 版本 99814.3 Key: 需要
★ 2
Stars
📥 1,035
下载
💾 10
安装
3
版本
#latest#surrealdb

概述

SurrealFS -- Virtual Filesystem for AI Agents

SurrealFS provides a persistent, queryable virtual filesystem backed by SurrealDB.

Designed for AI agents that need durable file operations, hierarchical storage,

and content search across sessions.

Components

ComponentCrate/PackageLanguagePurpose
---------------------------------------------
Core LibrarysurrealfsRustFilesystem operations, CLI REPL, SurrealDB storage layer
AI Agentsurrealfs-aiPython (Pydantic AI)Agent interface with tool integration, HTTP hosting

Rust Core -- Commands

The surrealfs crate provides a REPL with POSIX-like commands:

CommandDescription
----------------------
lsList directory contents
catDisplay file contents
tailShow last lines of a file
nlNumber lines of a file
grepSearch file contents
touchCreate empty file
mkdirCreate directory
write_fileWrite content to file
editEdit file contents
cpCopy file
cdChange directory
pwdPrint working directory

Supports piping from external commands: curl https://example.com > /pages/example.html

Storage backends:

  • Embedded RocksDB (local)
  • Remote SurrealDB via WebSocket

Python AI Agent

Built on Pydantic AI with tools that mirror the filesystem commands.

from surrealfs_ai import build_chat_agent

# Create the agent (default LLM: Claude Haiku)
agent = build_chat_agent()

# Expose over HTTP
import uvicorn
app = agent.to_web()
uvicorn.run(app, host="127.0.0.1", port=7932)

Features:

  • Default LLM: Claude Haiku
  • Telemetry via Pydantic Logfire (OpenTelemetry) -- see Security section for opt-out
  • All filesystem operations available as agent tools
  • HTTP hosting (default port 7932, bound to 127.0.0.1)
  • Path normalization: virtual FS root / is isolated; paths cannot escape to host filesystem

Quick Start

# Install the Rust core
cargo install surrealfs

# Start the REPL with embedded storage
surrealfs

# Or connect to a remote SurrealDB instance
surrealfs --endpoint ws://localhost:8000 --user root --pass root --ns agent --db workspace

# Install the Python agent
pip install surrealfs-ai

# Run the agent HTTP server
python -m surrealfs_ai --host 127.0.0.1 --port 7932

Use Cases

  • Persistent workspace for AI agent sessions
  • Hierarchical document storage with metadata queries
  • Multi-agent shared file access with SurrealDB permissions
  • Content strategy and knowledge management
  • Project scaffolding and template management

Security Considerations

Credentials: Remote SurrealDB connections require --user/--pass. Use

dedicated, least-privilege credentials scoped to a specific namespace/database.

Never use root credentials in shared or production environments.

Telemetry: The Python agent uses Pydantic Logfire (OpenTelemetry). To

disable telemetry, set: export LOGFIRE_SEND_TO_LOGFIRE=false or configure

Logfire with send_to_logfire=False in code. Audit telemetry endpoints before

enabling in environments with sensitive data.

HTTP binding: The agent binds to 127.0.0.1 by default. Do not expose to

0.0.0.0 or public networks without authentication and TLS. If running in a

container, use network isolation.

Pipe commands: The Rust core supports curl URL > /path syntax for content

ingress. This executes the pipe source command on the host. Use only with

trusted URLs in controlled environments. Do not allow untrusted input to

construct pipe commands.

Sandboxing: The virtual FS root (/) is a SurrealDB-backed abstraction,

not the host filesystem. Path traversal (e.g., ../../etc/passwd) is

normalized and rejected. However, pipe commands execute on the host -- run

in a container or sandbox if accepting untrusted agent input.

Full Documentation

See the main skill's rule file for complete guidance:

版本历史

共 3 个版本

  • v1.2.0
    2026-03-29 11:16 安全 安全
  • v1.2.1 当前
    2026-03-27 20:48 安全 安全
  • v1.1.1
    2026-03-07 01:52

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 709 📥 243,546
developer-tools

Deep Research (Gemini)

24601
通过 Gemini Interactions API 进行异步深度研究(无需 Gemini CLI 依赖)。在本地文件上进行 RAG 基础查询 (--context),预览成本 (--dry-run),结构化...
★ 3 📥 3,857
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,056 📥 796,297