FutureStackDev AI Agent Development

LLM Apps: Types, Architecture by Use Case, Challenges and Risks

You leave able to choose the right LLM architecture for a use case, say why, and name what will go wrong before it does.

Created by Baljeet Dogra

What this course is

A pattern catalogue and a decision discipline. Most LLM education teaches one architecture — usually RAG or agents — and leaves learners to assume it generalises. The result is teams building an agent where a classifier would do, and a RAG pipeline where a database query would do.

This course does the opposite. It works through the full space of LLM application types, gives each one a reference architecture, and then attacks it: where it breaks, what it costs, what it exposes you to legally and commercially, and which simpler thing you should have built instead.

Every architecture is taught alongside its failure mode and its risk profile. Those are not a final module. They are half of each module.

  • Place a use case on three axes — autonomy, context dependency, consequence — and let that, not the label, pick the architecture.
  • Carry fourteen archetypes as one-page cards, including when each is wrong.
  • Name silent failures as well as loud ones, and map each risk to an architectural control.
  • Reject the simpler alternative in writing, or you have not chosen.
  • Defend the design to security, a DPO, a board, and a sceptical senior engineer.

What this course is not

Not prompt engineering

Prompting appears as a component, never a topic.

Not a framework tour

LangGraph, LlamaIndex and the rest appear as implementations of patterns, never as the curriculum.

Not model training

Fine-tuning appears once, as an architectural option with a cost and a maintenance liability.

Not a build-a-startup course

The capstone is an architecture and a defence, not a product.

The spine: three axes and a card

Everything in the catalogue is positioned on three axes. These axes, not the use case label, determine the architecture and the risk class. A system’s position predicts its dominant failure mode more reliably than its use case does. That claim is tested in Week 1 and used for the remaining nine.

Autonomy

How many decisions the model makes without a human or a deterministic guard between it and an effect. From “returns a label” to “executes tool calls in a loop until it decides it’s done”.

Context dependency

How much of the answer must come from outside the model’s weights, and how fresh and how permission-sensitive that outside context is.

Consequence

What happens when it’s wrong. A wrong tag on a support ticket, a wrong figure in a board pack, and a wrong dose in a clinical note are three different systems even if the prompt looks the same.

Every archetype in Part 2 is delivered on the same one-page card. Learners produce cards of their own for use cases from their real work. The card is the course’s reusable artefact.

ARCHETYPE: <name>
Position:        autonomy / context / consequence
Canonical shape: <the minimum component set>
Right when:      <conditions>
Wrong when:      <conditions — this section must be non-empty>
Dominant failure: <the one that will actually bite>
Silent failures:  <the ones with no error to catch>
Risk class:      <accuracy / security / data / regulatory / commercial>
Eval strategy:   <what you measure, and what “good” is>
Cost driver:     <what the bill scales with>
Simpler alternative: <the non-LLM or lighter option and when it wins>

What you will produce

One lab artefact a week that you keep, then a capstone that is a decision, evidenced. Nothing is assessed that you would not be asked to produce in a design review. No exam.

Weekly

Archetype cards

Cards for the catalogue, plus cards from your own work. 15% of the grade.

Lab 4 / 7

Diagnosis and red-team

A broken RAG from traces alone (nine seeded faults). Then indirect prompt injection against a peer’s system.

Capstone 1–3

Selection, architecture, FMEA

Memo with candidates eliminated; component-level responsibilities and trust boundaries; failure mode and effects including the silent ones.

Capstone 4–6

Risk, cost, evaluation

Risk register mapped to controls; unit economics with sensitivity; evaluation plan with a baseline and a falsification test.

Discipline

Simpler alternative rejected

No architecture passes without a written account of the lighter option and why it loses.

Defence

20 minutes under challenge

Structured challenge, not a demo. Assessment: architecture fit 25%, failure and risk 20%, economics and eval 15%, defence 15%, cards 15%, red-team 10%.

10-week curriculum

