FREE SOURCE CODE

What Is an AI Agent, Really? — Free Source Code

This is the tiny AI agent from the video. It’s about 50 lines of C#, and it shows the whole idea in one file: a language model that uses tools in a loop until it reaches a goal.

zip · 3 KB

What’s inside

  • agent.cs: the full agent, in a single file
  • README.md: how to run it, plus a few small experiments to try

What it does

You give the agent one goal: “If it rains in Amsterdam tomorrow, move my 10:00 meeting online and tell everyone.” The agent checks the weather, finds the meeting, moves it online and emails the attendees. You don’t tell it the order. It decides the steps by itself.

In the code you can see every part from the video:

  • Braina local language model through Ollama
  • Handsfour simple tools (weather, calendar, update, email)
  • Notebookthe message history
  • Loopthink → act → observe, with a safety limit of 10 steps

What you need

  • .NET 10 SDK
  • Ollama, with a model that supports tools (for example qwen2.5:7b)
  • No paid API and no API key. Everything runs on your own machine.

Run it in 3 steps

  1. ollama pull qwen2.5:7b
  2. unzip what-is-an-ai-agent-really.zip && cd what-is-an-ai-agent-really
  3. dotnet run agent.cs

FREE DOWNLOAD

Get the source code

Enter your email and we’ll send you the download link. The newsletter box is optional: you get the code either way.