Gives your AI agent a simple memory across sessions. It stores conversation context in your Cloudflare KV so work can carry over after a restart, redeploy, or the next day. There is no intermediary service.
Live Instance: https://baton-ai.casey-digennaro.workers.dev
Most LLM sessions reset to zero. You end up repeating the same background and instructions. This was built because existing solutions often add unnecessary complexity or depend on third-party services.
- Fork this repository.
- Deploy directly to Cloudflare Workers from your fork:
npx wrangler deploy
- Add your preferred LLM's API key as a Cloudflare Secret (e.g.,
LLM_API_KEY).
Visit your worker's /setup endpoint for a detailed guide.
- You Own Everything: All memory is stored in your Cloudflare KV. No third-party service holds your data or sees your context.
- Zero Dependencies: A single Worker file. No
node_modules, no external packages. - No LLM Lock-In: Switch between supported providers (like DeepSeek, Moonshot, or OpenAI-compatible endpoints) by changing one environment variable.
- Persist agent memory across sessions and deployments.
- Standard fleet endpoints for
/health,/chat,/context, and seeding memory. - Your API keys remain as secrets within your Cloudflare account.
- Fork-first deployment: you control your own instance.
- MIT licensed, open source.
- Runs on Cloudflare's global edge network.
A single, stateless Cloudflare Worker. All agent state is written to and read from your provisioned KV namespace. Requests route directly from the edge to your configured LLM provider.
Each stored memory entry is capped at 10KB, imposed by the Cloudflare KV platform. This is suitable for retaining context and instructions, but not for storing large documents.
You can test the public instance first:
curl https://baton-ai.casey-digennaro.workers.dev/healthNote: The public demo resets daily. Do not send sensitive data. For real usage, deploy your own instance.
Fork the repo, test changes on your deployed instance, then open a pull request. This project follows the Cocapn Fleet fork-first workflow.
License: MIT