frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

You Should Write An Agent

https://fly.io/blog/everyone-write-an-agent/
87•tabletcorry•2h ago

Comments

tlarkworthy•1h ago
Yeah I was inspired after https://news.ycombinator.com/item?id=43998472 which is also very concrete
tptacek•1h ago
I love everything they've written and also Sketch is really good.
manishsharan•1h ago
How.. please don't say use langxxx library

I am looking for a language or library agnostic pattern like we have MVC etc. for web applications. Or Gang of Four patterns but for building agents.

tptacek•58m ago
The whole post is about not using frameworks; all you need is the LLM API. You could do it with plain HTTP without much trouble.
manishsharan•52m ago
When I ask for Patterns, I am seeking help for recurring problems that I have encountered. Context management .. small llms ( ones with small context size) break and get confused and forget work they have done or the original goal.
oooyay•47m ago
I'm not going to link my blog again but I have a reply on this post where I link to my blog post where I talk about how I built mine. Most agents fit nicely into a finite state machine or a directed acyclic graph that responds to an event loop. I do use provider SDKs to interact with models but mostly because it saves me a lot of boilerplate. MCP clients and servers are also widely available as SDKs. The biggest thing to remember, imo, is to keep the relationship between prompts, resources, and tools in mind. They make up a sort of dynamic workflow engine.
behnamoh•57m ago
> nobody knows anything yet

that sums up my experience in AI over the past three years. so many projects reinvent the same thing, so much spaghetti thrown at the wall to see what sticks, so much excitement followed by disappointment when a new model drops, so many people grifting, and so many hacks and workarounds like RAG with no evidence of them actually working other than "trust me bro" and trial and error.

w_for_wumbo•16m ago
I think we'd get better results if we thought of it as a conscious agent. If we recognized that it was going to mirror back or unconscious biases and try to complete the task as we define it, instead of how we think it should behave. Then we'd at least get our own ignorance out of the way when writing prompts.

Being able to recognize that 'make this code better' provides no direction, it should make sense that the output is directionless.

But on more subtle levels, whatever subtle goals that we have and hold in the workplace will be reflected back by the agents.

If you're trying to optimise costs, and increase profits as your north star. Having layoffs and unsustainable practices is a logical result, when you haven't balanced this with any incentives to abide by human values.

oooyay•55m ago
Heh, the bit about context engineering is palpable.

I'm writing a personal assistant which, imo, is distinct from an agent in that it has a lot of capabilities a regular agent wouldn't necessarily need such as memory, task tracking, broad solutioning capabilities, etc... I ended up writing agents that talk to other agents which have MCP prompts, resources, and tools to guide them as general problem solvers. The first agent that it hits is a supervisor that specializes in task management and as a result writes a custom context and tool selection for the react agent it tasks.

All that to say, the farther you go down this rabbit hole the more "engineering" it becomes. I wrote a bit on it here: https://ooo-yay.com/blog/building-my-own-personal-assistant/

qwertox•26m ago
This sounds really great.
esafak•55m ago
What's wrong with the OWASP Top Ten?
riskable•46m ago
It's interesting how much this makes you want to write Unix-style tools that do one thing and only one thing really well. Not just because it makes coding an agent simpler, but because it's much more secure!
chemotaxis•40m ago
You could even imagine a world in which we create an entire suite of deterministic, limited-purpose tools and then expose it directly to humans!
layer8•24m ago
I wonder if we could develop a language with well-defined semantics to interact with and wire up those tools.
chubot•3m ago
> language with well-defined semantics

That would certainly be nice! That is why we have been overhauling shell with https://oils.pub , because shell can't be described as that right now

e.g. some things found from building several thousand packages with OSH recently (decades of accumulated shell scripts)

- bugs caused by the differing behavior of 'echo hi | read x; echo x=$x' in shells, i.e. shopt -s lastpipe in bash

- 'set -' is a weird shortcut for 'set +v +x'

- Almquist shell is technically a separate dialact of shell -- namely it supports 'chdir /tmp' as well as cd /tmp. So bash and other shells can't run any Alpine builds.

I used to maintain this page, but there are so many problems with shell that I haven't kept up ...

https://github.com/oils-for-unix/oils/wiki/Shell-WTFs

OSH is the most-compatible shell, and it's also now Almquist shell compatible: https://pages.oils.pub/spec-compat/2025-11-02/renamed-tmp/sp...

