Applied AI SystemsVol. 14B · Part XIV
0 / 0

Shelves / Applied AI Systems

AS·181

Applied AI Systems Projects

Eight build-it-yourself projects that turn this volume into working systems: an embedding and vector-search lab on your own documents, a cited RAG assistant with permissions, an evaluation harness that would catch every trap in this volume, a fine-tuned and preference-tuned small model, a structured-output and tool-calling service, a durable agent with a protocol server, an observable and secure production stack, and a cost-and-quality architecture review, each with milestones, measurable definitions of done and stretch goals.

12 topics · ~7 min read · 5-question quiz
Updated Suggest a correction

How to approach the projects

From a model call to a system you'd put your name on

The labs measured one mechanism at a time, often with substitutes because the lab machine has no capable model. These projects use real ones: any hosted model API you have access to, or an open model you can run (a few-billion-parameter model on a laptop or a single GPU is enough for most). Use documents you're allowed to use: your own notes, public-domain text, open documentation, or this textbook.

# Project Main chapters Roughly
1 Semantic search over your documents 159, 160 1 week
2 A cited RAG assistant with permissions Start Here, 161 1–2 weeks
3 An evaluation harness that can't be fooled 162, 175 1 week
4 Adapting a small open model 163–166 2 weeks
5 A structured-output and tool-calling service 167, 168 1 week
6 A durable agent with an MCP server 169–172 2 weeks
7 Multimodal and generative add-ons 173, 174 1 week
8 An observable, secure, costed production stack 176–180 2 weeks

New to the field? Do them in order: projects 2, 3 and 8 together make a production-grade assistant. Experienced? Do 3, 6 and 8, and treat the rest as checks on parts you haven't built yourself.

The working method

  1. Write the eval before the feature (chapter 175): a golden set, held out from everything the system sees.
  2. Measure every part separately: retrieval, generation, tools, latency, cost.
  3. Treat model output as untrusted input: validate, constrain, authorise, sanitise.
  4. Record everything: versions of prompts, models, indexes and eval sets; traces for every request.
  5. Write a README per project with numbers, error analysis and the decisions you made.

The eight projects

Project 1: semantic search over your documents

Goal. Search a corpus of at least 1,000 chunks better than keyword search alone, and prove it.

Milestones. Golden set of 200+ real-style queries with relevant chunks labelled → BM25 baseline → one or two embedding models (with correct query/document prefixes) → hybrid fusion → a cross-encoder reranker → an ANN index (HNSW) with recall measured against exact search → metadata filters that don't starve.

Done when. A table reports recall@5, MRR and latency for BM25, dense, hybrid and hybrid + rerank with paired confidence intervals; ANN recall@10 ≥ 0.98 against exact search; a filtered query for a 1% subset returns full results.

Stretch. Re-embed with a second model behind an alias and switch the live index without downtime.

Project 2: a cited RAG assistant with permissions

Goal. An assistant that answers only from your documents, cites them, says "I don't know", and never leaks a document to someone who can't read it.

Milestones. Parsing and heading-aware chunking with source metadata and ACLs → retrieval from project 1 → a prompt with labelled sources and citation rules → answer + citations in a structured format → refusal when sources don't support an answer → per-user permission filtering at retrieval time.

Done when. On 100 answerable and 30 unanswerable questions, ≥ 90% of answers are correct with citations that support them, ≥ 80% of unanswerable questions are refused, and an automated test shows zero restricted chunks in prompts for unauthorised users.

Stretch. Incremental re-indexing: an edited document's answers change within 5 minutes; a deleted one disappears.

Project 3: an evaluation harness that can't be fooled

Goal. A harness that would have caught every misleading result in this volume's labs.

Milestones. Versioned datasets with hashes → deterministic checks (format, citations, forbidden content) → LLM-as-judge with a rubric, order swapping and human calibration on 50 items → paired bootstrap and McNemar comparisons → contamination checks (exact and near-duplicate overlap with training data, prompts and indexes) → a CI job that blocks regressions.

Done when. Planted problems are each detected: a 10% contaminated test split, a judge with position bias, a 30-item test set too small to decide, a prompt change that helps one template and hurts another, and a real 5-point regression.

Stretch. Online evaluation on sampled production traces, with results linked back to trace IDs.

Project 4: adapting a small open model

Goal. Measure what SFT, preference optimisation, quantisation and serving choices do to a small open model on your task.