Two 90-minute sessions per week, plus a weekly lab. Intermediate: assumes you can build software; assumes nothing about LLM internals. Expand a week for the syllabus. Content stays searchable when closed.

01 What makes an LLM app a different kind of software Week 1 · Part 1

Before any architecture, the properties that break conventional engineering instincts.

  • Non-determinism as a first-class design constraint: testing, debugging, support, reproducibility and blame.
  • Silent failure. Conventional systems mostly fail loudly. LLM systems return fluent, well-formatted, confident wrong answers at a steady background rate.
  • The prompt is untested code in production — usually not in version control, not reviewed, and not owned.
  • Capability is not the constraint. Cost, latency, trust, integration and permissions are. Demos test capability, which is why demos mislead.
  • “It worked when I tried it” is not evidence. Introduced early so every later module can be held to it.
  • Variable cost per unit of work — an unfamiliar model for teams used to fixed-cost servers.

Lab 1: one prompt, 50 runs at temperature 0, two model versions. Write up the variance. Most learners’ first genuine surprise.

02 Family A — LLM as a function Week 2 · Archetypes 1–3

Bounded input, bounded output, deterministic surroundings. The most under-used and most reliable family.

  • 1. Classification and routing. Input normalisation → constrained-output call → confidence handling → deterministic action → sampled human review. Taught first because it is the cheapest, most measurable, most deployable pattern — and the one most often skipped. Dominant failure: distribution shift in the input, silently. Cost driver: volume × input length.
  • 2. Structured extraction and document processing. Ingest → layout/OCR → chunk or page targeting → schema-constrained extraction → validation → exception queue. The exception queue is the architecture. Dominant failure: confident extraction from the wrong region. Risk class: data accuracy with downstream financial or legal effect.
  • 3. Transformation and summarisation. Source → length/scope control → generation → faithfulness check → provenance. Dominant failure: omission rather than fabrication, which is much harder to detect and much easier to get sued over.

Labs 2–3: build a classifier with an exception queue and measure it. Then extraction with a validation layer; deliberately feed it malformed documents.

03 Family B — Grounded knowledge systems Week 3 · Archetypes 4–6

Answers must come from a corpus, not the weights.

  • 4. RAG question answering. Nine failure surfaces, not a pipeline diagram: retrieval miss vs noise, stale index, chunk boundary damage, conflicting sources, lost-in-the-middle, citation that doesn’t support the claim, permission bleed through a shared index. Wrong when the answer lives in a database, the corpus fits in context, the question is a calculation, or nobody will own curating a contradictory corpus.
  • 5. Semantic search and discovery. The human still reads the source, which moves the consequence profile substantially. Often the correct de-risked substitute for archetype 4.
  • 6. Text-to-query analytics. Schema and semantic layer → query generation → static validation → read-only sandboxed execution → result explanation → query shown to the user. Dominant failure: a syntactically valid query that answers a subtly different question. Never hide the generated query, never grant write access.

Lab 4: diagnose a broken RAG system from traces alone. Pre-built. Nine seeded faults.

04 Family C — In-product assistance Week 4 · Archetypes 7–9
  • 7. Conversational assistant. Session state, history compaction, tool or retrieval access, safety and scope boundaries, escalation. Dominant failure: scope creep by the user into territory the system was never evaluated on.
  • 8. Embedded copilot and inline generation. Tight context from the current work, low-latency model tier, suggestion never commitment, accept/reject telemetry. Latency budget in hundreds of milliseconds dictates model, prompt size and caching. The accept/reject signal is the best evaluation data in the catalogue and is routinely not captured.
  • 9. Generative content production at scale. Brief → generation → brand and factual gate → human approval → publishing. Dominant risks are not technical: IP provenance, near-duplicates, search-engine treatment, reputational exposure. Includes where this pattern destroys value rather than creating it.
