Step 1: Create Your Project
Step 1: Create Your Project
Create It
Open your terminal and run:
npx create-kernova-app nova-assistantWait for it to finish, then enter the project:
cd nova-assistantWhat Was Generated
Let’s look at what we have:
nova-assistant/├── app/ ← Your frontend (what users see)│ ├── layout.tsx ← Root layout (wraps everything)│ ├── providers.tsx ← Kernova context provider│ ├── page.tsx ← Landing page│ ├── globals.css ← Tailwind styles│ └── chat/│ └── page.tsx ← The chat interface├── agents/ ← Your AI backend│ ├── assistant.agent.ts ← The agent definition│ └── tools/│ └── web-search.ts ← Web search tool├── memory/│ └── conversations.ts ← Memory schema├── kernova.config.ts ← Project settings├── next.config.ts ← Next.js routing config├── postcss.config.mjs ← Tailwind setup├── .env.local ← Your API keys (secret!)├── package.json ← Dependencies└── tsconfig.json ← TypeScript configUnderstanding the split
There are two systems running in one project:
-
Frontend (
app/folder) — This is a Next.js application. It renders HTML, handles routing, and shows the chat UI in the browser. This is what the user interacts with. -
Agent backend (
agents/folder) — This runs on a server. It talks to OpenAI, executes tools, stores memories. The browser never runs this code directly.
They communicate via HTTP. When you type a message in the chat, the frontend sends it to the agent backend, which processes it and streams the response back.
Why this matters: You don’t have to think about APIs, endpoints, or CORS. The framework connects them automatically.
Add Your API Key
Open .env.local in your editor and replace the placeholder:
OPENAI_API_KEY=sk-proj-your-actual-key-hereThis key is used by the agent backend to call OpenAI. It’s never sent to the browser.
Important: Never commit .env.local to git. It’s already in .gitignore.
Run It
kernova devYou should see:
🚀 Kernova Full-Stack Dev Server
🧠 Kernova Framework Server ├─ Agents: 1 discovered ├─ Tools: 1 registered ├─ Memory: 1 namespaces └─ Config: nova-assistant v0.1.0
⚡ Agent API ready at http://localhost:4555
✓ Ready at http://localhost:3000Open http://localhost:3000 in your browser. You should see the landing page. Click “Start chatting” to go to the chat interface.
Try typing “Hello” — the assistant should respond.
What Just Happened
When you started kernova dev:
- The framework scanned
agents/and foundassistant.agent.ts - It read the agent’s instructions, tools, and memory config
- It started the agent backend on port 4555
- It started Next.js (the frontend) on port 3000
- Next.js proxies
/api/agents/*requests to port 4555
When you sent “Hello”:
- The chat UI called
POST /api/agents/assistantwith{ input: "Hello" } - Next.js proxied it to port 4555
- The agent backend loaded your agent’s instructions and sent them + your message to OpenAI
- OpenAI responded with text
- The response streamed back token-by-token to the browser
All of this happened because of a single file: agents/assistant.agent.ts.