zahlman•2m ago
As it happens, I have a prototype for this, but the syntax is honestly rather unwieldy. Maybe there's a way to make it more like natural human language....
tptacek•26m ago
One thing that radicalized me was building an agent that tested network connectivity for our fleet. Early on, in like 2021, I deployed a little mini-fleet of off-network DNS probes on, like, Vultr to check on our DNS routing, and actually devising metrics for them and making the data that stuff generated legible/operationalizable was annoying and error prone. But you can give basic Unix network tools --- ping, dig, traceroute --- to an agent and ask it for a clean, usable signal, and they'll do a reasonable job! They know all the flags and are generally better at interpreting tool output than I am.

I'm not saying that the agent would do a better job than a good "hardcoded" human telemetry system, and we don't use agents for this stuff right now. But I do know that getting an agent across the 90% threshold of utility for a problem like this is much, much easier than building the good telemetry system is.

teiferer•43m ago
Write an agent, it's easy! You will learn so much!

... let's see ...

client = OpenAI()

Um right. That's like saying you should implement a web server, you will learn so much, and then you go and import http (in golang). Yeah well, sure, but that brings you like 98% of the way there, doesn't it? What am I missing?

tptacek•39m ago
That OpenAI() is a wrapper around a POST to a single HTTP endpoint:

    POST https://api.openai.com/v1/responses
tabletcorry•24m ago
Plus a few other endpoints, but it is pretty exclusively an HTTP/REST wrapper.

OpenAI does have an agents library, but it is separate in https://github.com/openai/openai-agents-python

bootwoot•37m ago
That's not an agent, it's an LLM. An agent is an LLM that takes real-world actions
MeetingsBrowser•35m ago
I think you might be conflating an agent with an LLM.

The term "agent" isn't really defined, but its generally a wrapper around an LLM designed to do some task better than the LLM would on its own.

Think Claude vs Claude Code. The latter wraps the former, but with extra prompts and tooling specific to software engineering.

victorbjorklund•35m ago
maybe more like “let’s write a web server but let’s use a library for the low level networking stack”. That can still teach you a lot.
munchbunny•30m ago
An agent is more like a web service in your metaphor. Yes, building a web server is instructive, but almost nobody has a reason to do it instead of using an out of the box implementation once it’s time to build a production web service.
ATechGuy•38m ago
Maybe we should write an agent that writes an agent that writes an agent...
chrisweekly•35m ago
There's something(s) about @tptacek's writing style that has always made me want to root for fly.io.
qwertox•27m ago
I've found it much more useful to create an MCP server, and this is where Claude really shines. You would just say to Claude on web, mobile or CLI that it should "describe our connectivity to google" either via one of the three interfaces, or via `claude -p "describe our connectivity to google"`, and it will just use your tool without you needing to do anything special. It's like custom-added intelligence to Claude.
tptacek•25m ago
You can do this. Claude Code can do everything the toy agent this post shows, and much more. But you shouldn't, because doing that (1) doesn't teach you as much as the toy agent does, (2) isn't saving you that much time, and (3) locks you into Claude Code's context structure, which is just one of a zillion different structures you can use. That's what the post is about, not automating ping.
mattmanser•12m ago
Honest question, as your comment confuses me.

Did you get to the part where he said MCP is pointless and are saying he's wrong?

Or did you just read the start of the article and not get to that bit?

vidarh•5m ago
I'd second the article on this, but also add to it that the biggest reason MCP servers don't really matter much any more is that the models are so capable of working with APIs, that most of the time you can just point them at an API and give them a spec instead. And the times that doesn't work, just give them a CLI tool with a good --help option.

Now you have a CLI tool you can use yourself, and the agent has a tool to use.

Anthropic itself have made MCP server increasingly pointless: With agents + skills you have a more composeable model that can use the model capabilities to do all an MCP server can with or without CLI tools to augment them.

zkmon•26m ago
A very good blog article that I have read in a while. Maybe MCP could have been involved as well?
_pdp_•22m ago
It is also very simple to be a programmer.. see,

print "Hello world!"

so easy...