05 Family D — Workflow and autonomy Weeks 5–6 · Archetypes 10–12
  • 10. Deterministic workflow with LLM steps. An explicit graph or state machine where the LLM occupies specific nodes, with typed contracts, retries, idempotency and a human gate on side effects. The argument of the course: this is the correct architecture for the large majority of tasks that teams currently label “agentic”. Reliability compounds multiplicatively across steps; this pattern is where you control the multiplier.
  • 11. Single agent with tools. Narrow tool contracts, reasoning loop, step and time budget, termination, sandbox, traces, reversibility. Failures as first-class content: non-termination, loop repetition, silent tool failure treated as a result, cascading error, budget exhaustion, confused deputy. Wrong when the task path is knowable in advance, the actions are irreversible, the tool surface is wide, or nobody will fund tracing and evaluation.
  • 12. Multi-agent and long-horizon systems. Taught with a deliberately sceptical framing: cost, latency and debugging multiply faster than capability in most business contexts. The module’s job is to make you able to say no with reasons, and to build it properly when the answer is yes.

Labs 5–6: convert an “agent” into a deterministic workflow and compare reliability and cost. Then build a tool-using agent, budget-bound and sandbox it.

06 Family E — Meta and platform layers Week 6 · Archetypes 13–14
  • 13. LLM-as-judge and evaluation systems. Golden dataset → rubric → judge model → calibration against human labels → drift monitoring. A real production system whose chief failure is a judge that agrees with your own model’s style rather than its correctness.
  • 14. Gateway, routing and platform layer. Unified interface, routing by task and cost, caching, quota, logging and PII, fallback chain, spend controls. Turns vendor risk from an existential dependency into a configuration change. Usually built too late, after three teams have hardcoded three different providers.
07 Context, state and orchestration Week 7 · Part 3

The decisions that recur in every archetype and are usually made by accident.

  • Context engineering as a budget problem: what earns a place in the window, and what to evict first.
  • Memory: session, short-term summary, long-term store, and the retrieval of memory as its own failure surface.
  • State and durability: where the truth lives when a multi-step run dies halfway.
  • Model selection as architecture: capability tiers, routing, cascade, open-weights vs API, and what changes when you cannot send the data out of your estate.
  • When fine-tuning is genuinely the right answer, and the maintenance liability you take on.

Lab 7: red-team a peer’s system with indirect prompt injection.

08 Serving, cost, trust and the human Week 8 · Part 3
  • Latency: streaming, perceived vs actual, the p99 problem, speculative and cached paths.
  • Cost engineering: token accounting, caching tiers, batch vs interactive, cost per resolved task rather than per call, a unit-economics model before the feature ships.
  • Observability: tracing, replay, prompt and version pinning. Without a trace store your system is undebuggable by construction.
  • Human-in-the-loop: where the gate goes, how to make review cheap, automation complacency, presenting uncertainty and provenance without the interface lying by omission.
  • Rollout: shadow mode, canaries, evaluation gates in CI, reversibility.

Lab 8: unit economics model for one archetype at three traffic levels.

09 Challenges and risks Week 9 · Part 4

A register, not a warning list. Each risk is paired with the architectural control that mitigates it, because a risk with no control is just anxiety.

  • Correctness: fabrication, omission, stale grounding, retrieval miss, format breakage, non-termination, cascading error, over-refusal, quality regression on a provider version bump.
  • Security: direct and indirect prompt injection, tool abuse and confused deputy, exfiltration through rendered output and URL construction, permission bleed in shared indexes, third-party tool servers, treating model output as untrusted input.
  • Data protection: UK GDPR in practice — lawful basis, purpose limitation where prompts become training data, DSAR and erasure against embeddings and prompt logs, retention, international transfer, DPIA triggers that actually apply.
  • Regulatory and liability: EU AI Act risk tiering for a system you are designing now. Sector overlays, with financial services treated in depth. Who is accountable for a generated output.
  • Commercial and operational: vendor concentration, price and rate-limit changes mid-contract, non-determinism inside support, evaluation theatre, shadow AI, the cost tail from the first month of real traffic.
  • Organisational: who owns the prompt, who owns the corpus, who is on call, what happens when the model is confidently wrong to a customer at 2am.

