Loading repository data…
Loading repository data…
jovaneyck / repository
Build a real working AI coding agent. Learn about LLM's and agentic AI. For educational purposes only.
Build your own working AI coding agent from scratch. For educational purposes only.
This workshop was modeled after Geoffrey Huntley's amazing blog post how to build a coding agent: free workshop
This workshop guides you through building a functional AI coding agent that can:
By the end, you'll understand the core concepts behind AI assistants like GitHub Copilot, Cursor, and Claude Code.
Yes. But remember that the goal of this workshop is to understand how these things work by building one yourself. Make sure to work step by step and verify your understanding at each stage. The "Quiz Yourself" sections are designed to help with this. If in doubt, ask your AI clarifying questions or call over your facilitator to discuss the exercise topics more in detail.
Follow these exercises in order. Each step builds upon the previous one:
Get hands-on experience with local language models before building your agent.
Create a basic conversation loop that sends messages to an LLM and displays responses.
Implement memory so your agent can maintain context across multiple turns.
Learn how to control LLM behavior using system messages.
Understand the fundamentals of function calling with a simple get_secret tool.
Implement a practical tool that allows the LLM to read file contents.
Enable your agent to create and modify files on disk.
Add the ability to execute shell commands and scripts. ⚠️ Use with caution!
A complete C# implementation is available in this repository for reference. See JCode/ChatCommand.cs for the main implementation and JCode.Tests/Tests.cs for test examples.
⚠️ Important: Exercise 7 (Running Scripts) allows the AI to execute arbitrary commands on your system. This can be dangerous!
Completed the workshop? Here are ideas for taking your agent further. Each represents a real capability found in production AI coding agents.
As conversations grow, you'll eventually hit the model's context window limit. Implement a strategy to compress older messages — for example, by summarizing earlier turns into a single system message while keeping recent messages intact. This lets your agent handle long sessions without losing important context.
Instead of handling everything in a single conversation, your agent can delegate subtasks to separate agent instances. For example, a "research" sub-agent could explore the codebase while the main agent continues planning. This requires managing multiple conversations, passing context between them, and merging results.
MCP is an open standard for connecting AI agents to external tools and data sources. Instead of hardcoding tools like read_file and write_file, you can implement an MCP client that dynamically discovers and uses tools exposed by MCP servers — making your agent extensible without code changes.
Show the model's output token-by-token as it's generated instead of waiting for the full response. This dramatically improves perceived responsiveness and lets users interrupt early if the model is heading in the wrong direction.
Add a confirmation step before executing dangerous operations (file writes, script execution). The agent presents what it intends to do and waits for user approval. This is how production agents like Claude Code and GitHub Copilot balance autonomy with safety.
Some models can request multiple tool calls in a single response (e.g., reading three files at once). Implement parallel tool execution to speed up multi-step workflows.
Save and reload conversation history so your agent can pick up where it left off. Consider what should be persisted (full history? a summary?) and how to handle stale context.
Happy building! 🤖