Milestones. Task eval (≥ 200 held-out items) and a general-skill regression set → LoRA SFT on a few hundred examples → DPO on 200+ preference pairs checked for length and format confounds → 8-bit and 4-bit quantisation → serving with an inference engine and KV cache, measuring TTFT and throughput at several concurrencies.

Done when. One table shows task score, general score, answer length and memory for base, SFT, SFT + DPO, and each quantisation; another shows throughput and p95 TTFT at concurrency 1, 8 and 32.

Stretch. Speculative decoding with a smaller draft model, with accepted tokens per step and end-to-end speed-up.

Project 5: a structured-output and tool-calling service

Goal. An API that turns free-text requests into validated actions safely.

Milestones. Typed schemas (Pydantic or Zod) → constrained or validated outputs with retries → three tools with strict schemas, authorisation from the authenticated user, approval thresholds, timeouts and idempotency keys → error messages the model can act on → an audit log of every proposed and executed action.

Done when. On 100 scripted adversarial and malformed requests, there are zero unauthorised or duplicate side effects and zero crashes; valid requests succeed ≥ 95% of the time.

Stretch. A dry-run mode that shows the user exactly what will happen before any approval.

Project 6: a durable agent with an MCP server

Goal. An agent that completes a multi-step task reliably, survives crashes, waits for a human, and uses tools over MCP.

Milestones. An MCP server exposing your tools (pinned definitions, safe errors) → an agent loop with step, token, money and time budgets and repeat detection → a checkpointed workflow (a durable-execution platform or a framework checkpointer) → a human-approval step → memory with a fact store and provenance → trajectory evaluation on 30 tasks.

Done when. Killing the worker at random points in 50 runs produces no duplicate side effects and no lost tasks; task success and cost per task are reported with intervals; a changed tool definition is blocked until re-approved.

Stretch. Run the same tasks as a fixed workflow and as an agent, and compare success, cost and latency.

Project 7: multimodal and generative add-ons

Goal. Add one input modality and one generated output to project 2 or 6, with evaluation.

Milestones. Image or document input (screenshots, receipts, scanned pages) with resolution chosen by measured accuracy vs tokens → speech input or output if relevant → one generated asset (an image, chart or audio summary) with provenance metadata → safety and privacy review (faces, IDs, text-in-image injection).

Done when. Accuracy and token cost are reported at three resolutions; injected instructions in uploaded images are treated as data in 20 test cases; generated assets carry content credentials.

Stretch. A small diffusion or flow model fine-tuned (LoRA) on images you own, with a memorisation check.

Project 8: an observable, secure, costed production stack

Goal. Take project 2 or 6 to production standard.

Milestones. Gateway with authentication, rate limits and per-user token budgets → streaming responses → OpenTelemetry GenAI traces with redaction and tail sampling → dashboards for latency, tokens, cost, refusals and feedback → security controls (link sanitiser, CSP, trifecta policy, least-privilege tools) and a red-team regression suite → model registry with aliases, eval gates and a canary → semantic cache with a measured threshold → a cost model and a design-review document.

Done when. A load test meets a stated p95 TTFT SLO at a stated concurrency; every planted leak (PII in traces, exfiltration link, cross-tenant cache hit) is caught; a bad release is stopped by the gate or rolled back by alias in under a minute; the cost model matches a week of measured spend within 15%.

Stretch. A provider outage drill: fail over to a second model or provider and measure the quality and cost change.

Tracking your progress

Portfolio checklist

Keep code, prompts, configs, eval sets (with hashes), traces and reports in Git, with a README per project. Applied-AI evidence is numbers you can reproduce: "hybrid + rerank recall@5 0.91 [0.88, 0.94] vs BM25 0.78; RAG answers 92% correct with supporting citations, 85% correct refusals, 0 permission leaks in 1,000 tests; harness caught a 10% contamination plant and a position-biased judge; LoRA + DPO raised task score 18 points with 2 points of general regression; 0 duplicate side effects in 50 crash runs; p95 TTFT 450 ms at 32 concurrent users; cost $1.90 per 1,000 requests" is what makes the portfolio credible.

Mapping to mastery levels

Completing projects 1, 2 and 5 with their checks puts you at L2 across the volume. Doing their stretch goals and explaining every design choice is L3–L4. Designing and defending projects 3, 6 and 8 (an evaluation harness, a durable agent, and a secure, observable, costed production system) is L5 work, the level applied-AI and AI-platform engineering interviews probe.