YouTube script / outline for Burke Holland Tone: conversational, developer-to-developer, no fluff
[Screen recording: VS Code with GitHub Copilot open]
Open with Copilot already mid-task. Something genuinely impressive — like:
Demo to run: Open a messy project with no README, no comments, just a pile of JS files. Type into Copilot Chat: "Explore this project and write a thorough README.md with setup instructions." Hit enter and watch it go — it reads files, reasons about them, writes the README, all without you touching anything.
"Okay, that is pretty wild. I've used Copilot a hundred times but watching it actually do work — open files, figure out what the project is, write real documentation — it still gets me."
[Pause for effect]
"But how does this actually work? Like, under the hood, what is happening?"
"Today we're going to build the same thing from scratch. Like, actually from scratch — 100 lines of JavaScript. And by the end you're going to look at Copilot's agent mode and go oh yeah, that's just that."
[Switch to simple diagram or whiteboard-style sketch in the editor]
"Here's the mental model. A language model, on its own, just takes text in and spits text out. That's it. It doesn't do anything."
"But what if you gave it a list of tools it could call? Like, 'hey model, if you need to read a file, you can do that. Here's how.' And then when the model says 'I want to call read_file', your code actually calls it, gets the result, and sends it back."
"That loop — model calls tool, you run it, send result back, model keeps going — that's an agent. That's literally it."
[Draw or show: User → Model → Tool Call? → Execute → Back to Model → repeat → Final Answer]
"Let's build it."
[Open a blank agent.js in VS Code]
"We're using the OpenAI SDK — but I'll show you at the end how to swap this to a completely local model with two lines of code."
import OpenAI from "openai";
import fs from "fs";
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const MODEL = process.env.MODEL ?? "gpt-4o-mini";"Nothing fancy. The OpenAI SDK, Node's built-in fs module, and we read the key from an env var like responsible adults."
"Every agent needs a personality. This is where you tell the model who it is and what it's allowed to do."
const SYSTEM_PROMPT = `You are a helpful coding assistant with access to the local filesystem.
You can read files, write files, and list directories.
When given a task, reason through it step by step and use your tools to accomplish it.`;"Short, direct. The model doesn't need an essay. It needs to know what it can do and what you want from it."
"This is where it gets interesting. You have to describe your tools to the model in JSON — the name, what it does, and what parameters it takes. This is basically the API contract between your code and the model."
[Walk through the tools array — read_file, write_file, list_directory]
"The model reads these descriptions and decides when to call them. So write good descriptions. 'Read the contents of a file' is better than 'reads file'. The model is making decisions based on this."
"Now the actual implementations — and these are embarrassingly simple:"
function read_file({ path: filePath }) {
return fs.readFileSync(path.resolve(filePath), "utf8");
}
function write_file({ path: filePath, content }) {
fs.writeFileSync(path.resolve(filePath), content, "utf8");
return `File written: ${filePath}`;
}
function list_directory({ path: dirPath = "." }) {
return fs.readdirSync(path.resolve(dirPath), { withFileTypes: true })
.map(e => e.isDirectory() ? `${e.name}/` : e.name)
.join("\n");
}"Literally just fs calls. The magic is not in the tools themselves — it's in the loop."
"Okay, here's the whole thing. The part that makes it an agent instead of just a chatbot."
[Walk through runAgent() slowly]
while (true) {
const response = await client.chat.completions.create({ model, tools, messages });
const message = response.choices[0].message;
messages.push(message);
if (!message.tool_calls || message.tool_calls.length === 0) {
// No more tool calls — we're done
break;
}
for (const toolCall of message.tool_calls) {
const result = executeTool(toolCall.function.name, toolCall.function.arguments);
messages.push({ role: "tool", tool_call_id: toolCall.id, content: result });
}
}"See this while (true)? That's the agent. We keep asking the model what to do next. If it calls a tool, we run it. If it doesn't, we stop. The model is driving — we're just executing."
"Notice the messages array growing. Every tool result gets pushed back in. The model has full context of everything it's done so far. That's how it knows not to read the same file twice, or to build on what it already found."
[Terminal open, a simple project directory with a few JS files but no README]
"Alright, moment of truth."
node agent.js "look at the files in this directory and write a README.md"[Watch the output stream in real time — tool calls print as they happen]
→ calling list_directory({"path":"."})
← index.js
utils.js
config.js
→ calling read_file({"path":"index.js"})
← // Express server...
→ calling read_file({"path":"utils.js"})
← ...
→ calling write_file({"path":"README.md", "content":"# My Project\n..."})
← File written: README.md
✅ Agent finished.
"And there it is. It listed the directory, read the files it needed, figured out what the project does, and wrote a README. All from one prompt."
[Open README.md in VS Code to show the result]
"Is it perfect? No. But it's a solid starting point and it did it in like 10 seconds."
[Stay in terminal]
"Okay here's the part I love. What if you don't want to send your code to OpenAI? What if you want this running completely local, completely offline?"
"Two steps. First, pull a model with Ollama:"
ollama pull qwen2.5:7b"Then run the agent with two env vars:"
BASE_URL=http://localhost:11434/v1 MODEL=qwen2.5:7b node agent.js "your task""That's it. Ollama exposes an OpenAI-compatible API, so the same client, same code, same loop — just talking to a local model now."
"The results won't be as good as GPT-4o, but for a lot of tasks? Totally fine. And it's free and private."
"You can swap to any model Ollama supports — llama3, mistral, phi-4, whatever. Same two lines."
[Switch to browser — VS Code GitHub Copilot open source repo on GitHub]
"Okay, I promised I'd close the loop on Copilot. Let me show you something."
[Navigate to the agent-related code in the Copilot extension — or show the VS Code chat participant / tool calling API]
"Look at this. System prompt. Tool definitions — read file, write file, run terminal. And a loop that checks for tool calls and executes them."
"It's the same pattern. Literally the same pattern we just built. Just with more tools, better error handling, tight VS Code integration."
"The insight here is that Copilot's agent mode isn't some completely different thing. It's not magic. It's a well-engineered version of what you just built in 100 lines."
"Which means you can build your own. For your own tools. Your own workflows. Your own environment."
"The full code is linked in the description — agent.js and this script if you want to follow along."
"If you want to go deeper, the next thing to add is error handling and retries — models sometimes return malformed JSON for tool args, and you want to recover gracefully. I'll cover that in the next one."
"Hit subscribe if you want that. And I'll see you in the next video."
[Outro]
- Keep terminal font large (18–20pt) — tool call arrows
→ ←should be clearly readable - Slow down the demo recording if needed — viewers need time to read the output
- Consider a split-screen moment: agent.js on left, terminal output on right
- For the Ollama section, show
ollama listafter the pull to confirm the model is there - Keep VS Code theme consistent — dark theme, minimal UI (hide sidebar during code sections)