Agentic AI Course: How to Build AI Agents, Beginner to Advanced (in PHP)
Build AI agents that actually do work — from your first tool call to a hosted, production-ready agent.
Beginner to advanced in 24 lessons: tools and the agent loop, guardrails, cost control, memory, MCP, multi-agent and hosting — in PHP with the official Anthropic SDK.
- 24 lessons
- Beginner to advanced
- 2 projects + capstone
- Official Claude SDK
- One-time payment
Last updated 9/2026 English Read online + Word file Created by phpguru.store
What you'll learn
- Explain what an AI agent is, how the tool-use loop works, and when a plain API call or a workflow is the better choice
- Set up a local PHP environment with the official Anthropic SDK, keep keys out of code, and make your first calls knowing what they cost
- Define tools, run the agent loop yourself and with the Tool Runner, and handle every stop reason, error and parallel tool call correctly
- Design tools that are safe to run: prescriptive descriptions, strict schemas, approval gates for irreversible actions, and a permission model
- Control cost with effort levels, the right model per role, prompt caching, token counting and spend caps
- Give an agent memory, keep long conversations under control, and use server tools like web search and code execution
- Connect tools over MCP, coordinate multiple agents, and know when Managed Agents is the right platform
- Host an agent on ordinary shared PHP hosting with a job queue, then take it to production with retries, monitoring and a checklist
One-time payment · 24 lessons · Read online + Word file
Secured by Razorpay · we never see your card/UPI details
You build in PHP with the official Anthropic SDK and Claude, so every example is real and current: tool definitions, the agent loop and the Tool Runner, guardrails and human approval, cost control and prompt caching, memory, long-running agents, server tools, the MCP connector, multi-agent orchestration, Managed Agents, and finally hosting an agent on ordinary shared PHP hosting and taking it to production. Two complete projects (a support-desk agent and a research-and-report agent) plus a capstone tie it together. The first lesson is free, the whole course reads online with your progress saved, you keep it as a Word document, and a certificate of completion is included. Agent features move fast: where something is in beta the lesson says so, and every price and limit is dated so you know what to re-check.
Think of it as a self-paced agentic AI bootcamp you can do alongside work: 24 lessons, two full projects and a capstone, and a certificate of completion when you finish every lesson (a certificate of completion from phpguru.store, not an accredited qualification). Free companion guides: how to build an AI agent, what agentic AI is, AI agents for beginners, agentic AI certification, becoming an agentic AI engineer, and multi-agent systems and MCP.
Is this you?
- You understand what AI agents are, but not how to build one that works.
- Tutorials stop at a demo — nobody shows guardrails, costs or hosting.
- You're worried an agent could take a wrong action or run up a huge bill.
- Most agent courses are Python-only, and you work in PHP.
This course is written to take you from exactly that point to a result you can see.
What you'll build
Two working agents and a capstone of your own
- A support-desk agent that drafts replies for approval
- A research agent that writes cited reports
- Tools with strict schemas and the Tool Runner
- Allow / ask / deny guardrails and a kill switch
- Prompt caching, effort and spend caps
- Memory and long-running context
- MCP and multi-agent orchestration
- A job queue that runs on shared hosting
Before and after this course
Before
- “Agents are a buzzword to me.”
- “I don't know how to keep one safe or cheap.”
- “I can't host one on my server.”
After
- “I build agents with tools and a proper loop.”
- “Mine have guardrails, budgets and approvals.”
- “I can run one in production on shared hosting.”
Why learn it this way
- Read
- Code
- Test
- Build
- Deploy
Every lesson uses real, current code from the official SDK, and every beta feature and price is labelled and dated — so you know exactly what to re-check as the field moves.
Judge it yourself before you pay
- Lesson 1 is free, in full. Read it and try the code — that is exactly the quality of every other lesson. Read it now →
- The full curriculum is on this page. All 24 lessons, with what each covers — you know what you're buying.
- Written by the team that builds the PHP systems sold on this site — the same PHP 8, PDO and security practices our own management systems ship with.
- Secure checkout by Razorpay, instant access, and email support if a lesson doesn't make sense.
Before you start
- PHP 8.1 or newer with Composer and the cURL extension — the free local setup is covered in lesson 2
- You can call a web API and read JSON; the AI for PHP Developers course is the ideal warm-up but is not required
- An Anthropic API key on a pay-as-you-go plan — a few dollars covers every exercise in the course
Curriculum
Lesson 1 is free to read, no account needed. The rest unlock the moment you buy.
- 1 How to build an AI agent — what one is, and when not to build one Preview free What an AI agent actually is (a model, tools and a loop), how it differs from a plain API call or a workflow, the four ways to build one, and the four questions to ask before you do. 4 min
- 2 Set up on localhost — the official PHP SDK and your first call Install the Anthropic PHP SDK with Composer, keep your API key out of code, make your first call, read the response safely, and understand what a call costs. 3 min
- 3 Your first tool — how the model asks your PHP to do something Define a tool with a name, a prescriptive description and a JSON schema; see exactly what the model sends back; run the tool and return the result; and write the simplest agent loop by hand. 3 min
- 4 The loop, done properly — stop reasons, errors, limits and parallel calls Handle every way a turn can end, return tool errors the model can recover from, cap the number of turns, run parallel tool calls correctly, and log every turn. 3 min
- 5 The Tool Runner — the same agent in a fraction of the code Let the official PHP SDK run the loop for you with BetaRunnableTool and toolRunner(); learn what it does and doesn't do, where to put approval gates, and when the manual loop is still the right choice. 3 min
- 6 Designing tools that work — descriptions, schemas and what to expose The rules for tool design: prescriptive descriptions, enums and required fields, strict schemas, a focused tool set, and the bash-versus-dedicated-tool decision that decides what your harness can control. 4 min
- 7 Reliable output — getting exactly the JSON your code needs Use structured outputs to get the agent's final answer as validated JSON, in a PHP class or a raw schema; know the schema limits; and handle the model rules that replaced forced tool use and prefilling. 3 min
- 8 Project — the support-desk agent, end to end Put the Beginner tier together into one working agent that looks up orders, checks stock, drafts a reply for a human to approve, and returns a typed result. 3 min
- 9 Rules and guardrails — allow, ask, deny Give every tool a permission policy, put a human in front of irreversible actions, cap turns and tokens, and build a kill switch — the rules that make an agent safe to run. 3 min
- 10 Security for agents — untrusted input, paths, shells and secrets Why tool results are untrusted input, how indirect prompt injection works, confining file paths, never giving an agent a free shell, and keeping secrets out of prompts, memory and logs. 3 min
- 11 Cost control — effort, the right model per job, and spend caps Understand what an agent run costs, tune effort, use a cheaper model where it holds quality, count tokens before you send, log usage per run, and enforce daily caps. 3 min
- 12 Prompt caching for agents — the biggest cost lever How prompt caching works (a prefix match), where to put cache breakpoints in an agent, how to verify hits, and the silent mistakes that turn caching off without any error. 3 min
- 13 Memory — agents that remember across sessions The difference between conversation state and long-term memory, implementing the memory tool in PHP with strict path safety, and what must never be stored. 3 min
- 14 Long-running agents — context editing, compaction and memory What happens when an agent's conversation grows too large, and the three tools for it — clearing stale tool results, server-side compaction, and memory — with when to use each. 3 min
- 15 Server tools — web search, web fetch and code execution Use tools that run on Anthropic's servers: web search and fetch with domain limits and citations, the code-execution sandbox, handling pause_turn, and why server-tool errors don't raise exceptions. 3 min
- 16 Project — a research-and-report agent with guardrails Combine the Pro tier into one agent that researches a topic on trusted sites, stays inside a budget, caches its prompt, logs cost, and produces a cited report that a human approves before it's published. 3 min
- 17 MCP — connecting agents to other people's tools What the Model Context Protocol is, how to connect a remote MCP server with the MCP connector (both required halves), allow-listing its tools, and when MCP beats writing your own tool. 3 min
- 18 Many tools — tool search, skills and changing the tool set What to do when an agent needs dozens or hundreds of tools: load them on demand with tool search, package instructions as skills, and change the tool set mid-conversation without breaking the cache. 3 min
- 19 Multi-agent — an orchestrator and workers When one agent should hand work to others, how to build an orchestrator with cheaper worker calls in PHP, why workers return results rather than transcripts, and the caching and cost trade-offs. 3 min
- 20 Managed Agents — letting Anthropic run the loop and the sandbox What Managed Agents are, the agent-once/session-every-run model, streaming session events in PHP, permission policies, vaults for credentials, schedules and budgets — and when to choose it over self-hosting. 3 min
- 21 Streaming, UX and evals — agents people trust Stream agent progress to the browser, show which tools are running, handle large streamed tool inputs safely, and build a tiny eval set so you know whether a change made the agent better. 3 min
- 22 Hosting — running an agent on ordinary shared PHP hosting Why agents clash with shared hosting's time limits, the job-queue pattern that fixes it (process a few jobs per run, reconnect the database, requeue stuck jobs), cron, secrets on the server, and when you need a VPS. 3 min
- 23 The production checklist — shipping an agent you can sleep through Retries and timeouts, the right error-handling chain, refusals, versioning prompts and tools, monitoring usage and quality, rate limits, and a rollback plan — as a checklist. 3 min
- 24 Capstone — design and ship your own agent, and what's next Three capstone briefs to build end to end with everything in the course, the honest limits of agents, how to get your certificate of completion, and where to go next. 3 min
How it works
- 1 · Buy once
One payment in your own currency, no subscription. Your account is created from the email you pay with.
- 2 · Log in and read
Every lesson opens in your account on any device. Mark each one done and pick up where you left off.
- 3 · Keep the Word file
The whole course as a .docx — annotate it, print it, read it offline. Re-download it any time from your orders.
Where this course fits
- AI for PHP Developers
- Agentic AI Course · you are here
- Advanced PHP Architecture
Questions about this course
Do I need to know Python?
No. Everything is in PHP. The concepts transfer to any language.
Will it cost much to run the exercises?
A pay-as-you-go Anthropic API key with a few dollars covers every exercise; lesson 11 teaches you to measure and cap costs.
Is there a certificate?
Yes — a certificate of completion when you finish every lesson. It is a completion certificate, not an accredited qualification; the agents you build are your real proof.
Is this a video course?
No — it's written to be read. Every lesson is built around code you type and run yourself, with exercises at the end, and takes about 3 minutes to read. Code is text; reading it lets you copy, search and re-read the exact line you're stuck on.
What exactly do I get?
Two things: the lessons online in your account (with your progress saved), and the same content as one Word document (.docx) you download and keep. Both are delivered instantly after payment.
Do I need an account?
It's made for you at checkout from the email you pay with — you log in with a one-time code sent to that email (or Google), no password to remember.
Which PHP version is this written for?
PHP 8, using PDO prepared statements, password hashing and the practices our own management systems ship with — not the decade-old mysql_* code most free tutorials still carry.
Can I get a refund?
Like our software, courses are delivered instantly and are non-refundable — which is why lesson 1 is free to read and the full curriculum is listed above before you buy. See the refund policy.
Code SAVE40 applied at checkout · ends in …
One-time payment · Read online + Word file · No subscription · Billed in USD, international cards accepted
Read lesson 1 freeSecured by Razorpay. We never see your card/UPI details.
- 24 lessons, about 74 minutes of reading
- Read online in your account, on any device
- Progress saved lesson by lesson
- The whole course as a Word (.docx) file
- Printable certificate of completion when you finish
- Access doesn't expire — no subscription
- Email support if a lesson doesn't make sense
What happens after you pay
- 1. The Word file link appears on-screen and is emailed to you
- 2. Log in with the same email (one-time code, no password) and every lesson is open
- 3. Read at your own pace — mark lessons done as you go
Courses are delivered instantly and are non-refundable — which is why the first lesson is free to read before you decide.