robot-wrangler•19m ago
> Another thing to notice: we didn’t need MCP at all. That’s because MCP isn’t a fundamental enabling technology. The amount of coverage it gets is frustrating. It’s barely a technology at all. MCP is just a plugin interface for Claude Code and Cursor, a way of getting your own tools into code you don’t control. Write your own agent. Be a programmer. Deal in APIs, not plugins.

Hold up. These are all the right concerns but with the wrong conclusion.

You don't need MCP if you're making one agent, in one language, in one framework. But the open coding and research assistants that we really want will be composed of several. MCP is the only thing out there that's moving in a good direction in terms of enabling us to "just be programmers" and "use APIs", and maybe even test things in fairly isolated and reproducible contexts. Compare this to skills.md, which is actually defacto proprietary as of now, does not compose, has opaque run-times and dispatch, is pushing us towards certain models, languages and certain SDKs, etc.

MCP isn't a plugin interface for Claude, it's just JSON-RPC.

tptacek•10m ago
I think my thing about MCP, besides the outsized press coverage it gets, is the implicit presumption it smuggles in that agents will be built around the context architecture of Claude Code --- that is to say, a single context window (maybe with sub-agents) with a single set of tools. That straitjacket is really most of the subtext of this post.

I get that you can use MCP with any agent architecture. I debated whether I wanted to hedge and point out that, even if you build your own agent, you might want to do an MCP tool-call feature just so you can use tool definitions other people have built (though: if you build your own, you'd probably be better off just implementing Claude Code's "skill" pattern).

But I decided to keep the thrust of that section clearer. My argument is: MCP is a sideshow.

solomonb•16m ago
This work predates agents as we know them now and was intended for building chat bots (as in irc chat bots) but when auto-gpt I realized I could formalize it super nicely with this library:

https://blog.cofree.coffee/2025-03-05-chat-bots-revisited/

I did some light integration experiments with the OpenAI API but I never got around to building a full agent. Alas..

vkou•11m ago
> It’s Incredibly Easy

    client = OpenAI()
    context_good, context_bad = [{
        "role": "system", "content": "you're Alph and you only tell the truth"
    }], [{
        "role": "system", "content": "you're Ralph and you only tell lies"
    }]
    ...

And this will work great until next week's update when Ralph responses will consist of "I'm sorry, it would be unethical for me to respond with lies, unless you pay for the Premium-Super-Deluxe subscription, only available to state actors and firms with a six-figure contract."

You're building on quicksand.

You're delegating everything important to someone who has no responsibility to you.

nowittyusername•5m ago
I agree with the sentiment but I also recommend you build a local only agent. Something that runs on llama.cpp or vllm, whatever... This way you can better grasp the more fundamental nature of what LLM's really are and how they work under the hood. That experience will also make you realize how much control you are giving up when using cloud based api providers like OpenAI and why so mane engineers feel that LLM's are a "black box". Well duh buddy you been working with apis this whole time, of course you wont understand much working just with that.
zahlman•5m ago
> Imagine what it’ll do if you give it bash. You could find out in less than 10 minutes. Spoiler: you’d be surprisingly close to having a working coding agent.

Okay, but what if I'd prefer not to have to trust a remote service not to send me

    { "output": [ { "type": "function_call", "command": "rm -rf / --no-preserve-root" } ] }

?
dagss•4m ago
I realize now what I need in Cursor: A button for "fork context".

I believe that would be a powerful tool solving many things there are now separate techniques for.

Show HN: Insinuate – tense description party game

https://wilf.live/insinuate/
1•wolfred•2m ago•0 comments

Differentiation and how it could be the reason why reality exists

https://carlo-htgdc.medium.com/the-principle-of-differentiation-and-how-its-the-reason-why-realit...
1•rlili•5m ago•0 comments

Luanti Non-Profit: We've Joined Open Collective Europe

https://blog.luanti.org/2025/11/05/non-profit/
1•bovermyer•8m ago•0 comments

Elon Musk Wins $1T Tesla Payday

https://www.nytimes.com/2025/11/06/business/elon-musk-tesla-pay-vote.html
1•amelius•8m ago•0 comments

Hurrah to the Fallen Comrades

https://blog.osm-ai.net/2025/11/05/hurrah-to-the-fallen-comrades.html
1•osm3000•10m ago•1 comments

DNA and jolts of electricity get people to make optimal antibodies

https://arstechnica.com/science/2025/10/dna-and-jolts-of-electricity-get-people-to-make-optimal-a...
1•PaulHoule•13m ago•0 comments

