Rubber Duck Thursday: Agentic Loops and Context Engineering

By GitHub

Share:

Key Concepts

  • Agentic Loop: A cyclical process where an AI agent receives a prompt, gathers context, executes tools, and verifies results.
  • Coding Agents: AI-powered tools (e.g., GitHub Copilot) that assist in software development via IDEs, CLI, or custom SDKs.
  • MCP (Model Context Protocol): An open protocol that allows AI models to securely connect to external data sources and tools, extending their capabilities beyond local context.
  • Context Engineering: The practice of providing agents with specific instructions, files, and repository-level data to improve output quality.
  • TDD (Test-Driven Development): A methodology where developers write tests before code, using AI agents to generate tests and subsequent code to satisfy them.

1. The Agentic Loop

The speaker defines an AI agent as an LLM that calls tools in a loop to achieve a specific goal. The "Agentic Loop" consists of four critical stages:

  1. Prompting: The user provides a task.
  2. Gathering Context: The agent retrieves necessary information (files, documentation, or repo-level instructions).
  3. Tool Execution: The agent uses specific tools (e.g., MCP servers) to perform actions.
  4. Verification: The agent or user checks the results to ensure accuracy.

2. Development Environments: IDE vs. CLI

The stream highlights a debate between using VS Code (IDE) and the GitHub Copilot CLI.

  • IDE: Preferred for visual feedback, allowing developers to see file changes and compare outputs side-by-side.
  • CLI: Favored for speed and "vibe coding." The speaker notes that the CLI provides a "magical" experience with animations and is efficient for quick tasks, though it lacks the visual file-tree context of an IDE.
  • Recommendation: The speaker suggests using both simultaneously—running the CLI for rapid execution while keeping the IDE open to inspect and verify the generated code.

3. Context Management and Customization

To optimize agent performance, the speaker emphasizes the importance of defining behavior:

  • Copilot Instructions: Defined in .github/copilot-instructions.md, these provide repository-level guidance that the agent automatically detects.
  • Agent Files: Using agents/ folders and .agent.md files allows for specialized agents (e.g., a "Reviewer Agent") that can be manually selected for specific workflows.
  • SDK Usage: The GitHub Copilot Python SDK allows developers to programmatically start sessions and define agent behavior, offering a more granular approach than standard chat interfaces.

4. Model Comparison and Tool Use

The speaker conducted live tests comparing models like GPT-5.5, Claude Opus 4.7, and Gemini 3.1 by asking them to generate an SVG of a "pelican on a bike."

  • Observations: Models exhibit distinct "personalities" and design styles. While GPT-5.5 and Opus 4.7 are noted as high-performers for coding, the speaker encourages users to experiment with "Bring Your Own Key" (BYOK) in VS Code to test open models like Kimmy 2.6.
  • MCP Integration: The speaker demonstrated using the Excalidraw MCP server. By calling a read_me tool, the agent retrieves the necessary API context to generate a diagram, proving that MCP is a superior way to query external data compared to traditional web searches.

5. Methodologies: TDD vs. Spec-Driven Development

The speaker advocates for Test-Driven Development (TDD) over Spec-Driven Development when working with AI:

  • Process:
    1. Ask the agent to generate behavioral tests (e.g., using Playwright).
    2. Ensure the tests fail initially.
    3. Prompt the agent to write code that makes the tests pass.
    4. Refactor the resulting code.
  • Rationale: TDD is "code-first" and provides a concrete framework for verifying that the AI agent’s output is functional and correct.

Notable Quotes

  • "An AI agent is an LLM that calls tools in a loop to achieve a goal."
  • "MCP is basically a better way for an AI model to get or query data outside of its local context... instead of searching the web, it has MCP as a tool to get data from the source more directly."

Synthesis

The session concludes that the future of AI-assisted development lies in mastering the Agentic Loop. By combining MCP for data access, TDD for verification, and a hybrid IDE/CLI workflow, developers can significantly increase their productivity. The speaker encourages viewers to explore the "MCP for Beginners" course on Microsoft Learn and to experiment with the GitHub Copilot SDK to build custom, context-aware agents.

Chat with this Video

AI-Powered

Hi! I can answer questions about this video "Rubber Duck Thursday: Agentic Loops and Context Engineering". What would you like to know?

Chat is based on the transcript of this video and may not be 100% accurate.

Related Videos

Ready to summarize another video?

Summarize YouTube Video