Basic AI agent with tool calls for task management.
- Add tasks with natural language
- List all/open/completed tasks
- Complete tasks by ID
- Server-side tool execution with Vercel AI SDK
- Install dependencies:
npm install- Create an environment file:
cp .env.example .env.local- Add your OpenRouter API key in
.env.local:
OPENROUTER_API_KEY=your_api_key_here
# optional (defaults to openai/gpt-4o-mini for lower latency)
OPENROUTER_MODEL=openai/gpt-4o-mini- Run the app:
npm run devOpen http://localhost:3000.
Add task buy milkAdd task finish project notesShow my open tasksComplete task 1
- Tasks are stored in memory for MVP simplicity.
- Data resets when the server restarts.