Free training
AI and agents for backend developers
Four short lessons for backend developers. If you know how to call an HTTP API, you have enough background to start. Each lesson includes a free exercise you can do on paper and links to related practice drills.
Your first model call
Learn what a language model returns and where your backend still makes the decision. · 8 min
Think of the model as a draft writer
A language model takes text and produces a likely response. It can summarize a support ticket or suggest a category. A fluent answer can still be wrong. Keep the original ticket, and use application code to decide which values are allowed.
Check the shape before using it
Suppose a model should return a category of Billing, Delivery, or Other. Parse its reply, check the category against your three choices, and reject unexpected fields. If parsing fails, send the ticket to manual sorting. Keep model calls out of your database transaction so a slow response does not hold a connection.
Try it on paper
Write three input examples, including one ambiguous ticket. Decide what the service should return if the model times out, returns an unknown category, or sounds confident about the wrong category. Write an assertion for each behavior.
Practice drills
- Generated JSON bypasses the schema boundary · Full edition drill
Read more
Answer from your own documents
Understand retrieval and check whether an answer is grounded in the right source. · 9 min
Search first, then ask
Retrieval-augmented generation, or RAG, means looking up useful passages and giving them to the model with the question. Imagine an order-support service that fetches the current delivery policy and asks the model for a short answer with a citation.
Decide what evidence is allowed
Filter documents by the signed-in customer and document version before the model receives them. Treat document text as evidence. If the search has no useful result, return an honest “I couldn’t verify that.” A citation is useful when the service can match it to a passage it actually retrieved.
Try it on paper
Create two short policies for different regions and give each a version. Ask a question about a region with no current policy. Decide which documents the service may read and what it says when those documents do not answer the question.
Practice drills
- The answer cites a document that was never retrieved · Full edition drill
Read more
Give an agent a tool
Build a mental model for tool calls, permissions, and approval in a backend service. · 10 min
What an agent does
An agent uses a model to choose a next step, such as looking up an order, asking a question, or finishing. A tool is a small operation your backend exposes. Start with a read-only tool such as findOrder. A fixed workflow is often enough when the same sequence works for every request.
Your service makes the permission decision
The model proposes an order number. The tool handler gets the customer identity from the signed-in session, looks up the order within that customer’s account, and returns only the fields needed for the task. For a write such as changing the delivery address, show the exact proposed change and require approval before the handler runs it.
Try it on paper
Sketch a Java interface for findOrder and write down its allowed fields. Then sketch a separate address-change command. Identify who authorizes the write, when approval expires, and the result if the address changes between preview and confirmation.
Practice drills
- The order assistant can see the wrong customer · Full edition drill
Read more
Make an agent safe to retry
Handle uncertain tool results and test what the agent actually does. · 12 min
A lost reply can hide a successful write
Imagine an agent creates a support case and the service times out after saving it. A second call can create a duplicate. Give each approved action a stable operation ID and make repeated calls return the original result. If a downstream system cannot deduplicate or look up the outcome, escalate uncertain writes for review.
Put a limit on a run
Set a time budget and a maximum number of tool calls. Save the current step and the IDs of completed actions so a worker can resume after restart. Record which tool ran, the decision to allow or deny it, and its outcome. Keep private customer text out of routine logs.
Try it on paper
Write a test where a support case is committed and the response is lost. Run the same request twice and assert there is one case. Add a second test where the agent gets stuck and reaches its tool-call budget. Assert that it stops and tells a person what is unresolved.
Practice drills
- One agent request opens two support cases · Full edition drill
- A model upgrade silently changes tool behavior · Full edition drill