Neuron AI, the PHP framework for building AI agents, just shipped version 4.0. It's a framework-agnostic library, and this release rebuilds the workflow engine that runs agents and changes how they stream, remember, and call tools.
- A rebuilt workflow engine with a smaller public API
- Streaming Channels, so agents running in a background worker can still stream to the browser
- Long-term memory across conversations
- Events through PSR-14, with Guzzle and Inspector no longer required
- A rewritten tool approval flow and a new
FrontendTool
What's New
A Rebuilt Workflow Engine
The team rebuilt the internal workflow engine to make the public API smaller. Running an agent, handling a tool approval, and resuming a run are now short operations instead of exposing the machinery underneath.
Streaming got faster along the way. The release fixes several bugs and bottlenecks in the streaming system, and the default HTTP client is now a low-level implementation on PHP's ext-curl, so Guzzle is no longer a dependency.
Streaming Channels
Agents often need to run outside the HTTP request because of timeouts, which used to leave their streamed output with no way to reach the UI. Streaming Channels deliver that output through a real-time system instead. Redis pub/sub and Pusher (plus Pusher-compatible services) are built in, and you can add your own through the channel interface.
Docs: Streaming Channels
Long-Term Memory
The new SemanticMemoryRetrieval component stores and recalls memories across a user's sessions, so an agent can remember past conversations and preferences. Chat history was refactored at the same time. A new MessageStoreInterface handles storage, and messages that fall out of the context window are marked archived instead of deleted, so the model sees a trimmed thread while your database keeps the full history.
Docs: Semantic memory
Tools
The tool approval flow was rewritten. The ToolApproval middleware is gone, and the agent now manages approvals itself, storing each tool's approval status in the chat history so your UI can render Approve and Deny buttons from the messages.
FrontendTool is new. It defines a tool the model can call but your frontend runs, such as a browser or mobile device API. The agent pauses the run, hands you the pending calls, and continues once you send back the results.
Tool inputs are now cast to their declared types too. If the model sends "5" for an integer, it arrives as an int, and a value that can't be converted goes back to the model as an error instead of throwing a TypeError.
Docs: Tool approval and FrontendTool
Observability
Neuron now sends its events through a standard PSR-14 event dispatcher, so it plugs into the dispatcher your app already uses. The old observer system is deprecated. The Inspector monitoring client, which shipped inside Neuron by default through version 3, is no longer a dependency. Inspector funds Neuron's development, and creator Valerio Barbera says observability should be your choice.
Security Fixes
The release also includes a long list of fixes. Several are security fixes, including an SSRF in the token counter, a Cypher injection in the Neo4j component, and a fix so local MCP servers no longer receive the application's full environment variables.
Upgrade Notes
Version 4 has breaking changes. ChatHistoryInterface was removed in favor of MessageStoreInterface, the Tool class is now abstract, the ToolApproval middleware is gone, and the CalculatorToolkit replaced its single math operations with one evaluate tool. The repository ships an upgrade directory with a step-by-step plan written for AI coding assistants, alongside the upgrade guide.
Neuron 4 requires PHP 8.1 or higher and ext-curl. Version 3 is still getting fixes, with 3.17.1 out on October 1.
composer require neuron-core/neuron-ai