Menu

Why build an agent harness in PHP?
πŸ“°

Why build an agent harness in PHP?

DEV Community: php·Fabian Graßl·about 4 hours ago
#V98ahLcu
#devto#dev#spora#already#agent
Reading 0:00
15s threshold

Spora's agent harness is written in PHP. That is not the obvious choice. Most agent tooling is Python, and PHP is what people reach for when they want a website, not a system that talks to a model.

I picked it anyway. Four reasons, none of them about the language itself β€” and one constraint that turned out to be the reason the rest of it works.

The constraint: PHP's default is one request, one response

The default way to run PHP is a request/response loop: PHP-FPM starts a process, serves one request, and tears it down. A good model for a web page, an awkward one for an agent, which thinks for eight seconds and then wants to hold a socket open while it streams tokens.

PHP can do real-time, and Spora does it where it makes sense β€” the Docker image runs FrankenPHP, the full deployment adds a Mercure hub, and worker:run --daemon is a long-lived PHP process. But none of that is the default.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.