Delegating to Subagents with the Claude Agent SDK
A code review agent that hands work to security and test subagents: routing via AgentDefinition, hooks that prove delegation happened, parallel and background runs, and a cost cap you can verify.
Thoughts on Cloud Computing, DevOps, and Software Engineering.
Sharing lessons learned from building scalable systems.
A code review agent that hands work to security and test subagents: routing via AgentDefinition, hooks that prove delegation happened, parallel and background runs, and a cost cap you can verify.
A fully local retrieval-augmented generation stack: PostgreSQL with pgvector stores embeddings, Ollama runs the embedding and chat models. No API keys, no cloud, ~100 lines of Python.
An agent that misbehaves is a black box until you trace it. Self-host Langfuse with Docker Compose, instrument a tool-calling agent with the Python SDK, and see every LLM call, tool execution, token count, and cost in one trace tree.
A hands-on setup for Microsoft Playwright MCP: install it in Claude Code, Codex, or VS Code, drive a real page through accessibility snapshots, then close the defaults that let an agent reach your logged-in profile, your files, and any URL it likes.
A working MCP server in Go: one tool, one resource, a resource template and a prompt, over stdio and streamable HTTP. Every snippet compiled, tested, and the gotchas verified against v1.8.0.
A hands-on tutorial that builds a working MCP server exposing tools, resources, and prompts, then wires it into Claude Code. Copy-paste Python with the FastMCP SDK.
A hands-on tutorial on building multi-agent systems with LangGraph. Covers the supervisor pattern, tool isolation, structured output routing, and the Functional API. With copy-paste Python code.
Build a support triage agent where the model cannot call a tool with junk, refunds are validated in Python, retry loops are budgeted, and the whole loop runs in pytest with no network. Pydantic AI 2.63.0, full code.
Set up Docker MCP Gateway from the CLI: profiles, the server catalog, secrets, stdio vs streaming transports, client wiring for Claude Desktop and VS Code, and the cases where a plain stdio config is still the better call.
LLM output is text until you make it typed. Learn how structured outputs and Pydantic turn raw model replies into validated Python objects, on both the OpenAI API and a local Ollama server. With copy-paste code.
Step-by-step tutorial to build a custom MCP server in Python with SQLite-backed task management tools. Test it with the MCP Inspector, then connect it to Claude Desktop or VS Code.
Compile a Pydantic schema into a token mask so a local model cannot emit malformed JSON. Includes a measurable before/after test, regex and choice constraints, and the vLLM 0.12 API change that breaks older guided decoding code.
Elicitation lets an MCP tool stop mid-call, ask the user a question, and keep going with the answer. A working resolver-based server on mcp 2.2.0, the flat-schema rules, the 2026-07-28 transport change, and the security requirements you cannot skip.
A tight feedback loop for MCP development: launch your server inside the Inspector, inspect its tools, call one by hand, and read the raw response. With the CLI mode for CI and the failure modes that break Claude Desktop connections.
Most MCP tutorials stop at one client, one server. Real agents need many. This guide builds a Python client that connects to two MCP servers in parallel, prefixes their tools to avoid collisions, and hands them to Claude as Anthropic-format tool definitions.
A step-by-step build of a support triage agent with Google ADK 2.0: custom function tools, session state, a Workflow graph with routing, the eval set that locks the routing down, and deploy commands.
Stop parsing LLM output with regex and hoping. Use structured outputs on OpenAI and Anthropic to get schema-compliant JSON, then layer validation on top.
Use Anthropic's official Claude Agent SDK to build a Python agent with custom tools, in-process MCP servers, PreToolUse hooks, and streaming output. Real code, no hand-waving.
A 40-line SQL harness that measures real recall@10 and latency for HNSW and IVFFlat on 50,000 vectors. With measured numbers for ef_search, m, and probes, plus the Docker shared memory error that breaks the first index build.
A pure vector index drops exact tokens like exit code 137. Build a dense + BM25 hybrid collection in Qdrant with RRF fusion, then add a local cross-encoder reranker, with measured output from a 16-document test index.
A hands-on guide to the Model Context Protocol. Write a server that exposes tools, resources, and prompts over stdio or HTTP, then wire it into Claude Desktop, Cursor, or your own client. With copy-paste Python.
Give each AI agent a specific role, hand them real tools, and let them collaborate. Build a research-and-writing crew that researches a topic and writes a report — in under 30 minutes, all in Python.
Run PostgreSQL in Docker with production-ready config. Covers initialization, persistent storage, automated backups with pg_dump, connection pooling, and performance tuning.
Step-by-step guide to installing the NGINX Ingress Controller on Kubernetes, configuring path-based routing, and setting up automatic TLS certificates with cert-manager.
A complete GitHub Actions workflow that builds a Docker image, caches layers between runs, and pushes to Docker Hub or GHCR. With copy-paste YAML and a comparison of cache strategies.
A hands-on guide to building a production-like local dev stack with Docker Compose. Covers service setup, volumes, health checks, environment variables, and hot reload with real working code.
Model Context Protocol is becoming the standard way to give LLMs access to tools and data. This guide walks you through building a real MCP server in Python, connecting it to Claude Code, and shipping it in under an hour.
A practical setup for a private, offline code reviewer. Pull a coding model in Ollama, wire it to VS Code through Continue, and review diffs without your code ever leaving the machine.
Build a TypeScript MCP server with the official SDK, expose it over streamable HTTP, add OAuth 2.1, test it with the MCP Inspector, and publish it to the official MCP Registry. Production-grade setup, no hand-waving.
A working RAG pipeline in 200 lines of Python: Postgres with pgvector, Voyage embeddings, Claude for generation, and an evaluation loop. Real commands, real costs, no hand-waving.
Run open-source LLMs on your own GPU box and get an OpenAI-compatible API in one command. Covers install, PagedAttention, OpenAI server, performance tuning, and production deployment.
A hands-on guide to Ollama: install, pull a model, run it from the CLI, call it from Python and Node, build a custom Modelfile, and know when to use it instead of vLLM or a hosted API.
A skill is a folder with a SKILL.md file, and most first attempts never trigger. Here is the frontmatter, the description pattern, the folder layout, and a validator you can run before you trust it.
A plain docker run gives you a container, not a sandbox. Here are the image and the run flags that close off network, filesystem, memory, pids, and privilege escalation, plus four tests that prove each wall holds on your own machine.
Give your LLM real tools. Build an MCP server in Python that exposes custom functions and resources — connect it to Claude Desktop in under 15 minutes.
Six practical techniques to shrink Docker images by 90%, cut deployment time, and reduce your attack surface. With copy-paste examples for Go, Node.js, and Python.
Best practices for building reliable deployment pipelines for engineering teams — from concept to production-grade pipeline.
Migration journey from monolith to microservices using Kubernetes and AWS. Lessons learned during the transition process.
An agent that pauses for human approval, dies with its worker, and resumes in a different process. Built on a Postgres checkpointer, with the four traps that cause duplicate charges in production.
Practical tutorial on using k6.io for load testing. Includes example scripts and result interpretation for production environments.
A step-by-step Python setup for tracing the agent loop, its model calls, and every tool call with the OpenTelemetry GenAI conventions. Includes the conversation-id span processor most agents forget, a local mock so you can run it without an API key, and the span output from the actual run.
Complete guide to setting up monitoring for production infrastructure. From installation to creating meaningful dashboards.
Step-by-step tutorial to build a local AI agent that reads files, runs shell commands, and handles multi-step requests using Ollama and Python. No cloud API needed.
Stop paying full price for the same system prompt on every API call. A hands-on guide to prompt caching with Anthropic (automatic + explicit) and OpenAI — with copy-paste Python code and real cost comparisons.
A poisoned MCP tool description stays invisible in the client UI and fully readable by the model. Build a vulnerable server, scan it two ways, pin tool hashes, and see what scanners miss.
The Tasks extension lets an MCP server hand back a durable task handle instead of holding the connection open. Here is the wire format, a job-and-poll pattern that works on every host today, and where SDK support actually stands.
A hands-on tutorial for building a stateful AI agent with LangGraph. We build a research assistant that searches the web, runs calculations, and routes between tools based on context — with copy-paste code and zero fluff.
A hands-on guide to Agent2Agent 1.0 with the official Python SDK: publish an agent card, implement an AgentExecutor, stream a task, and skip the two mistakes that break it in production.
Install Coolify on a VPS, lock down the dashboard, deploy an app from Git, connect Postgres, and ship backups to S3. Includes a restore test and when to pick Coolify over Dokku, Kamal, or plain Docker Compose.
A hands-on guide to building a Model Context Protocol server that lets Claude read your files, browse directories, and fetch URLs. Includes copy-paste Python code, MCP Inspector testing, and Claude Desktop integration.
Build a working memory layer for your agent: Mem0 as the library, Qdrant for vectors, and Ollama for extraction and embeddings. Real commands, no API keys, plus the errors you will actually hit.
A hands-on promptfoo setup that tests what your agent actually did, not just the final answer: YAML config, tool-path assertions, trajectory checks for agent SDKs, a red team scan, and a CI gate. Runs without an API key.
Quantize a GGUF model, serve it with llama-server, and wire it into a Python agent loop that gets structured tool calls back instead of prose.
Build a Python agent harness that stays coherent past turn 40. Measure tokens per request, clear dead tool results on the server side, compact the transcript, keep decisions in a notes file, and delegate search to subagents that return 2000 token summaries instead of 40000 token transcripts.
GEPA rewrites your prompt against a metric instead of your intuition. Build a small DSPy triage program, score it, optimize the instructions with text feedback, then run the result on a local Ollama model. Every API call checked against dspy 3.3.1.
Stand up a team-wide AI interface on your own hardware in about fifteen minutes: pinned Docker images, a compose stack with SearXNG, knowledge bases over your documents, and the ConfigVar trap that eats an afternoon.
Turn a local LLM into an agent that actually acts. Build the tool-calling loop from scratch in Python with Ollama and qwen3, no API key and no per-call cost, then learn when to move on to LangGraph.
Stand up a working Model Context Protocol server, expose tools your agent can call, hook it into Claude Code or your own client, and learn the one mistake that breaks every stdio server.
A hands-on pipeline to adapt a 7B model to your domain: build a small dataset, train with QLoRA on a single GPU in Unsloth, and serve the result locally through Ollama.
Every RAG tutorial sends your documents to an API provider. This one keeps embeddings, vector search, and the LLM on your own machine with Ollama and pgvector. Two open source tools, zero API keys, runs on a laptop.
Run one OpenAI-compatible endpoint in front of OpenAI, Anthropic, and your local Ollama. Virtual keys, budgets, spend tracking, and load balancing in a self-hosted proxy.
Run open models like Llama 3.2 and Qwen on your own machine, then point any OpenAI SDK client at Ollama by changing one line. Install, model selection, Modelfile, embeddings, and server tuning.
Install Caddy, point it at a domain, and TLS certificates appear on their own. Hands-on steps for static hosting, reverse proxying, load balancing with health checks, and Basic Auth, all from one small Caddyfile.
Hands-on guide to running Qdrant with Docker and building semantic search in Python: collections, payload filters, named vectors, and hybrid search with RRF. Plus a straight answer on when to pick Qdrant over Chroma or pgvector.
One model response can carry several tool calls. The parallel tool calling pattern for the OpenAI and Anthropic APIs, with copy-paste Python loops, plus when sequential execution is the right call.
A copy-paste tutorial using the MCP Python SDK v2: expose tools, resources, and prompts, test with the Inspector, register with a host, and serve over HTTP. Every command verified against the official docs.
A hands-on tutorial using the current MCP Python SDK (v2). You will build a weather server, test it with an in-memory client, connect over stdio, and wire it into a real host like Claude Desktop.
Convert a Hugging Face model to GGUF, build an importance matrix from your own text, quantize three levels, then measure which one actually costs quality. Real commands, real KL divergence numbers.
Chat demos do not catch the day your agent starts refunding orders it never looked up. Here is a pytest eval harness you can build in 30 minutes: golden dataset, deterministic tool-call checks, an LLM-as-judge for open-ended replies, and a CI gate.
A system prompt that says "never delete anything" is a suggestion, not a permission system. Here is what holds: a locked Postgres role, a read-only transaction, a row cap, and a timeout. Full MCP server code, tested on PostgreSQL 18.
A hands-on review of the ripgrep, fzf, and bat stack for instant terminal search. Install, real commands, piping them together, and when each beats grep, find, or IDE search.
Three frameworks, one task: an order-support agent that looks up orders, issues refunds, and escalates to a human. Same spec built three ways, with real code and a decision guide for when each one wins.
Ollama allocates context based on VRAM, not on what the model was trained for. Measure the real allocation, pin it per model, quantize the KV cache, and check every change with token per second numbers from your own machine.
A private, offline retrieval-augmented generation chatbot that answers from your own documents. Copy-paste setup with Ollama for the models and Chroma for the vector store, no cloud API keys.
Prompting for JSON is not the same as getting JSON. A copy-paste guide to OpenAI and Anthropic structured outputs with Pydantic: raw JSON Schema, refusal handling, schema limits, and a full invoice extractor.
A crash-proof approval gate for destructive agent actions, built with Temporal Workflows, Signals, and a timeout that fails closed. Every command tested.
Sampling is deprecated and its back-channel is gone in MCP 2026-07-28. Migrate step by step: call the provider directly, borrow the caller model through InputRequiredResult, or pin v1 while clients catch up.
Build a working MCP server in TypeScript with the official SDK. Register a typed tool, test it with the MCP Inspector, and connect it to Claude Desktop, in four steps.
Hands-on semantic search with Chroma: real queries, metadata filters, full-text search, persistence, and a retrieval pipeline for RAG. Every snippet run for real, with the exact output printed.
Run SearXNG in Docker, enable its JSON API, and wire it into an agent as a tool. Working config, a tested Python client, and the failure modes that actually bite.
A hands-on guide to the cache_control marker on Anthropic, automatic caching on OpenAI, and explicit caching on Gemini. Includes the cost formula and the breakpoint mistakes that silently kill your cache hits.
A hands-on tutorial: build a small system-info MCP server in Python, test it in the MCP Inspector, and wire it into Claude Desktop. Includes copy-paste code and real commands.
MCP lets Claude Desktop, Cursor, and other AI hosts use your tools without custom glue. Build a real weather server with the v2 Python SDK, test it in memory, over stdio, and over HTTP, then wire it into a host. Every snippet verified against mcp 2.0.0.
A working vLLM 0.32 setup on one 24GB GPU: install, launch the OpenAI-compatible server, stream responses, wire tool calling, do the KV cache math, and watch prefix cache hits in Prometheus.
A remote MCP server that accepts one static API key hands the same key to every client. Here is how to turn it into a real OAuth 2.1 resource server: publish Protected Resource Metadata, validate token audience, split scopes, and stop token passthrough. Working FastMCP code plus the raw HTTP shapes.
A working end-to-end setup that replaces the dead spinner with a live stream: a FastAPI backend that pushes OpenAI-compatible tokens over SSE, and a browser client that renders them as they arrive.
Build a support bot that routes itself: a triage agent with handoffs, an input guardrail that blocks prompt injection before the main model runs, and escalations that carry structured metadata. Full working example on the OpenAI Agents SDK.
A working queue-mode n8n 2.45.7 stack with Postgres 18, Redis, task runner sidecars, an AI Agent wired to an external MCP server, and n8n exposed as an MCP server for Claude Desktop.
Hosted web search, file search, and Code Interpreter with runnable Python. How to read citations out of the response, the real per-call pricing, and when a hosted tool is the wrong choice.
One standard way to hand an LLM tools, resources, and reusable prompts. Build a real MCP server with the official Python SDK, test it in the Inspector, and connect it to a host. Copy-paste ready.