A highly capable, personable, and context-aware personal assistant built with OpenAI Agents and deployed on Cloudflare Workers.
- 🤖 AI-powered personal assistant
- 📅 Schedule creation and management
- 🔍 Web search capabilities
- 💬 Conversational interface
- ☁️ Cloudflare Workers deployment
- 💾 Persistent chat history with KV storage
- Node.js 18+
- npm or yarn
- Cloudflare account
- OpenAI API key
- Install dependencies:
npm install
- Create a
.env
file with your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
- Run the CLI version locally:
npm start "your message here"
npm install -g wrangler
wrangler login
Create KV namespaces for storing chat data:
# Create production namespace
wrangler kv:namespace create "CHAT_STORAGE" --preview=false
# Create staging namespace
wrangler kv:namespace create "CHAT_STORAGE" --preview=true
Update the wrangler.toml
file with your KV namespace IDs:
[[env.production.kv_namespaces]]
binding = "CHAT_STORAGE"
id = "your-production-kv-namespace-id"
[[env.staging.kv_namespaces]]
binding = "CHAT_STORAGE"
id = "your-staging-kv-namespace-id"
Set your OpenAI API key as a secret:
# For production
wrangler secret put OPENAI_API_KEY
# For staging
wrangler secret put OPENAI_API_KEY --env staging
# Deploy to staging
npm run deploy:staging
# Deploy to production
npm run deploy
For local development with Wrangler:
npm run dev
Once deployed, visit your Cloudflare Workers URL to access the web interface. The assistant can help you with:
- Creating schedules and appointments
- Answering questions with web search
- General conversation and assistance
- Note-taking and reminders
GET /
- Web interfacePOST /api/chat
- Chat API endpoint
{
"message": "Create a schedule for tomorrow at 3pm",
"chatId": "optional_chat_id_for_context"
}
{
"success": true,
"response": "Your schedule has been created...",
"chatId": "chat_1234567890"
}
- Frontend: HTML/CSS/JavaScript with a modern, responsive UI
- Backend: Cloudflare Workers with OpenAI Agents
- Storage: Cloudflare KV for persistent chat history
- Tools: Web search and schedule creation capabilities
OPENAI_API_KEY
- Your OpenAI API key (required)
ISC