# You Should Write An Agent

DevFeed: [You Should Write An Agent](<https://devfeed.tech/articles/you-should-write-an-agent-1695.md>)

Original publisher: [Read original article](<https://fly.io/blog/everyone-write-an-agent/>)

Published: 2025-11-06T00:00:00Z

Content type: article

Language: en

Sources: [The Fly Blog](<https://devfeed.tech/sources/the-fly-blog.md>)

Topics: [Large Language Model](<https://devfeed.tech/topics/llm.md>), [API](<https://devfeed.tech/topics/api.md>), [OpenAI](<https://devfeed.tech/topics/openai.md>), [Code](<https://devfeed.tech/topics/code.md>), [context window](<https://devfeed.tech/topics/context-window.md>), [ChatGPT](<https://devfeed.tech/topics/chatgpt.md>), [Tool](<https://devfeed.tech/topics/tool.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [api](<https://devfeed.tech/tags/api.md>), [cdn](<https://devfeed.tech/tags/cdn.md>), [chatgpt](<https://devfeed.tech/tags/chatgpt.md>), [close-to-users](<https://devfeed.tech/tags/close-to-users.md>), [code](<https://devfeed.tech/tags/code.md>), [context-window](<https://devfeed.tech/tags/context-window.md>), [deploy-app-servers](<https://devfeed.tech/tags/deploy-app-servers.md>), [docker](<https://devfeed.tech/tags/docker.md>), [elixir](<https://devfeed.tech/tags/elixir.md>), [fly](<https://devfeed.tech/tags/fly.md>), [fly-io](<https://devfeed.tech/tags/fly-io.md>), [heroku-alternative](<https://devfeed.tech/tags/heroku-alternative.md>), [heroku-competitor](<https://devfeed.tech/tags/heroku-competitor.md>), [hosting](<https://devfeed.tech/tags/hosting.md>), [i](<https://devfeed.tech/tags/i.md>), [llm](<https://devfeed.tech/tags/llm.md>), [llm-agents](<https://devfeed.tech/tags/llm-agents.md>), [networking](<https://devfeed.tech/tags/networking.md>), [openai](<https://devfeed.tech/tags/openai.md>), [postgresql-clusters](<https://devfeed.tech/tags/postgresql-clusters.md>), [servers](<https://devfeed.tech/tags/servers.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

The article argues that developers should write an LLM agent to understand the technology through practice. It presents a small Python engine for an LLM application using the OpenAI Responses API, showing how a terminal conversation can reproduce ChatGPT-like behavior, maintain a context window, and add tool use.

## Source excerpt

Some concepts are easy to grasp in the abstract. Boiling water: apply heat and wait. Others you really need to try. You only think you understand how a bicycle works, until you learn to ride one. There are big ideas in computing that are easy to get your head around. The AWS S3 API. It's the most important storage technology of the last 20 years, and it's like boiling water. Other technologies, you need to get your feet on the pedals first. LLM agents are like that. People have wildly varying opinions about LLMs and agents. But whether or not they're snake oil, they're a big idea. You don't have to like them, but you should want to be right about them. To be the best hater (or stan) you can be. So that's one reason you should write an agent. But there's another reason that's even more persuasive, and that's It's Incredibly Easy Agents are the most surprising programming experience I've had in my career. Not because I'm awed by the magnitude of their powers -- I like them, but I don't like-like them. It's because of how easy it was to get one up on its legs, and how much I learned doing that. I'm about to rob you of a dopaminergic experience, because agents are so simple we might as well just jump into the code. I'm not even going to bother explaining what an agent is. Wrap text Copy to clipboard from openai import OpenAI client = OpenAI() context = [] def call(): return client.responses.create(model="gpt-5", input=context) def process(line): context.append({"role": "user", "content": line}) response = call() context.append({"role": "assistant", "content": response.output_text}) return response.output_text It's an HTTP API with, like, one important endpoint. This is a trivial engine for an LLM app using the OpenAI Responses API. It implements ChatGPT. You'd drive it with the the obvious loop. It'll do what you'd expect: the same thing ChatGPT would, but in your terminal. Wrap text Copy to clipboard def main(): while True: line = input("&gt; ") result = process(line) p