Skip to content
Cognitecta

02 / Programme

AI Engineering with Python

Build working AI systems in Python — agents, retrieval, and the production concerns that decide whether a prototype can leave the lab.

3 days · Up to 12 participants · On-site or remote · From £10,000

Talk to us

Who it is for

Software engineers and technical leads who will design, integrate and own LLM systems — not a room being shown a chatbot.

Who it is not

It is not an executive overview, and it is not a survey of products. Delegates write, test and run code.

What they will be able to do

  1. 01

    Call, stream and constrain an LLM from Python, with prompts and structured outputs that can be tested.

  2. 02

    Build a tool-calling agent with a registry, allowlists, rate limits, audit logs and an evaluation harness.

  3. 03

    Stand up MCP servers and wire them into an agent over stdio, including live tools and structured data.

  4. 04

    Index a corpus, retrieve with citations, and compare dense, sparse, hybrid and reranked search.

  5. 05

    Extract facts into a graph, add memory with decay, and run ReAct and plan-and-execute loops.

  6. 06

    Take a system toward production: tracing, retries, cost controls, guardrails, and a deployable FastAPI service.

Outline

Day 01

Build a working agent

  1. 00

    Python fundamentals

    The engineering substrate the rest of the week sits on: dataclasses and Protocols, CLI and logging, asyncio (tasks, queues, timeouts, cancellation), then HTTP with FastAPI and httpx.

  2. 01

    Working with the LLM

    Chat completions, message roles and parameters; token streaming; prompting for structured outputs, grounding and tool calling; a console chat with session storage.

  3. 02

    Tool calling

    Tool-call message format and agent state. A decorator-based registry (schema, validation, routing, errors). Safety rails: allowlists, rate limits, redaction, audit logs. An evaluation harness with golden tests, replay and deterministic mocks.

  4. 03

    MCP servers

    MCP as a protocol: tool discovery, schemas, calling conventions. FastMCP servers over stdio, dynamic discovery, and practical tools — structured data, web fetch, file I/O — connected to a live agent.

  5. 04

    A research assistant

    Day 1 closer. Model selection, structured outputs, multimodal (vision and transcription), FastAPI with SSE streaming, and MCP tools inside a web API. The agent leaves the console.

Day 02

Knowledge and retrieval

  1. 05

    RAG fundamentals

    Chunking (size, overlap, structure-aware), embeddings, vector stores. Dense, sparse, hybrid retrieval and reranking. Grounded prompting with citations, a comparison with and without retrieval, RAG evaluation, then the same index exposed as an MCP server.

  2. 06

    Structured facts

    Pydantic and JSON Schema structured outputs. Fact extraction with provenance and confidence. Knowledge graphs: entities, relations, path queries. Grounded QA that must cite [Fact N] or refuse.

  3. 07

    Agent memory

    Short-term session buffer versus long-term profile. Summarisation against a token budget. Decay and “do not remember”. Memory exposed as an MCP server so the agent can read and write it as a tool.

  4. 08

    Structured workflows

    Day 2 closer. ReAct (reason, act, observe), plan-and-execute with replanning, tool routing, and structured execution traces — workflows as software, not a prompt that hopes.

Day 03

Ship it

  1. 09

    Multi-agent systems

    When multiple agents help, and when they add failure modes. Roles (router, specialist, critic). Coordination: supervisor, swarm, debate, blackboard. Shared context, scoped tools, peer handoffs, consensus and conflict.

  2. 10

    LangChain, as a choice

    LCEL, prompt templates, output parsers, AgentExecutor, RetrievalQA, LangServe. The same loops already written by hand, now in a framework — so the room can judge the abstraction rather than start inside it.

  3. 11

    Edge topics

    Pick-and-choose, according to the room: hybrid search, reranking, HyDE, agentic RAG, citation verification, web-search backends, text-to-SQL, LLM evaluation, fine-tuning datasets, guardrails, semantic caching, multimodal RAG, contextual chunking.

  4. 12

    Productionisation

    Tracing, retries, circuit breakers, cost controls, deployment. Capstone: a production FastAPI backend for a real interface — RAG with hybrid search and reranking, agentic RAG with tools, or chat + MCP with cost controls.

How it is taught

Live engineering education. Delegates work in a Python lab with pytest on every exercise. Demos are run, not slid through. The programme can be tailored to the organisation’s stack; the spine stays the same.

Delivery and price

From £10,000 for up to 12 participants, on-site or remote. Talk to us to confirm dates, location, and any tailoring.

Instructor

Nicholas Johnson, AI architect and software engineer. Degree in Artificial Intelligence; around twenty years of professional technology training. About.

Talk to us