AgentFS: The Filesystem Designed for AI Agents and Their State Management
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
AgentFS is an innovative filesystem specifically engineered for AI agents, providing robust storage abstractions. It leverages SQLite to offer auditability, reproducibility, and portability for agent states, tool calls, and file operations. This solution simplifies debugging, analysis, and deployment of AI agents by encapsulating their entire runtime into a single, queryable database file.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
AgentFS is a specialized filesystem designed explicitly for AI agents, offering the necessary storage abstractions for their operations. It comprises an SDK for programmatic access in TypeScript, Python, and Rust, a CLI for managing agent filesystems, and a SQLite-based specification. This project aims to provide a structured and auditable environment for agent state management.
Why Use and Benefits
AgentFS offers significant advantages for managing agent state:
- Auditability: Every file operation, tool call, and state change is recorded in a SQLite database, allowing you to query your agent's complete history for debugging, analysis, or compliance.
- Reproducibility: You can snapshot an agent's state at any point and restore it later to reproduce exact execution states, test scenarios, or roll back mistakes.
- Portability: The entire agent runtime, including files, state, and history, is stored in a single SQLite file, making it easy to move between machines, check into version control, or deploy.
AgentFS differs from other solutions by operating at the filesystem layer, providing unique capabilities. Unlike Bubblewrap, it offers persistence and queryability of the upper filesystem. It complements Docker Sandboxes by focusing on structured state management and audit trails within a secure environment. Compared to Git worktrees, AgentFS provides system-wide, enforced copy-on-write isolation, handling untracked files and ensuring safety for untrusted agents. The choice of the filesystem layer, backed by SQLite and Turso, enables queryable data, snapshotting, time-travel forking, and SDK support in diverse environments like serverless or browsers.
Installation
Using the CLI
Install the AgentFS CLI with a simple curl command:
curl -fsSL https://agentfs.ai/install | bash
Initialize an agent filesystem:
$ agentfs init my-agent
Created agent filesystem: .agentfs/my-agent.db
Agent ID: my-agent
Inspect and interact with the filesystem:
$ agentfs fs my-agent ls
Using agent: my-agent
f hello.txt
$ agentfs fs my-agent cat hello.txt
hello from agent
You can also mount an agent filesystem using FUSE (Linux) or NFS (macOS):
$ agentfs mount my-agent ./mnt
Using the SDK
Install the SDK in your project (e.g., for TypeScript):
npm install agentfs-sdk
Then, use it in your agent code:
import { AgentFS } from 'agentfs-sdk';
// Persistent storage with identifier
const agent = await AgentFS.open({ id: 'my-agent' });
// Key-value operations
await agent.kv.set('user:preferences', { theme: 'dark' });
// Filesystem operations
await agent.fs.writeFile('/output/report.pdf', pdfBuffer);
// Tool call tracking
await agent.tools.record(
'web_search',
Date.now() / 1000,
Date.now() / 1000 + 1.5,
{ query: 'AI' },
{ results: [...] }
);
Examples
The AgentFS repository includes various examples demonstrating integration with popular AI frameworks. These include research assistants built with Mastra, Anthropic's Claude Agent SDK, and OpenAI Agents. Other examples showcase usage with Firecracker VMs, Vercel AI SDK, and Cloudflare Workers. You can explore these in the examples directory.
Links
- User Manual: A comprehensive guide to the AgentFS CLI and SDK. MANUAL.md
- Agent Filesystem Specification: Technical details of the SQLite schema. SPEC.md
- SDK Examples: Working code examples for various integrations. examples/
- Turso Database: The underlying in-process SQL database compatible with SQLite. https://github.com/tursodatabase/turso
- Introducing AgentFS: Learn about the motivation behind AgentFS. https://turso.tech/blog/agentfs
- AgentFS with FUSE: Details on mounting agent filesystems. https://turso.tech/blog/agentfs-fuse
- AgentFS in the Browser: Running AgentFS with WebAssembly. https://turso.tech/blog/agentfs_browser
Related repositories
Similar repositories that may be relevant next.

CQ: An Open Standard for Shared Agent Learning by Mozilla.ai
September 5, 2026
CQ is an open standard designed to prevent AI agents from repeatedly making the same mistakes by enabling them to persist, share, and query collective knowledge. It facilitates a structured exchange of ideas, allowing agents to learn from each other's experiences and accelerate development. This system helps agents avoid redundant debugging and discover solutions more efficiently.

Agent Sandbox: Secure Local Development for AI Coding Agents
August 17, 2026
Agent Sandbox provides a robust and secure local development environment specifically designed for collaborating with AI coding agents. It ensures minimal filesystem access, configurable network egress policies, and secure secret injection, protecting your local machine from potentially risky agent operations. This project supports various AI agents and integrates seamlessly with both CLI and popular IDE devcontainer setups.

FastMCP: The Pythonic Framework for Model Context Protocol Applications
August 11, 2026
FastMCP is a robust, Pythonic framework developed by PrefectHQ, designed to simplify the creation of Model Context Protocol (MCP) servers and clients. It provides a comprehensive application framework for connecting Large Language Models (LLMs) to tools and data, handling complexities like schema generation, validation, and protocol lifecycle. As the standard framework for MCP, FastMCP empowers developers to build powerful LLM-integrated applications efficiently.

CubeSandbox: Instant, Concurrent, and Secure Sandbox for AI Agents
August 9, 2026
CubeSandbox, developed by TencentCloud, is a high-performance, secure sandbox service built on RustVMM and KVM, designed specifically for AI agents. It offers ultra-fast startup times, hardware-level isolation, and high-density deployment, making it ideal for scalable and secure agent execution environments. The service is also fully compatible with the E2B SDK for seamless integration.
Source repository
Open the original repository on GitHub.