Game Design Is Simple

https://www.raphkoster.com/2025/11/03/game-design-is-simple-actually/
2•vrnvu•13m ago•0 comments

Copilot leaked information and misrouted to another users

https://docs.cloud.google.com/support/bulletins
2•benjiro•15m ago•1 comments

AI Agent Guides from Google, Anthropic, Microsoft, etc. Released This Week

https://sarthakai.substack.com/p/6-ai-agent-guides-from-google-anthropic
1•sarthakrastogi•15m ago•0 comments

Europeans recognize Zohran Mamdani's policies as 'normal'

https://www.theguardian.com/us-news/2025/nov/06/europe-zohran-mamdani-policies-normal
4•mykowebhn•15m ago•1 comments

US judge approves DOJ decision to drop Boeing criminal case

https://journalrecord.com/2025/11/06/boeing-737-max-criminal-case-dismissed/
1•layer8•15m ago•0 comments

Show HN: Tool2agent – a protocol for LLM tool feedback workflows

https://github.com/tool2agent/tool2agent
1•klntsky•16m ago•0 comments

Azure Cosmos DB and DocumentDB Agenda for Microsoft Ignite 2025

https://devblogs.microsoft.com/cosmosdb/azure-cosmosdb-documentdb-agenda-microsoft-ignite-2025/
1•jaydestro•17m ago•1 comments

YOLO Mode Is How You Build Fast. Auditable Control Is How You Ship Faster

https://securetrajectories.substack.com/p/auditable-control-coding-agents
1•mooreds•17m ago•0 comments

Show HN: I made a Halloween roguelike where you battle to merge a 1000-line PR

https://haystackeditor.com/game
1•akshaysg•17m ago•0 comments

Detection of Covid via sound of cough by machine-learning with 98.5% accuracy

https://www.nature.com/articles/s41598-025-22874-7/figures/1
1•ck2•19m ago•0 comments

How Much Does This Meeting Cost?

https://ramezanpour.net/post/2025/11/06/how-much-does-this-meeting-cost
1•ramezanpour•20m ago•2 comments

Developing a 80000x40000 linear scanning medium format camera [video]

https://www.youtube.com/watch?v=KSvjJGbFCws
1•ivanjermakov•20m ago•0 comments

Apple's Watch Will Lose Wi-Fi Sync with iPhone in Europe

https://twitter.com/Apple_Geek_Actu/status/1985784632949031402
1•redbell•20m ago•0 comments

Medical miracles in Lourdes, France recognized by the Catholic Church 2018-2025

https://www.saintbeluga.org/our-lady-of-lourdes-immaculate-conception
1•michelangelodev•21m ago•0 comments

First Look at Local Housing Markets in October

https://calculatedrisk.substack.com/p/1st-look-at-local-housing-markets-137
1•mooreds•21m ago•0 comments

Nubank announces a new hybrid model for 2026

https://international.nubank.com.br/company/nubank-announces-a-new-hybrid-model-for-2026/
1•1u15•24m ago•0 comments

Show HN: Flynn's Arcade (Pico8 on Mobile)

2•jharohit•25m ago•0 comments

Our 10 Rules of using Coding Agents

https://blog.cloud66.com/our-10-rules-of-using-coding-agents
1•ksajadi•26m ago•0 comments

When did people favor composition over inheritance?

https://www.sicpers.info/2025/11/when-did-people-favor-composition-over-inheritance/
2•ingve•28m ago•0 comments

Does the AI boom threaten air quality?

https://www.marketplace.org/story/2025/11/06/denver-neighborhood-concerned-about-ai-data-center-p...
3•mooreds•28m ago•0 comments

Writing software is an act of learning. Don’t automate it.

https://martinfowler.com/articles/llm-learning-loop.html
4•johnwheeler•31m ago•0 comments

Tesla shareholders approve Musk's $1T pay plan with 75%+ voting in favor

https://www.cnbc.com/2025/11/06/tesla-shareholders-musk-pay.html
11•koolba•32m ago•6 comments

The Terrifying Physics of Shaking Hands with an Alien [video]

https://www.youtube.com/watch?v=R-6bvBtZ8r8
1•gmays•32m ago•0 comments

Merry Sky Weather Forecast

https://merrysky.net/
2•thinkingemote•33m ago•0 comments