Skip to main content
AgentFS is a specialized filesystem and state management SDK designed for AI agents. It provides a complete, queryable, and portable solution for managing agent state, files, and interactions—all powered by Turso’s embedded database technology.

Why AgentFS?

Building reliable AI agents requires solving fundamental challenges:
  • State Management: Agents need persistent memory across sessions
  • Auditability: Every action must be traceable for debugging and compliance
  • Reproducibility: Agent states must be snapshottable and restorable
  • Simplicity: Complex distributed systems shouldn’t be required for agent development
AgentFS solves these challenges with a single, portable database file that contains your entire agent runtime.

Key Features

Virtual Filesystem

POSIX-like file and directory operations for agent data management

Key-Value Store

Fast, typed storage for agent state and configuration

Tool Call Tracking

Automatic audit logging of all agent tool invocations

Single File Storage

Entire agent runtime in one portable Turso database

Core Capabilities

🗄️ Unified Storage

Everything your agent needs—files, state, history—stored in a single database file. No complex infrastructure, just one file you can query, backup, or move.

🔍 Built-in Auditability

Every filesystem operation, state change, and tool call is automatically recorded. Query your agent’s behavior with SQL:
-- Find all web searches performed by the agent
SELECT * FROM toolcalls
WHERE name = 'web_search'
ORDER BY timestamp DESC;

-- Analyze file modifications
SELECT * FROM events
WHERE type = 'file_write'
AND timestamp > datetime('now', '-1 hour');

🔄 State Reproducibility

Snapshot agent states at any point and restore them later. Perfect for:
  • Debugging complex agent behaviors
  • Testing different execution paths
  • Creating checkpoints in long-running workflows

📦 Portability

Move your entire agent between environments with a single file. Development to production, cloud to edge—your agent’s complete state travels with it.

Architecture

AgentFS provides three main interfaces: All operations are atomic and transactional, ensuring data consistency even during failures.

Quick Example

import { AgentFS } from 'agentfs-sdk';

// Open or create an agent filesystem
const agent = await AgentFS.open(
  './my-agent.db'
);

// Store agent configuration
await agent.kv.set('agent:config', {
  model: 'gpt-4',
  temperature: 0.7,
  maxTokens: 2000
});

// Write generated content
await agent.fs.writeFile(
  '/outputs/report.md',
  reportContent
);

// Track tool usage
await agent.tools.record(
  'generate_report',
  startTime,
  endTime,
  { topic: 'Q4 Analysis' },
  { success: true, pages: 15 }
);

// Query the agent's work
const recentFiles = await agent.fs.readdir('/outputs');
const toolHistory = await agent.tools.list({ limit: 10 });

Use Cases

Development & Testing

Develop agents locally with full state persistence and debugging capabilities

Production Deployment

Deploy agents with built-in logging, monitoring, and state management

Compliance & Auditing

Track every agent action for regulatory compliance and accountability

Multi-Agent Systems

Share state between agents or maintain isolation with separate databases

Getting Started

Ready to build more reliable AI agents? Start with our quickstart guide:

AgentFS Quickstart

Set up AgentFS and build your first stateful agent in minutes

Available SDKs

Learn More

AgentFS is currently in ALPHA. We recommend using it for development and testing only. The API may change as we gather feedback from the community.