An example implementation showing how to build AI-native applications where agents control state and UI through natural language
This starter kit demonstrates the building blocks for creating agentic web apps - from state management and tool creation to agent orchestration and beautiful UI
A production-ready starter kit for building AI agent applications with modern web technologies. Built with Cedar-OS for beautiful chat UI and Mastra for powerful agent orchestration.
Includes a complete task manager demo - a real-world reference implementation showing agentic patterns in action. Use it as-is, or replace it with your own AI-native application.
Perfect for developers at theagenticweb.dev who want to build agentic web apps fast.
- π Trello-Style Board - Complete kanban board with 4 columns (To Do, In Progress, Review, Completed)
- π€ Natural Language Control - Create and manage tasks through conversation with AI
- β¨ Smooth Animations - Framer Motion powered transitions and interactions
- π¨ Priority & Tags - Color-coded priorities and flexible tagging system
- π Thread-Scoped Boards - Each conversation thread has its own task board
- π€ AI Chat Integration - Built-in chat workflows powered by OpenAI through Mastra agents
- β‘ Real-time Streaming - Server-sent events (SSE) for streaming AI responses with progress updates
- π¨ Beautiful UI - Cedar-OS components with modern design
- π§ Type-safe Workflows - Mastra-based backend with full TypeScript support
- π¬ Multi-Thread Conversations - Cedar-native thread management with persistence across page refreshes
- π― Thread-Scoped State - UI state isolated per conversation thread
- π Web Search - Built-in Exa.ai integration for real-time web search
- π Auth Ready - Auth0 for AI Agents integration (optional)
β οΈ Error Handling - Production-ready error boundaries and retry logic- π Comprehensive Docs - Complete documentation in
/docsfolder
- Node.js 18+ (20+ recommended)
- OpenAI API key - Get one here
- pnpm (recommended) or npm
- Clone and install dependencies:
git clone <repository-url>
cd agentic-web-starter-kit
pnpm install
cd src/backend && pnpm install && cd ../..- Set up environment variables:
Copy the template and add your API keys:
cp env.template .envMinimum required (to get started):
OPENAI_API_KEY=your-openai-api-key-hereOptional features (add when needed):
# Web search capability
EXA_API_KEY=your-exa-api-key
# Production chat history
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
# Authentication (see docs/authentication.md)
AUTH0_SECRET=generate-with-openssl
AUTH0_DOMAIN=your-domain.auth0.com
# ... more Auth0 vars- Start the development servers:
pnpm devThis runs both:
- Frontend: http://localhost:3000
- Backend API: http://localhost:4111
- Try it out!
Open http://localhost:3000 and start chatting with your AI task assistant. Try:
- "Create a task to review the Q4 budget in the Review column"
- "Add three tasks for the new website project"
- "Move all high priority tasks to In Progress"
- "Create a task to research competitors" (will use web search if EXA_API_KEY is set)
- "Organize my tasks by priority"
- Simple Chat UI: See Cedar OS components in action in a pre-configured chat interface
- Cedar-OS Components: Cedar-OS Components installed in shadcn style for local changes
- Tailwind CSS, Typescript, NextJS: Patterns you're used to in any NextJS project
- Chat Workflow: Example of a Mastra workflow βΒ a chained sequence of tasks including LLM calls
- Streaming Utils: Examples of streaming text, status updates, and objects like tool calls
- API Routes: Examples of registering endpoint handlers for interacting with the backend
POST /chat/execute-function
Content-Type: application/json
{
"prompt": "Hello, how can you help me?",
"temperature": 0.7,
"maxTokens": 1000,
"systemPrompt": "You are a helpful assistant."
}POST /chat/execute-function/stream
Content-Type: application/json
{
"prompt": "Tell me a story",
"temperature": 0.7
}Returns Server-Sent Events with:
- JSON Objects:
{ type: 'stage_update', status: 'update_begin', message: 'Generating response...'} - Text Chunks: Streamed AI response text
- Completion:
event: donesignal
# Start both frontend and backend
npm run dev
# Run frontend only
npm run dev:next
# Run backend only
npm run dev:mastraComprehensive guides in the /docs folder:
- Getting Started - Detailed setup and installation
- Architecture Overview - Understanding the system design
- Chat History - Persist conversations with localStorage/Supabase
- Tools System - Create custom tools for your agents
- Authentication - Secure your app with Auth0 for AI Agents
- Error Handling - Production-ready error patterns
- Deployment - Deploy to Vercel, Netlify, or self-host
agentic-web-starter-kit/
βββ docs/ # π Complete documentation
βββ src/
β βββ app/ # Next.js app (frontend)
β βββ backend/ # Mastra backend
β β βββ src/mastra/
β β βββ agents/ # AI agents
β β βββ tools/ # Agent tools (web search, etc.)
β β βββ workflows/ # Multi-step orchestration
β βββ components/ # React components
β β βββ ErrorBoundary.tsx # Error handling
β β βββ AuthButton.tsx # Auth0 integration (optional)
β βββ lib/
β β βββ storage/ # Chat history adapters
β β βββ hooks/ # React hooks (useChatHistory)
β β βββ errors/ # Error utilities
β β βββ utils/ # Retry, timeout, etc.
β βββ cedar/ # Cedar-OS components
βββ env.template # Environment variables template
- Explore the examples - Try the demo tools and modify them
- Add your first custom tool - See docs/tools-system.md
- Enable web search - Add EXA_API_KEY to search the web
- Set up chat history - Migrate to Supabase for production: docs/chat-history.md
- Add authentication - Secure your app: docs/authentication.md
- Deploy - Ship to production: docs/deployment.md
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- UI Components: Cedar-OS, Radix UI, Lucide Icons
- Backend: Mastra, OpenAI SDK
- Tools: Exa.ai (web search)
- Auth: Auth0 for AI Agents (optional)
- Storage: localStorage (dev), Supabase (production)
Looking for industry-specific features? Pro kits will include:
- π° Financial Technology - Payments, transactions, compliance
- ποΈ E-commerce - Product catalogs, cart management, orders
- π Customer Support - Ticketing, knowledge bases, escalation
- π Marketing - Campaigns, analytics, content generation
- ποΈ Vision Apps - Image processing, OCR, visual analysis
Contributions welcome! Please read our contributing guidelines before submitting PRs.
MIT License - see LICENSE file for details.
- Cedar-OS Documentation
- Mastra Documentation
- Auth0 for AI Agents
- The Agentic Web
- Next.js Documentation
Built for developers who want to ship agentic web apps fast. π
