Weekly Notes 15 | AI Agent Development: Time Is the Biggest Cost

When I first saw that Manus AI had been acquired for several billion, with the media saying "what they bought was their experience," I didn't buy it. It wasn't until I actually did Agent development myself that I felt it deeply.

Every time you change one thing and run one test, it's at least ten minutes, and there's almost no way to speed that up.

Take making an automatic English-video-to-Chinese-video translator. The flow has three steps: ASR → LLM → TTS. Every step calls AI, and the workload rises geometrically.

To lower the cost, you need to split it into three steps, test each one independently, and only merge and test at the end. That way the machine cost goes up too — you need at least three machines, or even three employees dividing the work to try things out.

So yes, time really is the biggest cost.

That's why, in AI Agent development, you should focus on saving manpower and resources and on the core links, rather than on irrelevant things like the interface.

This week I came across a good project, Copilot Kit, which lets you integrate an Agent into an old project in the simplest possible way:

https://github.com/CopilotKit/CopilotKit

With its help, building a chat box takes just the following three steps:

Step one: import the core code in the layout

// src/app/layout.tsx
import { CopilotKit } from "@copilotkit/react-core";
import "@copilotkit/react-ui/styles.css";
export default function RootLayout({ children }) {
  return (
    <CopilotKit runtimeUrl="/api/copilotkit">
      <html><body>{children}</body></html>
    </CopilotKit>
  );
}
Step two: add the route
// src/app/api/copilotkit/route.ts
import {
  CopilotRuntime,
  OpenAIAdapter,
  copilotRuntimeNextJSAppRouterEndpoint,
} from "@copilotkit/runtime";

// 连接 GPT 的适配器
const serviceAdapter = new OpenAIAdapter({ model: "gpt-4o-mini" });

const runtime = new CopilotRuntime();
export const POST = async (req: Request) => {
  const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
    runtime,
    serviceAdapter,
    endpoint: "/api/copilotkit",
  });
  return handleRequest(req);
};
Step three: import the dialog box into the specific page:
// src/app/page.tsx
import { CopilotChat } from "@copilotkit/react-ui";
const SYSTEM_PROMPT = "你是一个友好的编程助手...";
export default function Home() {
  return <CopilotChat instructions={SYSTEM_PROMPT} />;
}

Just those three snippets, and a React app that can chat with GPT is up and running. Shorter than you imagined, right?

The core pieces it provides are simple — just 3:

Part Where it runs What it does
<CopilotKit> / <CopilotKitProvider> Browser Provides the React context so all CopilotKit hooks can get the connection handle
CopilotRuntime + Adapter Server Receives messages, calls the LLM, forwards tool calls to the browser, and sends tool results back
<CopilotChat> / <CopilotSidebar> / <CopilotPopup> Browser Prebuilt UI with streaming, Markdown, and tool call card rendering built in

This is the interface:

But this is a full-stack project. When you bring it in purely on the frontend, you usually need to spin up a separate BFF layer to connect to it.

This approach is more complete than a pure-UI solution — a pure-UI solution can solve the problem, but the follow-up development load is larger, and it is especially unfriendly to frontend developers who are just getting into full stack.

On top of that, you can implement tool calls directly on the frontend: just run them with the handler of useCopilotAction. This breaks the traditional idea that "AI tools must go through the backend" — the business logic lives in the frontend, the state lives in React, and the handler calls setState directly.

Right now the project already supports React, Vue, and Angular. If you're planning to add AI capabilities to an existing frontend legacy project, starting with CopilotKit is the best value for money.

Five minutes to get Hello World running, one day to build your first tool call, three days to master Generative UI — after that, all that's left is applying it to your own actual business.