An interactive macOS-style desktop simulation for demonstrating AI agent patterns and concepts.
Built for the Building Better Agents workshop
Live Demo | Getting Started | Deploy to Vercel | Architecture
Agent OS is an educational demo platform that simulates a macOS desktop environment to teach fundamental AI agent concepts. Each "app" in the OS demonstrates different agent patterns, from basic script execution to advanced autonomous decision-making with approval workflows.
| Audience | Value |
|---|---|
| Developers | Learn agent architecture patterns through hands-on examples |
| Project Managers | Understand AI autonomy vs. trust tradeoffs for product decisions |
| Designers | Explore UX patterns for AI transparency and human-in-the-loop workflows |
| Workshop Attendees | Interactive playground for the Building Better Agents curriculum |
- Window Management — Drag, resize, minimize, maximize, and close windows
- Dock — App launcher with running indicators and magnification effects
- Menu Bar — System controls, time display, and app-specific menus
- Spotlight Search — Quick app launching with
Cmd + Space - Launchpad — Grid view of all available apps
- Control Center — System toggles and settings
- Desktop Widgets — Clock and calendar widgets
- Animated Wallpapers — Dynamic aurora background effects
- Context Menus — Right-click actions throughout the interface
- Boot Screen — Authentic startup animation
| App | Concept | What It Teaches |
|---|---|---|
| Terminal | Script vs. Agent Mode | Compare deterministic scripts with AI interpretation |
| Calendar | Four Pillars | Intent, Memory, Tools & Feedback loops |
| Docker | Autonomy vs. Trust | Adjustable independence with approval workflows |
| Notes | Specialization | Why focused agents outperform generalists |
- API Rate Limiting — 20 requests per minute per IP
- Input Validation — Zod schema validation on all API endpoints
- Security Headers — CSP, X-Frame-Options, and more
- Global Agent Toggle — Enable/disable AI features system-wide
- Per-App Settings — Fine-grained control over each app's AI behavior
- Approval Workflow — Modal prompts for high-risk agent actions
- Action History — Audit trail of all agent decisions
The fastest way to get Agent OS running is with Vercel's one-click deploy:
-
Fork the Repository
# Or clone and push to your own repo git clone https://github.com/RitualChain/agent-os.git cd agent-os
-
Import to Vercel
- Go to vercel.com/new
- Click Import Git Repository
- Select your forked/cloned repository
-
Configure Environment Variables
In the Vercel dashboard, add these environment variables:
Variable Required Description ANTHROPIC_API_KEYYes Your Anthropic API key from console.anthropic.com DATABASE_URLNo Neon Postgres connection string (optional, for persistence) -
Deploy
- Click Deploy
- Wait for the build to complete (typically 1-2 minutes)
- Your app will be live at
your-project.vercel.app
For persistent features like saving notes and calendar events:
- Create a free database at neon.tech
- Copy the connection string
- Add
DATABASE_URLto your Vercel environment variables - Run the migration:
# Option 1: Using Drizzle Kit npx drizzle-kit push # Option 2: Direct SQL psql $DATABASE_URL < scripts/001_create_agent_tables.sql
- Redeploy from the Vercel dashboard
- Go to Settings > Domains in your Vercel project
- Add your custom domain
- Follow the DNS configuration instructions
- Node.js 18.17+ or Bun 1.0+
- Anthropic API Key (required for AI features)
- Neon Database account (optional, for persistence)
# Clone the repository
git clone https://github.com/RitualChain/agent-os.git
cd agent-os
# Install dependencies
bun install
# or
npm install
# Set up environment variables
cp .env.example .env.localEdit .env.local with your values:
# Required for AI features
ANTHROPIC_API_KEY=your_anthropic_api_key
# Optional: Database persistence
DATABASE_URL=postgres://user:pass@host/database# Start the development server
bun dev
# or
npm run dev
# Open http://localhost:3000# Create production build
bun run build
# Start production server
bun run startagent-os/
├── app/ # Next.js App Router
│ ├── api/agent/ # AI agent API routes
│ │ ├── route.ts # Streaming agent responses
│ │ └── generate/route.ts # One-shot text generation
│ ├── globals.css # Design system & tokens
│ ├── layout.tsx # Root layout with fonts
│ └── page.tsx # Main entry point
├── components/
│ ├── apps/ # Individual app implementations
│ │ ├── terminal.tsx # Script vs Agent demo
│ │ ├── calendar.tsx # Four Pillars demo
│ │ ├── docker.tsx # Autonomy slider demo
│ │ ├── notes.tsx # AI categorization demo
│ │ └── ... # Other apps
│ ├── ui/ # Reusable UI primitives (Radix-based)
│ ├── widgets/ # Desktop widgets
│ └── ... # Desktop components
├── lib/
│ ├── agent-context.tsx # Global agent state management
│ ├── db.ts # Neon Postgres connection
│ └── utils.ts # Utility functions
├── middleware.ts # Rate limiting & security
├── SECURITY.md # Security documentation
└── scripts/
└── 001_create_agent_tables.sql # Database schema
The agent system uses React Context (AgentProvider) to manage:
interface AgentState {
globalEnabled: boolean // Master toggle
terminalMode: 'script' | 'agent' // Terminal behavior
calendarAssistantEnabled: boolean
dockerAutonomyLevel: number // 0-100 slider
notesAiEnabled: boolean
pendingActions: AgentAction[] // Awaiting approval
actionHistory: AgentAction[] // Audit trail
currentThinking: string | null // Live reasoning
isProcessing: boolean
}| Endpoint | Method | Purpose |
|---|---|---|
/api/agent |
POST | Stream AI responses with tool calling |
/api/agent/generate |
POST | One-shot text generation |
Both routes include:
- Zod input validation
- Rate limiting (20 req/min per IP)
- Error sanitization
- Open Terminal from the dock
- Click "Run Demo" or type
demo - Watch the comparison between:
- Script Mode: Deterministic
5 + 3 = 8(always) - Agent Mode: Interprets "help with 5 and 3" differently each run
- Script Mode: Deterministic
- Open Calendar from the dock
- Try natural language: "Meeting with Sarah tomorrow at 3pm"
- Observe the four pillars in action:
- Intent: Parses your request
- Memory: Remembers patterns
- Tools: Creates the event
- Feedback: Confirms success
- Open Docker from the dock
- Adjust the Autonomy Slider (0-100%)
- Try container actions at different levels:
- Low (0-30%): Every action requires approval
- Medium (30-70%): Routine actions auto-approve
- High (70-100%): Full autonomy, notification only
- Open Notes from the dock
- Create a new note with content
- Enable AI Categorization
- Watch the specialized agent suggest folders, tags, and summaries
For persistent features, Agent OS uses Neon Postgres:
-- Agent memory for learned patterns
agent_memory (app_id, memory_type, key, value)
-- Audit trail of all decisions
agent_actions_log (app_id, action_type, autonomy_level, approved, reasoning)
-- Per-app user preferences
user_preferences (app_id, autonomy_level, settings)
-- Calendar events
calendar_events (title, start_time, end_time, created_by_agent)
-- Notes with AI metadata
notes (title, content, folder, tags, ai_summary, ai_category)Run migrations:
# Using Drizzle Kit (recommended)
npx drizzle-kit push
# Or direct SQL
psql $DATABASE_URL < scripts/001_create_agent_tables.sql| Category | Technology |
|---|---|
| Framework | Next.js 16.1 (App Router) |
| Runtime | React 19, TypeScript 5 |
| Styling | Tailwind CSS 4, CSS Variables |
| Animation | Framer Motion 12 |
| UI Primitives | Radix UI |
| AI | Vercel AI SDK 6, Claude Sonnet |
| Database | Neon Postgres, Drizzle ORM |
| Validation | Zod 4 |
| Analytics | Vercel Analytics |
| Package Manager | Bun (recommended) or npm |
Agent OS includes production-ready security features:
- Rate Limiting — Middleware limits API requests
- Input Validation — All endpoints validate with Zod schemas
- Security Headers — CSP, X-Frame-Options, X-Content-Type-Options
- Environment Safety — Graceful handling of missing env vars
See SECURITY.md for the full security policy and production deployment checklist.
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow the existing code style
- Add TypeScript types for all new code
- Use semantic tokens from the design system
- Test on both light and dark modes
- Ensure mobile responsiveness
This project is licensed under the MIT License — see the LICENSE file for details.
- Apple — For the macOS design inspiration
- Vercel — For the AI SDK and hosting platform
- Anthropic — For Claude, powering the agent demos
- Radix UI — For accessible UI primitives
- Building Better Agents Workshop — The curriculum this demo supports
A huge thank you to @StarKnightt for open-sourcing the base version of the emulated macOS on v0's platform. Their foundational work made it possible to remix and extend into this demonstration showcasing applications designed for highlighting agentic enhancement techniques.
Made with care for the AI agent community