Lab 9: complete a risk register with mapped controls for a real use case.

10 Choosing and defending an architecture Week 10 · Part 5 · Capstone
  • Decision procedure: use case → axes → candidate archetypes → elimination on constraints → simplest survivor.
  • The “simpler alternative rejected” discipline.
  • Architecture decision records for AI systems, including fields conventional ADRs lack: evaluation basis, cost model, failure envelope, reversibility.
  • Writing for the approver: security team, DPO, board, sceptical senior engineer.
  • Capstone defences.

Lab 10: 20-minute defence against structured challenge.

Deliberately excluded: model internals beyond what a decision requires; prompt engineering as a subject; framework tutorials; fine-tuning mechanics; vector-database benchmarking; anything that cannot be tied to an architectural decision. A course about judgment earns credibility by naming its boundaries.

Against the rest of the portfolio

The obvious use is as the front door and as the standalone corporate offering. It is the only course in the set that a head of engineering can send a mixed team on, and the breadth-first structure makes it a natural feeder into the others.

Dimension This course Applied GenAI Engineering Principal AI Engineer
Central question Which architecture, and what will it cost me How do I build and ship it Am I accountable for it at scale
Unit of work An architecture and a defence A shipped increment A system with SLOs and a threat model
Prerequisite weight Light Has shipped an LLM feature Has owned a production AI system
Coverage Broad across app types Deep on one build path Deep on post-training, inference economics, org scope
Best commercial fit Corporate cohorts, architects, consultancies Individual engineers levelling up Senior individual contributors and leads

Who this is for

Engineers after the first LLM feature

You have shipped one. Now you have to choose the second.

Tech leads and architects

You are being asked to approve AI designs and need a vocabulary that survives a review.

Product engineers

Build vs wrap vs buy — with a written simpler alternative, not a slide.

Consultants and platform teams

Justify an architecture to a client, or standardise patterns across an organisation.

Prerequisites

  • Comfortable in one backend language; can read Python
  • Has called an LLM API and handled the response
  • HTTP services, queues, databases and authentication at a working level
  • No statistics prerequisite. Evaluation is taught from zero

Not a fit if

  • You are a complete beginner to software
  • You want model internals, a prompting workshop, or framework certification
  • You expect to train a model

Ready to ship after you can choose? Take Applied GenAI Engineering. Already shipping and accountable at scale? Take Becoming an AI Principal Engineer.

Delivery

Cohort and cost

Cap around 30 — defence and red-team pairing set the ceiling. Lab API credits of roughly £20–30 per learner for the whole course. Vendor-plural: at least two providers and one self-hosted path.

3-day intensive

Drops Parts 3 and 5 to a single day and removes the capstone. The version architects and CTOs buy; priced as advisory, not training.

Questions

How is this different from Applied GenAI Engineering?

This course asks which architecture, and what it will cost you. Applied GenAI Engineering asks how you build and ship it. The unit of work here is an architecture and a defence; there it is a shipped increment. Take this first if you are choosing; take that when you are ready to deploy every four weeks.

Is this a prompt engineering or LangChain course?

No. Prompting appears as a component, never a topic. Frameworks appear as implementations of patterns. Fine-tuning appears once, as an option with a cost and a maintenance liability. Content half-life is around 18 months because archetypes and risk classes move more slowly than tooling; provider-specific detail stays in the labs.

Is there a 3-day version?

Yes. Parts 3 and 5 collapse to a single day and the capstone is removed. That is the version architects and CTOs buy, priced as advisory rather than training. The 10-week path is the one with cards, red-team pairing, and a 20-minute defence.

Ready to choose, not just build?

10 weeks part-time, or a 3-day intensive. Fourteen archetypes, a card you can take into a design review, and a defence under challenge. Create an account to enrol.

Enrol now