AI Engineering
Build real AI products: AI APIs, prompt systems, retrieval, agents, evaluation, and shipping reliable services.
32 lessons
Estimated lesson study time: 509 minutes
Lesson estimates are a guide, not a deadline. Allow extra time for practice, projects, and review.
Learn AI & Technology Access gives you full access to all 19 tracks and 552 lessons after sign-up and onboarding. No time limit, paid subscription, or payment card required.
Start Learn AI & Technology AccessIncludes three AI Tutor answers across these courses. AI-generated content remains subject to Learn’s monthly allowance.
Track overview
Connect model APIs, prompt systems, embeddings, retrieval, agents, tools, evaluation, and reliability into an AI-product workflow. Advanced work examines routing, fallback behavior, and the practical tradeoffs involved in shipping services.
Who this track is for
Developers and technical learners who want to build AI-enabled software systems.
Before you begin
Working knowledge of Python or similar programming, HTTP APIs, and structured data will help. Use approved data, protect credentials, and set external API spending limits.
What you will work toward
Practice building AI-service components with grounded retrieval, bounded tools, evaluation, provider fallbacks, and explicit quality, latency, and cost tradeoffs.
Complete lesson outline
1. Calling AI APIs
4 lessons
1.1 Chat Completions Fundamentals
14 minutes- Send a chat completion request and read the response
- Authenticate requests with an API key from the environment
- Extract the generated message content from the response object
1.2 Message Roles and Parameters
14 minutes- Distinguish system, user, and assistant message roles
- Tune temperature, top_p, and max_tokens for output control
- Explain how message order shapes the model response
1.3 Streaming Responses
15 minutes- Enable token streaming to display output incrementally
- Iterate over streamed chunks and accumulate the text
- Explain why streaming improves perceived latency
1.4 Structured Output with JSON
16 minutes- Request JSON output with a response format schema
- Validate returned JSON against a Pydantic model
- Handle parsing failures gracefully
2. Prompt Systems
4 lessons
2.1 Designing System Prompts
14 minutes- Write system prompts that set role, tone, and constraints
- Separate stable instructions from dynamic user input
- Explain how system prompts steer model behavior
2.2 Few-Shot Prompting
15 minutes- Provide worked examples to guide model output
- Choose representative examples that cover edge cases
- Explain the tradeoff between examples and token cost
2.3 Prompt Templates
15 minutes- Build reusable prompt templates with placeholders
- Inject variables safely to avoid prompt injection
- Version templates so changes stay reviewable
2.4 Guardrails and Safety
16 minutes- Add input and output guardrails around model calls
- Detect and block unsafe or off-topic requests
- Explain defense-in-depth for AI applications
3. Embeddings and Retrieval
4 lessons
3.1 Understanding Embeddings
15 minutes- Generate embedding vectors for text with the API
- Explain how vectors capture semantic meaning
- Compare texts using cosine similarity
3.2 Vector Search
16 minutes- Store embeddings in a vector database
- Run nearest-neighbor queries to find relevant text
- Explain the role of an index in fast retrieval
3.3 Chunking Documents
15 minutes- Split long documents into overlapping chunks
- Balance chunk size against retrieval precision
- Attach metadata so chunks stay traceable to sources
3.4 Building a RAG Pipeline
18 minutes- Combine retrieval and generation into one flow
- Inject retrieved context into the model prompt
- Explain how RAG reduces hallucination on private data
4. Agents and Tools
4 lessons
4.1 Function Calling
16 minutes- Describe tools to the model with JSON schemas
- Read tool call requests from the model response
- Return tool results back into the conversation
4.2 Tool Use Loops
17 minutes- Loop between model calls and tool execution
- Append tool outputs and re-invoke the model
- Detect when the model has produced a final answer
4.3 Multi-Step Agents
18 minutes- Design an agent that plans and executes multiple steps
- Maintain agent state and memory across steps
- Explain the plan-act-observe cycle
4.4 Agent Safety Limits
16 minutes- Cap agent iterations and tool budgets
- Restrict tools to a safe allowlist
- Add human-in-the-loop approval for risky actions
5. Evaluation and Reliability
4 lessons
5.1 Writing Evals
16 minutes- Define an eval dataset of inputs and expected outputs
- Score model outputs with automated checks
- Explain why evals catch quality regressions
5.2 Regression Testing Prompts
16 minutes- Snapshot prompt behavior to detect changes
- Run eval suites in continuous integration
- Explain how to compare prompt versions objectively
5.3 Managing Cost and Latency
16 minutes- Estimate token usage and cost per request
- Choose model size to balance quality and speed
- Reduce cost with shorter prompts and smaller models
5.4 Fallbacks and Resilience
16 minutes- Retry failed calls with exponential backoff
- Fall back to an alternate model on failure
- Return a safe default when all attempts fail
6. Shipping AI Products
5 lessons
6.1 Building a FastAPI AI Service
17 minutes- Expose an AI endpoint behind FastAPI
- Validate request bodies with Pydantic models
- Return model output as a structured JSON response
6.2 Caching AI Responses
16 minutes- Cache responses keyed by a hash of the request
- Set expiry so cached answers stay fresh
- Explain how caching cuts cost and latency
6.3 Observability for AI Apps
16 minutes- Log prompts, responses, tokens, and latency
- Trace requests end to end for debugging
- Explain what metrics reveal AI quality drift
6.4 Capstone: Ship an AI App
18 minutes- Combine RAG, tools, evals, and caching into one service
- Deploy the service and verify the endpoints
- Explain the tradeoffs made in the final design
6.5 Rate Limiting and Quotas
16 minutes- Protect an AI service with per-user rate limits
- Enforce token and request quotas to control spend
- Return clear errors and retry hints when limits are exceeded
7. Advanced AI Systems
7 lessons
7.1 Cost Optimization Strategies
16 minutes- Route simple requests to cheaper models and hard ones to larger models
- Trim prompts and cap output length to cut token spend
- Explain how batching and caching lower cost per request
7.2 Advanced Guardrails and Validation
16 minutes- Validate model output against a schema and business rules
- Reject or repair responses that violate constraints
- Explain layered guardrails from input to output
7.3 Multi-Agent Orchestration
16 minutes- Split a task across specialized agents with distinct roles
- Coordinate agents through a shared message protocol
- Explain when multi-agent designs beat a single agent
7.4 Semantic Caching
16 minutes- Cache answers by embedding similarity instead of exact match
- Set a similarity threshold to control cache hits
- Explain the tradeoff between hit rate and answer freshness
7.5 Defending Against Prompt Injection
16 minutes- Recognize direct and indirect prompt injection attacks
- Isolate untrusted content and restrict tool access
- Explain why retrieved data must be treated as untrusted
7.6 Distributed Tracing for AI Pipelines
16 minutes- Instrument multi-step pipelines with spans and trace IDs
- Correlate retrieval, model calls, and tool use in one trace
- Explain how traces speed up root-cause analysis
7.7 Model Routing and Fallback Tiers
16 minutes- Design tiered routing across providers and model sizes
- Fall back to alternate tiers on error or timeout
- Explain how routing balances cost, latency, and quality