Skip to content

Commit 5840a8f

Browse files
committed
Add implementation guide for AI agents using GitHub Copilot SDK
- Introduced a new section on implementing core elements of AI agents, including setup, tool registration, context management, and error handling. - Added best practices for tool implementation and maintaining context and state. - Created a new unit discussing adaptation and extension of AI agents for specific scenarios, focusing on customer-facing and back-office agents. - Included considerations for conversation quality, personalization, data privacy, and external knowledge integration for customer-facing agents. - Outlined determinism, scheduling, integration with enterprise systems, and human oversight for back-office agents. - Added a new image asset for the launch exercise.
1 parent edc39d7 commit 5840a8f

11 files changed

Lines changed: 969 additions & 1883 deletions

learn-pr/wwl-azure/develop-ai-enabled-apps-using-github-copilot-sdk/92-module-content.md

Lines changed: 429 additions & 1883 deletions
Large diffs are not rendered by default.

learn-pr/wwl-azure/develop-ai-enabled-apps-using-github-copilot-sdk/includes/1-introduction.md

Whitespace-only changes.

learn-pr/wwl-azure/develop-ai-enabled-apps-using-github-copilot-sdk/includes/11-knowledge-check.md

Whitespace-only changes.

learn-pr/wwl-azure/develop-ai-enabled-apps-using-github-copilot-sdk/includes/12-summary.md

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
**What is an AI Agent?** An **AI agent** is a goal-driven AI system that can **reason, take actions, and adapt autonomously** in pursuit of an objective[1]. Unlike a simple chatbot that only responds to user queries with pre-scripted answers, an AI agent can **make decisions**, **use tools or APIs**, and **maintain memory of context** to achieve a goal without step-by-step human guidance[2][3]. In essence, *chatbots respond; AI agents act*.
2+
3+
**Chatbot vs. AI Agent:** A traditional **chatbot** might answer "What's my account balance?" with information from a database. An **AI agent**, on the other hand, could not only fetch your balance but also **proactively alert you** if it detects unusual spending, or even **execute tasks** like transferring funds or scheduling a meeting with your financial advisor – all based on reasoning about your goal (e.g., managing your finances) rather than just reacting to one question[4][5].
4+
5+
**Key Capabilities of AI Agents:** Modern AI agents are powered by advanced AI models (often large language models, or LLMs) and are defined by a few core abilities that distinguish them from basic automation:
6+
7+
These capabilities let an AI agent operate with a degree of **independence**. The agent uses its AI **reasoning** to decide *what* needs to be done, it **acts** by calling tools or issuing commands to do it, and it **iterates** - checking outcomes and refining its plan as needed[6][7]. This loop continues until the agent's goal is accomplished or it reaches a stopping condition.
8+
9+
**Beyond Chatbots and Scripts:** Early business automation took the form of **if/then scripts or workflows** – useful but rigid. AI agents are a step beyond: they can handle open-ended requests and unexpected situations by relying on AI planning rather than just hard-coded rules[8]. For example, if a user asks a chatbot, *'When is my next team meeting and can you book a room for it?"*, a basic bot might fail because that request spans multiple steps. An AI agent is designed to handle such multi-step goals: it could check the calendar, find the meeting time, then interface with a room-booking system to schedule a room, and confirm back – all without the user explicitly asking for each step.
10+
11+
In technical terms, frameworks like **ReAct** (which couples reasoning and acting) and **RAG** (Retrieval-Augmented Generation) have emerged to enable these behaviors in agents[9]. These allow an agent's LLM to both **'think' (reason internally)** and **'do' (use tools)** in a unified loop. The takeaway is that an AI agent is *not* limited to answering questions; it can be thought of as an intelligent assistant or "digital coworker" that can carry out tasks on your behalf within the scope it's given.
12+
13+
**When to Use AI Agents:** AI agents shine in scenarios where tasks: (a) require integrating information from multiple sources or systems, (b) involve multiple steps or decisions, or (c) would benefit from automation with minimal oversight. We'll see concrete examples in a moment (customer service, sales, finance, etc.). If a task is straightforward and single-step (e.g., "show latest sales figures"), a simple query or bot may suffice. But if it's complex (e.g., "find all customers who overpaid and initiate refunds" or "monitor my servers and fix issues"), an agent is more suitable because it can handle the decision process and execution. Enterprises are increasingly looking to **autonomous digital agents** to drive productivity – indeed, industry leaders predict that by 2028, at least 15% of work decisions will be made by agentic AI systems, up from essentially 0% in 2024[10].
14+
15+
To summarize, AI agents combine the language understanding of chatbots with the action-oriented power of automation scripts, amplified by AI's ability to reason. In the next units, we'll explore how we can create such agents using the GitHub Copilot SDK – but first, let's introduce the SDK itself and why it's a game-changer for developers.
16+
17+
[1]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
18+
[2]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
19+
[3]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
20+
[4]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
21+
[5]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
22+
[6]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
23+
[7]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
24+
[8]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
25+
[9]https://www.knowi.com/blog/ai-agents-explained-how-they-differ-from-chatbots-and-workflows/
26+
[10]https://aws.amazon.com/blogs/aws-insights/the-rise-of-autonomous-agents-what-enterprise-leaders-need-to-know-about-the-next-wave-of-ai/
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
**What is the GitHub Copilot SDK?** The **GitHub Copilot SDK** is a multi-platform toolkit (currently in Technical Preview) that allows you to embed an "AI agent runtime' into your own applications[11]. In plain terms, it gives your app the same AI-driven capabilities that GitHub's Copilot CLI has – the ability to understand natural language instructions, plan actions, and invoke tools or commands to fulfill those instructions[12] - without you having to build all that infrastructure from scratch. GitHub announced this SDK in January 2026, marking a new era in which **developers can harness Copilot's agentic AI outside of VS Code or GitHub's environment, in any app or service**[13].
2+
3+
**Why an SDK for AI Agents?** Building a sophisticated AI agent from the ground up is *hard*. You would need to handle a lot of complex functionality: maintaining the conversation or task state across turns, deciding when to call which external API, ensuring the AI's responses stay within certain boundaries, juggling possibly different AI models for different tasks, etc.[14]. As the Copilot team puts it, *'building agentic workflows from scratch"* means you've essentially built a mini platform before you even get to your business logic[15]. The Copilot SDK is designed to remove that heavy lifting by providing a **pre-built, production-tested agent engine**. Mario Rodriguez (GitHub's Chief Product Officer) described it this way: *'the SDK takes the agentic power of Copilot CLI and makes it available in your favorite programming language... GitHub handles authentication, model management, ... chat sessions, plus streaming. That means you are in control of what gets built on top of those building blocks."*[16]
4+
5+
[17] In short, the SDK gives you the building blocks so you can focus on your app's unique logic.
6+
7+
**Key Features of the Copilot SDK:** The SDK brings several powerful capabilities to the table out-of-the-box[18]:
8+
9+
- **Production-Grade Agent Loop** – It provides the same proven *'execution loop"* that powers GitHub Copilot. This loop manages multi-turn conversations/goals, calls tools, and iterates until done[19]. You don't have to code the planning and orchestration logic; it's handled for you.
10+
11+
- **Multi-Language Support** – You can use the SDK from **Node.js (TypeScript)**, **Python**, **Go**, and **.NET (C#)**, with idiomatic libraries for each[20][21]. This means whether you're building a web app in JavaScript or a backend in C#, you can incorporate the same AI capabilities.
12+
13+
- **Multi-Model Flexibility** – The SDK isn't tied to one AI model. It supports multiple AI models (like GPT-4, GPT-3.5, or others, including future models) and even allows **dynamic model routing**[22]. For example, you might use a faster, lower-cost model for simple tasks and a more powerful model for complex tasks, within the same agent.
14+
15+
- **Tool Orchestration** – This is crucial: the SDK allows you to define **custom tools/commands**, and it enables the AI agent to invoke those tools as needed during its reasoning process[23]. If you give your agent a tool (say, "lookupCustomer(id)"), the agent's AI brain can learn when to call it. The SDK handles the wiring, so the AI can call lookupCustomer in a structured way (not just by guessing code, but through an actual function call in the runtime)[24].
16+
17+
- **MCP Integration***Model-Context Protocol* (MCP) integration means the SDK can interact with the Copilot model hosting service for enterprise, ensuring data can be kept within your org's boundaries if needed[25]. (This is a bit low-level, but essentially it's about connecting with how Copilot manages context and tools under the hood.)
18+
19+
- **Real-Time Streaming** – The SDK supports streaming responses, meaning as the AI generates output, you can stream it to your app (for example, stream tokens to show a typing indicator or partial answer in a chat UI)[26]. This makes the experience more interactive and responsive.
20+
21+
- **Built-in Auth & Security** – Since it's GitHub-powered, it can reuse GitHub authentication (OAuth or tokens) to authenticate to the service, and it respects your Copilot subscription entitlements[27]. This makes it easier to integrate into enterprise setups securely.
22+
23+
In a nutshell, Copilot SDK provides a **ready-made AI agent brain**. Instead of writing code to manage conversation state, parse user input, decide which API to call, call it, then format a reply, you (the developer) **configure** the SDK with what it needs – your domain-specific tools and any constraints – and the SDK's agent will handle the rest intelligently. It's like getting an "AI co-developer' inside your app that follows your high-level instructions.
24+
25+
To illustrate how much heavy lifting it saves: without the SDK, to build an agent, you'd have to handle things like tracking conversation context through each user message, making sure the AI model gets enough relevant info every turn, possibly implementing a semantic memory store, orchestrating external API calls when the AI "decides" to use a tool, and implementing safeguards (e.g., for safety or permission checks)[28]. The Copilot SDK wraps all that into a neat package[29]. As a developer, you interact with it via a simple API in your language of choice.
26+
27+
**How does it work (high-level)?** Under the hood, the SDK uses the same engine as the Copilot CLI. In fact, architecturally it runs a local "agent runtime' (the Copilot CLI core) as a service and your program communicates with it (via a client library) using a protocol[30][31]. You don't usually see this, though – you just call methods on the library. For example, in TypeScript you might do:
28+
29+
```typescript
30+
const client = new CopilotClient();
31+
await client.start();
32+
const session = await client.createSession({ model: "gpt-4" });
33+
const reply = await session.send({ prompt: "Hello, world!" });
34+
```
35+
36+
This simple snippet (from the official docs) initializes the client, starts a session with a chosen model, and sends a prompt to the agent[32]. The result reply would be the AI's answer. That's it – the multi-turn management and tool invocation capabilities are all baked in, beyond this
37+
38+
- hello world' prompt. The SDK repository provides examples and reference docs for each language[33] to help get started. We'll dive much deeper into using the SDK (and its tool system) in Units 4–6, but at a high level, remember: **Copilot SDK is a ready-made AI agent platform**. It lets you focus on *what* your agent should do (the tasks and domain logic) rather than *how* to implement the agent mechanics.
39+
40+
**Summary of Benefits:** By using Copilot SDK, developers and teams can accelerate development of AI-driven features. You get:
41+
42+
- A proven AI planning and execution loop (so you don't have to trust a custom-built one).
43+
44+
- Consistency across projects – the same approach can be used in many apps (no reinventing the wheel each time).
45+
46+
- The power of Copilot's AI in contexts beyond code - e.g., in a customer support app, or an internal tool.
47+
48+
- Enterprise readiness – authentication, permissions, and compliance (you can keep data within your control, etc.) are considerations baked into the design[34].
49+
50+
In the next unit, we'll look at some **real-world scenarios** where AI agents (like those you can build with this SDK) deliver significant value in enterprise settings. After that, we'll circle back to how you implement such agents in detail.
51+
52+
[11]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
53+
[12]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
54+
[13]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
55+
[14]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
56+
[15]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
57+
[16]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
58+
[17]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
59+
[18]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
60+
[19]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
61+
[20]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
62+
[21]https://ubos.tech/news/github-copilot-sdk-launches-ai-agent-runtime-with-multi%e2%80%91language-support-and-tool-integration-for-developers/
63+
[22]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
64+
[23]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
65+
[24]https://ubos.tech/news/github-copilot-sdk-launches-ai-agent-runtime-with-multi%e2%80%91language-support-and-tool-integration-for-developers/
66+
[25]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
67+
[26]https://techcommunity.microsoft.com/blog/azuredevcommunityblog/building-agents-with-github-copilot-sdk-a-practical-guide-to-automated-tech-upda/4488948
68+
[27]https://ubos.tech/news/github-copilot-sdk-launches-ai-agent-runtime-with-multi%e2%80%91language-support-and-tool-integration-for-developers/
69+
[28]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
70+
[29]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
71+
[30]https://deepwiki.com/github/copilot-sdk/3-sdk-architecture
72+
[31]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
73+
[32]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
74+
[33]https://github.blog/news-insights/company-news/build-an-agent-into-any-app-with-the-github-copilot-sdk/
75+
[34]https://ubos.tech/news/github-copilot-sdk-launches-ai-agent-runtime-with-multi%e2%80%91language-support-and-tool-integration-for-developers/

0 commit comments

Comments
 (0)