Installation
Quick Start
Core APIs
AgentFS Class
The main entry point for all AgentFS operations.AgentFS.open(path: string, options?: AgentFSOptions)
Creates or opens an AgentFS database.
Properties
kv: Key-value store interfacefs: Filesystem interfacetools: Tool call tracking interfacedb: Direct access to the underlying Turso database
Key-Value Store API
Fast, typed storage for agent state and configuration.kv.set(key: string, value: any)
Store a value with automatic JSON serialization.
kv.get<T>(key: string): Promise<T | null>
Retrieve a value with automatic deserialization.
kv.delete(key: string)
Remove a key-value pair.
kv.list(options?: ListOptions)
List keys with optional filtering.
kv.clear()
Remove all key-value pairs.
Filesystem API
POSIX-like filesystem operations for managing agent data.fs.writeFile(path: string, data: string | Buffer)
Write data to a file, creating parent directories as needed.
fs.readFile(path: string): Promise<Buffer>
Read file contents as a Buffer.
fs.mkdir(path: string, options?: MkdirOptions)
Create a directory.
fs.readdir(path: string): Promise<string[]>
List directory contents.
fs.stat(path: string): Promise<Stats>
Get file or directory metadata.
fs.exists(path: string): Promise<boolean>
Check if a file or directory exists.
fs.rm(path: string, options?: RmOptions)
Remove a file or directory.
fs.rename(oldPath: string, newPath: string)
Move or rename a file or directory.
fs.copyFile(src: string, dest: string)
Copy a file to a new location.
Tool Call Tracking API
Record and query agent tool invocations for debugging and compliance.tools.record(name, startTime, endTime, input, output)
Record a tool invocation.
tools.list(options?: ToolListOptions)
Query recorded tool calls.
tools.get(id: string)
Get details of a specific tool call.
tools.delete(id: string)
Remove a tool call record.
tools.clear()
Remove all tool call records.
Browser Support
AgentFS works in browser environments using WebAssembly:Support
- GitHub Issues - Bug reports and feature requests
- Discord - Community support and discussions
- Examples - Sample applications