SurrealDB filesystem
A filesystem-based memory layer for agents, with hybrid search, backed by SurrealDB.
[!WARNING]
SurrealFS is in beta. The API, schema, and CLI may change in breaking ways
between releases, and it is not yet recommended for production use. Bug
reports and feedback are very welcome.
Give an agent somewhere durable to keep its work. SurrealFS is a file table
plus the tools to hand it to a model: files and folders, full-text and semantic
search, all queryable with SurrealQL because it is just a table.

The file browser is a standalone tool that can be used to browse and edit files in a SurrealDB database.
Requirements
- Python 3.12+
- A SurrealDB 3.x server.
Install
pip install surrealfs # core, and the Hermes plugin
pip install "surrealfs[pydantic-ai]" # + the pydantic-ai toolset
pip install "surrealfs[mcp]" # + the MCP server
pip install "surrealfs[browser]" # + the file browser
Quickstart
Start a database (just db), then:
from surrealdb import AsyncSurreal
from surrealfs import SurrealFs, apply_schema
db = AsyncSurreal("ws://localhost:8000/rpc")
await db.signin({"username": "root", "password": "root"})
await db.use("surrealfs", "demo")
await apply_schema(db) # defines the `file` table; safe to re-run
fs = SurrealFs(db, user="alice") # who you are; ROOT bypasses permissions
await fs.write_text("/notes/today.md", "# Today\n- ship the refactor")
await fs.edit("/notes/today.md", "ship", "shipped")
await fs.ls("/notes")
await fs.search_text("refactor")
You create and own the connection. SurrealFS never connects, signs in, or
selects a namespace.
user is required and has no default. Files carry a unix owner and mode, and
the database cannot tell SurrealFS who is asking (every credential is a system
credential), so the identity comes from you. See Permissions.
The plain async API
SurrealFs returns structured FileEntry and SearchHit objects, not
pre-formatted strings. Build whatever integration you like on top.