AI Engineering from Scratch: Build Your First AI Application
Learn the foundations of AI engineering and build a small application powered by a pretrained language model. Begin with essential Python and model concepts, then practice prompting, retrieval, evaluation, and safe application design. Complete a guided capstone that brings these skills together, with balanced explanations and hands-on exercises designed for beginners.
Level: beginner · 24 lessons · about 8 h · Free · AI-assisted course created by Sandip Das
What you will learn
Explain how AI, machine learning, and generative AI relate and when to use pretrained models.
Read and adapt basic Python code that sends model requests and handles responses.
Build a small language-model application using prompts and structured outputs.
Add simple retrieval from a small document collection to ground model responses.
Evaluate application outputs with a small test set for relevance, grounding, and failure cases.
Apply basic safeguards for secrets, sensitive data, prompt injection, latency, and cost.
Assemble and demonstrate a guided AI application capstone with documented limitations.
Course outline
1. Understand AI Application Engineering
Build a beginner's mental model of AI and choose a small, realistic document-question-answering project.
From AI to Generative AI(20 min)· free preview Use everyday examples and a relationship diagram to distinguish learning from data, generation, and ordinary programmed rules.
Define a Small, Useful AI Application(20 min) Map inputs, model calls, outputs, and human checks for a local document-grounded question-answering application.
2. Python Essentials and Your First Request
Set up an isolated project and learn just enough Python to send, inspect, and safely handle a model request.
Set Up Python Without Exposing Secrets(20 min) Create a virtual environment, install the selected dependencies, and configure credentials outside source code; offer a clearly labeled no-paid-API replay path.
Read Python Values, Lists, and Dictionaries(20 min) Explain code line by line and practice representing questions, passages, and answers with beginner-friendly data structures.
Use Functions, Files, and JSON(20 min) Build small reusable functions to load a text file, read JSON records, and handle a missing file without a crash.
Send and Inspect Your First Model Request(20 min) Trace request and response data through a minimal SDK example, distinguishing actual API execution from offline replay.
3. Model Behavior and Effective Prompts
Understand token budgets and model limitations, then improve prompts through small controlled comparisons.
Understand Tokens, Context, and Inference(20 min) Use a request-flow diagram and response usage to explain how pretrained models generate text and consume finite context capacity.
Choose Models and Recognize Uncertainty(20 min) Practice spotting unsupported answers and compare quality, latency, and token use without treating generation settings as universal.
4. Turn Model Text into Checked Application Data
Introduce lightweight typed output contracts and explicit handling of invalid, refused, or incomplete responses.
Define an Answer Schema(20 min) Connect familiar JSON dictionaries to a minimal, fully explained Pydantic model for answers, evidence labels, and an insufficient-information flag.
5. Retrieve Evidence from a Small Document Collection
Prepare a safe local corpus, create traceable chunks, and retrieve passages using a lightweight embedding-based search.
Load and Chunk Safe Documents(20 min) Use a few public or synthetic plain-text documents, preserving source labels while splitting them into coherent passages.
Find Similar Passages with Embeddings(20 min) Explain vectors with a simple diagram and adapt a small local embedding-search scaffold without a database or cloud dependency.
Check Retrieval Before Generating Answers(20 min) Compare exact-term and paraphrased questions, inspect missed evidence, and change one retrieval setting at a time.
6. Connect Retrieval to Grounded Answers
Assemble retrieval, evidence-aware prompts, structured answers, citations, and a local interactive loop.
Run Tests, Locate Failures, and Retest(20 min) Record retrieval and answer scores separately, investigate a failure, and compare a single revision against the baseline.
8. Add Safeguards and Operating Limits
Harden the beginner application against data leaks and malicious document instructions while bounding failures, latency, and spending.
Protect Data and Treat Retrieved Text as Untrusted(20 min) Test direct and document-borne instruction attacks using synthetic data, and apply data minimization, safe logging, and least-access principles.
Bound Errors, Cost, and Latency(20 min) Add explicit request limits and safe diagnostics, then sketch deployment responsibilities without building production infrastructure.
9. Finish and Demonstrate Your Document QA Capstone
Use the accumulated application and test artifacts to complete a reproducible local project, verify its behavior, and document honest limitations.
Assemble a Reproducible Local Project(20 min) Consolidate the incremental project rather than start over, with a small approved corpus, configuration example, dependency instructions, and run command.
Demonstrate Results and Document Limitations(20 min) Present a short local demonstration, a practical runbook and cheat sheet, and a reflection using review and interview-style questions.