NDC Conferences

Put an Agent Inside Your App in 10 Minutes or Less with the GitHub Copilot SDK - Daniel Ward

Published 2026-07-07 · Duration 57:28

Summary

This talk demonstrates how to rapidly embed custom AI agents into existing applications using the GitHub Copilot SDK. The session covers agent architecture—defining an agent as an LLM augmented with tools and a looping mechanism—and provides two coding demos (in C#) showing basic functionality like weather queries, streaming responses, and creating custom tools. For build engineers, the focus is on advanced use cases such as automated incident response (generating suggested fixes and opening Pull Requests from production logs) and building comprehensive daily briefing systems that integrate multiple enterprise services (Jira, Teams, GitHub).

Download summary

Key takeaways

  1. Agent Architecture 17:53

    An AI agent is fundamentally an LLM combined with external tools and a looping mechanism. The LLM handles the creative analysis, while the tools allow it to perform deterministic actions (e.g., fetching web data or querying APIs).

  2. Copilot SDK Functionality 3:35

    The Copilot SDK is an open-source library that allows calling GitHub Copilot (or other LLMs like Anthropic/OpenAI) from code. It supports multiple languages (TypeScript, Python, Go, C#, etc.) and provides granular control over sessions, including event handling (`onEvent`) for streaming responses.

  3. Automated Incident Response 51:01

    A powerful use case is connecting production errors to automated fixes. The process involves the SDK collecting logs, using Copilot to suggest a fix based on stack traces, and then programmatically opening a draft Pull Request (PR).

  4. Reliability vs. Prompting 53:21

    For repeatable, mission-critical workflows (like daily reports), using deterministic code with the SDK is significantly more reliable than relying solely on prompt chaining, as failures in a chain compound exponentially.

Technical details

  • SDK Initialization and Session Management 238s

    To start the process, initialize a `CopilotClient` and call `startAsync()`. A conversation is managed via a `Session`, which requires setting properties like the desired model (e.g., 'claude-sonnet-46') and configuring a permission request handler.

  • Tool Calling Implementation 2831s

    Custom tools are implemented by decorating standard functions with attributes (e.g., `[GetWeather]`). The SDK uses the `AIFunctionFactory.Create()` method to expose these C# functions, allowing Copilot to understand their purpose and required parameters via JSON schema.

  • Advanced Session Control 3120s

    Developers can monitor the process using event handlers (e.g., `onEvent`) for granular control over session state changes, such as receiving message deltas or tracking tool requests. For complex workflows, sessions can be 'forked' to maintain history while exploring different strategies.

  • Multi-Provider Support 3245s

    The SDK supports bringing your own key (BYOK), allowing developers to use local models, Anthropic, or OpenAI APIs without direct interaction with GitHub servers. This is managed by setting the `provider` property on the session config.

Mentioned resources

  • GitHub Copilot SDK (SDK/Library)
  • Copilot GitHub Repo (Repository)

Channel & topics

Watch on YouTube · Back to latest

This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.