Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 887 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 887 Bytes

AI Agent with AgentFS on Cloudflare

This example demonstrates running an AI agent with persistent filesystem storage on Cloudflare Workers using:

  • AgentFS for persistent file storage (backed by Durable Objects SQLite)
  • just-bash for bash command execution in a virtual environment
  • Workers AI for LLM inference (Llama 3.1 70B)
  • AI SDK for the agent framework

Setup

npm install

Development

npm run dev

Deploy

npm run deploy

Usage

Send a message to the agent:

curl -X POST https://your-worker.workers.dev/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Create a file called hello.txt with Hello World"}'

The agent can:

  • Create, read, update, and delete files
  • Create directories
  • List directory contents
  • All files persist across sessions in Durable Objects SQLite storage