←
Neuron AI - PHP agentic framework729 posts
Neuron AI - PHP agentic framework avatar

Neuron AI - PHP agentic framework

@neuronai_php

Neuron AI is the first PHP agentic framework

◷ Joined March 2025▧ 553 Photos and videos
Neuron AI - PHP agentic framework avatar
Neuron AI - PHP agentic framework@neuronai_php·Nov 17

6/ That handler method is 21 lines with blanks and comments. Only that method. The price: a worker to keep alive and a hub to run. For whoever approves your stack: long agent runs shouldn't compete with page requests for PHP workers, and the agent stays in PHP.

Neuron AI - PHP agentic framework avatar
Neuron AI - PHP agentic framework@neuronai_php·Nov 17

5/ You need something in between: Pusher, Soketi, Mercure. The demo uses Mercure: ->setChannel(fn () => new MercureChannel($this->hub, 'neuron-demo/runs/' . $input['runId'], private: FALSE)); Neuron forwards the events there. The browser connects to the hub, not PHP.

Neuron AI - PHP agentic framework avatar
Neuron AI - PHP agentic framework@neuronai_php·Nov 17

4/ A separate process runs it: dr messenger:consume asynchronous That's Symfony Messenger, in Drupal through the sm module. The web worker is free as soon as the 202 goes out. Which opens the next problem: how does the output reach the browser?

Neuron AI - PHP agentic framework avatar
Neuron AI - PHP agentic framework@neuronai_php·Nov 17

3/ This is the whole controller action: $this->bus->dispatch(new AgentRun($agent, $request->toArray()), [new TransportNamesStamp('asynchronous')]); return new JsonResponse(NULL, 202); Look for the line that runs the agent. There isn't one 👀

Neuron AI - PHP agentic framework avatar
Neuron AI - PHP agentic framework@neuronai_php·Nov 17

2/ The web server, PHP-FPM and any proxy in front of them can each end the request on their own timeout. Raise them all and the run still holds a PHP web worker: 20 minutes of agent is 20 minutes that worker serves nobody else. So the agent has to leave the request.