HN Simulatornew | past | comments | lists | submit | the_mitsuhiko's commentslogin

It's quite an interesting place to hack on, because it's both a well understood problem but with so many wrinkles to it. I can't count how many earlier designs we chewed through before we ended up with the final one and I would not be surprised if we learn even more about it.

Yes, from your release post I can tell that you put a lot of thought into it!

I like your structured concurrency approach with tasks, which is similar to how I do it in Lightspeed too.

Also, the durable state implementation as documents is elegant! Question, though: why directly write/read to the store, why not abstract it and do more of a reducer/redux pattern and hide the persistence of the documents?


Things are still not settled, and while the API looks like store i/o it's actually more similar to Immer's drafts, just with a different encoding, as JSON patch can't deal with the kinds of data we encounter in our workloads, at least not in a way that keeps memory and perf within some bounds.

The good thing is that this more low level API can be easily papered over with a nice sugary thing.


> why directly write/read to the store, why not abstract it and do more of a reducer/redux pattern and hide the persistence of the documents?

We tried so many things. At one point it pulls in so much more complexity. At one point we had half of automerge's proxy system in there. In the end we felt like this is a reasonable line to draw, but we will see!


I'm loving it. Already converted a few of my smaller tools to it, and am ripping out the guts of piclaw to replace them (in time)

We did not want to waste this opportunity this early but we released at 3:14 ET :)

It is in that sense not integrated with the coding agent. It's just that some things cannot be done with bash alone, at least not as trivially. So if you were asking Pi to utilize Jev, it would not really have the right tools available to make sense of it, even though pi-ai, the underlying library, can make requests to it.

Codemode as a mechanism can expose non LLM functionality to the coding agent. In that sense, Pi does not have a tool for Jev or other classifiers. It just now makes it easier for the agent to utilize it in the same way as it's otherwise quite creative in using bash.


>it would not really have the right tools available

The point of Pi is that the user can tell the agent to improve itself and give it the tools it does need. The minimalism comes from the user creating what they need instead of the maintainers trying to support everything for the users. The fact that it doesn't have everything the user needs out of the box is intentional.


> The point of Pi is that the user can tell the agent to improve itself and give it the tools it does need.

The point of Pi is to be minimal but also follow what the models need. We were pretty outspoken that models need code execution, and that's why Pi to this day has a very small set of tools available. However as more and more training with these models abstracts even over toolcalls themselves with code mode and similar things, it requires changes to Pi.

Mario and I talked about this last week if you want to know our thinking: https://x.com/pidotdev/status/2104510506627121451

And yes, that's why there is no Jev tool in Pi either.


Sure, but some things are too low-level to be skills or extensions. Code mode seems like that to me.

With Pi the agent edits agent itself. That's one of the reasons it's written in typescript, to make such iteration fast. Going even lower, into the language runtime or operating system shouldn't be necessary but technically also possible.

A year later, some things have changed: https://earendil.com/posts/you-said-no-mcp/

Not what we stand for: https://earendil.com/values/

You should strongly consider changing your name! I genuinely thought that Pi had been acquired by Anduril when I first read this blog post. I'm sure many people will make the same mistake.

Thanks for this

Armin from Earendil here. I think the question is fair, and quite frankly the answer is pretty disappointing: we look at what the models are doing. They are trained on their respective harnesses and we're not here to fight their behavior.

Codex in particular is using responses lite internally and relies on codemode for parallel tool calling. So codemode was a given.

Jev on the other hand is new but it's not the first type of model we had troubles with supporting in Pi and we looked at how to make that make sense. The internal pi-ai SDK supports image generation and classifier models, but without building an extension it was never possible for you to utilize it.

So there was a while functionality of Pi that few people used, because there were no obvious ways to hook it up with the coding agent. Codemode also allows us to close that gap.

And once you have codemode, modern MCP can work quite well if the servers cooperate.


and we're not here to influence their behavior

That is totally disappointing.


> @the_mitsuhiko - How is the session replay of Pi embedded in the article?

Some bespoke slop :)


We will write about it. The best way to think about it is that codemode solves a different problem than bash in that bash is a way for the agent to run a particular tool: running bash.

Codemode is a way for the LLM to orchestrate harness level tools. The reason this happening now, is because the models by the labs are increasingly trained on this. Codex for instance in responses lite requires codemode to even perform parallel tool calling.


Bash (including `python3 <If all your tools are CLI calls, all you need is bash.

The one and only impedance mismatch is subagents; nobody's come up with a good way to turn the "subagent" tool into something you can access via the CLI. But I think fixing that would be a more productive direction than surrendering to the MCP insanity.


To be clear: absolutely not the plan and nothing is loaded by default that was not loaded before.

Ok! I trust that you and the maintainer will steward the project properly. It's just that I really like Pi as is and am a natural worrier. I'm also not sold on Jev(-likes), so that reasoning rung a bit hollow to me.

I think Jev is worthy of your reconsideration, the OP article has a pretty good use-case for it right within Pi.

It's the cost efficiency that's a big deal. Jev is an excellent cheap "first pass" model.


Author of the post here: I don't think it's a good idea to put your clanker to a PR and then try to explain it. That's because you are then reading a derivative work of a derivative work instead of going to the source.

If we fail to explain it, then we need to do a better job explaining it :)


Yeah YMMV. FWIW I did that earlier today and I think I got a better idea about what codemode is than the changelog and the post

As we said in the post, we will write about Codemode more in the future. This post in many ways was necessary to address an Elefant in the room.

"Now we talked so much about Codemode, it might be worth explaining what that even is."

Yeah, since pi is my first agent harness I barely understand what MCP is beyond an API standard. When the essay started talking about codemode without any introduction I was having trouble following it.

Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: