Skip to content

TheAgenticWeb/agentic-web-starter-kit

Repository files navigation

Agentic Web Starter Kit

Agentic Task Manager Demo

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.

✨ Features

Demo Application: AI-Powered Task Manager

  • πŸ“‹ 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

Core Features

  • πŸ€– 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 /docs folder

Quick Start

Prerequisites

  • Node.js 18+ (20+ recommended)
  • OpenAI API key - Get one here
  • pnpm (recommended) or npm

Installation

  1. Clone and install dependencies:
git clone <repository-url>
cd agentic-web-starter-kit
pnpm install
cd src/backend && pnpm install && cd ../..
  1. Set up environment variables:

Copy the template and add your API keys:

cp env.template .env

Minimum required (to get started):

OPENAI_API_KEY=your-openai-api-key-here

Optional 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
  1. Start the development servers:
pnpm dev

This runs both:

  1. 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"

Project Architecture

Frontend (Next.js + Cedar-OS)

  • 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

Backend (Mastra)

  • 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

API Endpoints (Mastra backend)

Non-streaming Chat

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."
}

Streaming Chat

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: done signal

Development

Running the Project

# Start both frontend and backend
npm run dev

# Run frontend only
npm run dev:next

# Run backend only
npm run dev:mastra

πŸ“– Documentation

Comprehensive guides in the /docs folder:

🎯 What's Included

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

πŸš€ Next Steps

  1. Explore the examples - Try the demo tools and modify them
  2. Add your first custom tool - See docs/tools-system.md
  3. Enable web search - Add EXA_API_KEY to search the web
  4. Set up chat history - Migrate to Supabase for production: docs/chat-history.md
  5. Add authentication - Secure your app: docs/authentication.md
  6. Deploy - Ship to production: docs/deployment.md

πŸ”§ Technology Stack

  • 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)

πŸ’‘ Pro Kits (Coming Soon)

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

🀝 Contributing

Contributions welcome! Please read our contributing guidelines before submitting PRs.

πŸ“„ License

MIT License - see LICENSE file for details.

πŸ”— Resources


Built for developers who want to ship agentic web apps fast. πŸš€

About

A production-ready Next.js starter kit with Cedar-OS chat UI and Mastra agent orchestration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published