Step 1: Project Setup
Step 1: Project Setup
Create the Project
npx create-kernova-app devops-agentcd devops-agentAdd your API key:
OPENAI_API_KEY=sk-proj-your-keyCreate the File Structure
We need more directories than a simple project:
mkdir triggersmkdir channelsmkdir workflowsmkdir tasksYour final structure:
devops-agent/├── agents/│ └── devops.agent.ts ← Main agent (schedule, triggers, permissions)├── agents/tools/│ ├── check-health.ts ← Hit /health endpoints│ ├── get-metrics.ts ← Read CPU/memory/requests│ ├── restart-service.ts ← Restart (requires approval!)│ └── web-search.ts ← Default web search├── triggers/│ └── on-alert.ts ← React to infrastructure alerts├── channels/│ └── webhook.ts ← Receive external webhooks├── workflows/│ └── incident-response.ts ← Multi-step durable workflow├── tasks/│ └── send-notification.ts ← Background notification task├── memory/│ └── incidents.ts ← Remember past incidents├── app/│ └── chat/page.tsx ← Dashboard/chat interface└── kernova.config.tsDelete the Default Agent
rm agents/assistant.agent.tsUnderstanding This Architecture
This project is different from the previous tutorials:
| Previous tutorials | This tutorial |
|---|---|
| Agent waits for user messages | Agent acts on its own (schedule + triggers) |
| Single interaction model | Continuous monitoring model |
| No approval needed | Dangerous actions need human approval |
| Simple request → response | Multi-step durable workflows |
The DevOps agent is always running. It checks health every 5 minutes, generates reports at 9am, and responds to alerts instantly — without anyone typing a message.
Key Concept: Autonomous vs Reactive
Most AI agents are reactive — they respond when you ask. This agent is autonomous — it acts on its own based on:
- Schedules — “Check health every 5 minutes”
- Triggers — “When an alert fires, investigate”
- Channels — “When a webhook arrives, process it”
The user still can chat with it (to ask questions or approve actions), but the agent doesn’t need the user to initiate work.