How the agent is built — the code, in plain English

1 · Run it yourself2 · The chat UI3 · Wiring in Trigger.dev
$ git clone https://github.com/rahulwagh/trigger-dev-ai-agent.git $ cd trigger-dev-ai-agent/phase2-chat-agent 1 $ npm install # Next.js · Vercel AI SDK · @trigger.dev/sdk · @ai-sdk/openai 2 $ cp .env.example .env.local # then paste your two keys: TRIGGER_SECRET_KEY=tr_dev_… (cloud.trigger.dev → project → API keys) OPENAI_API_KEY=sk-… $ cp .env.local .env # the Trigger worker reads .env, Next.js reads .env.local 3 $ npx trigger.dev@latest init -p <your-project-ref> # links this folder to your Trigger.dev project 4 $ ../phase1-local-cluster/up.sh # minikube + the demo stack with the broken payments-1 then set USE_REAL_CLUSTER=true in .env and .env.local (false = built-in mock data, no cluster needed) 5 $ npx trigger.dev@latest dev # terminal 1 — runs the agent locally, hot-reloads on save 6 $ npm run dev # terminal 2 — the chat UI open http://localhost:3000 and ask: "why is payments crashing?" 7

← / → to step · space = play/pause · click an act name to jump · #step=N&clean for a clean screenshot