The NanoAgent Series
12 articles, one pattern each - from your first agent to multi-tool orchestration.
Article 00
NanoAgent: Your First AI Agent in PHP
Agent + tool + task, the floor
Article 01
Stateful Chat in PHP - History That Survives Requests
$_SESSION history loop
Article 02
Persistent Memory Chat in PHP - History That Survives Restarts
setMemory() + FileMemory/ArrayMemory/PdoMemory drivers
Article 03
Streaming LLM Tokens in PHP with Server-Sent Events
stream() + SSE + flush
Article 04
Structured Output in PHP - Extract JSON from Text
tool-as-schema extraction
Article 05
Multi-Provider LLM in PHP - Switch Groq/OpenAI/Mock
provider = config, fallback
Article 06
Calling Real APIs from a PHP Agent - Live Weather
FunctionTool that does cURL
Article 07
MCP in PHP - Remote Tool Server in 4 Lines
McpClient + registerMcpServer()
Article 08
Multi-Agent Workflow in PHP - Researcher into Writer
agent chain composition
Article 09
RAG in PHP - Answer From Your Own Docs
search-tool RAG + anti-hallucination prompt
Article 10
Stateful Tools in PHP - Agent That Mutates Inventory
read -> decide -> write
Article 11
Multi-Tool Orchestration in PHP - One Agent, Many Tools
model picks + orders the tools
Ready to ship an agent?
$
composer require hammrouni/nanoagent
MIT, zero dependencies. Explore the full library.
Get the 12-pattern cheatsheet - every pattern from this series on one page.