AI Engineering
Learn LLMs, RAG, agents, secure tools, and production AI through practical insurance examples.
Browse the complete question directory
Start here
AI and LLM fundamentals
- AI, machine learning, deep learning, and generative AI
- LLMs and how they work
- Tokens and token usage
- Context window and context construction
- Temperature and top-p
- System, user, assistant, and tool messages
- Prompt engineering, zero-shot, and few-shot prompting
- Structured output and JSON output
- Function calling and tool calling
- Streaming
- Multimodal models, vision, and audio
- Model selection, routing, fallback, latency, and cost
- Provider ecosystems: OpenAI, Anthropic, Gemini, and Azure OpenAI
Python for AI engineers
Embeddings
- Embeddings, vectors, dimensions, and semantic similarity
- Similarity and cosine similarity
- Embedding models, generation, storage, and limitations
- Explain an embedding.
- What does cosine similarity tell you?
- How do you upgrade embedding models?
- Policy-code search fails despite good semantic search. What do you do?
Vector databases and search
RAG, beginner to advanced
- RAG: three levels of understanding
- Document ingestion, PDF processing, and parsing
- Chunking, chunk size, overlap, and metadata
- Retrieval, context construction, and prompt construction
- Citations and source attribution
- Query rewriting, multi-query retrieval, and query decomposition
- Hybrid RAG, reranking, and parent-child retrieval
- Multi-hop RAG and agentic RAG
- Corrective RAG, self-reflective RAG, and context compression
- Graph RAG
- RAG evaluation and comparison with alternatives
Agents and agent patterns
LangChain
LangGraph, in depth
- What LangGraph is and why it exists
- State and reducers
- Nodes, edges, conditional edges, and routing
- Practical TypeScript graph with an approval pause
- Checkpoints, persistence, and memory
- Interrupts and human review
- Tool integration and the agent loop in a graph
- Subgraphs and multi-agent graphs
- Streaming graph events
- Errors, retry logic, and recovery
- Production architecture and choosing LangGraph
Modern agent frameworks
Deterministic and agentic workflows
Workflow orchestration
Model Context Protocol (MCP)
AI memory
AI security
- Prompt injection, indirect injection, and jailbreaking
- Tool poisoning and excessive agency
- Data leakage, PII, sensitive data, and secrets
- Authentication, authorization, least privilege, and tenant isolation
- Validation, rate limiting, and secure database access
- What is prompt injection?
- Why avoid direct database access?
- What are the main trust boundaries?
- An invoice tells the agent to email private records. What blocks it?
Guardrails
- Input, output, and tool guardrails
- Schema validation: Zod and Pydantic
- Moderation and PII detection
- Hallucination mitigation, business rules, and approval
- What is a guardrail?
- Does valid structured output mean safe output?
- What should fail closed?
- A moderation check rejects legitimate injury descriptions. What do you do?
AI evaluation
AI observability
Cost and performance
AI gateways
Multimodal AI
Local AI
Fine-tuning
Cloud AI
MERN and AI
- Shared MERN architecture
- AI chatbot
- Streaming AI chatbot
- RAG chatbot
- AI search
- AI summarizer
- AI extractor
- AI classifier
- Customer-support agent
- CRM assistant
- Email assistant
- Workflow automation and introducing Python/FastAPI
- Where does the LLM call belong?
- How do MongoDB, Redis, and a vector index differ?
- How do you structure the backend?
- A React chat UI renders malicious generated HTML. What changes?
MongoDB and AI
AI system design
- Scalability, availability, reliability, and latency
- Queues, caching, databases, and vector indexes
- Providers, failover, security, multi-tenancy, and observability
- Design 1: RAG chatbot
- Design 2: Customer-support agent
- Design 3: Insurance claim agent
- Design 4: AI CRM agent
- Design 5: Document processing system
- Design 6: Email agent
- Design 7: Research agent
- Design 8: Multi-agent system
- Design 9: Enterprise knowledge assistant
- What questions come before architecture?
- How do you scale agent traffic?
- How do you design degraded behavior?
- Design an insurance assistant in two minutes.
Insurance AI reference project
Practical project roadmap
- Project 1 — Basic LLM chatbot
- Project 2 — Streaming AI chatbot
- Project 3 — PDF RAG assistant
- Project 4 — Production RAG application
- Project 5 — Tool-calling agent
- Project 6 — LangGraph agent
- Project 7 — Multi-agent customer support
- Project 8 — MCP server plus AI agent
- Project 9 — Deterministic plus agentic workflow
- Project 10 — Production insurance AI platform
Interview preparation
LLMs
Prompt engineering
RAG
Vector databases
LangGraph
AI agents
MCP
Microsoft Agent Framework
Workflows
Memory
Evaluation
Observability
Cost optimization
Python
FastAPI
Senior engineer decision framework
- The decision mindset
- Do I need AI? Can deterministic code solve it?
- Do I need an LLM?
- Do I need RAG?
- Do I need tools? Do I need MCP?
- Do I need an agent? Do I need LangGraph?
- Should this be a workflow?
- Where is human approval required?
- How do I secure it?
- How do I evaluate it?
- How do I observe it?
- How much does it cost?
- How does it scale?
- Real client decisions
- Stable concepts, framework concepts, and changing APIs
- A concrete architecture proposal template
Interview revision cheat sheet
How to use this AI Engineering guide
A practical textbook for building AI applications, agents, and reliable client solutions.
Priority key
Priority key
Contents
AI and LLM fundamentals
AI, machine learning, deep learning, and generative AI
Artificial intelligence, or AI, is the broad field of making software perform tasks such as recognizing speech, finding patterns, or understanding language. Machine learning, or ML, learns patterns from examples instead of requiring a rule for every case.…
LLMs and how they work
A large language model, or LLM, is a model trained on large amounts of data to process and generate language. It learns patterns in how text is arranged and can use those patterns for summarization, extraction, explanation, and tool selection. It does not…
Tokens and token usage
Tokens are the small units of input and output processed by a model. A token might be a word, part of a word, punctuation, or another encoded unit. Token counts depend on the tokenizer, language, and content; characters and words are only rough estimates.
Context window and context construction
A context window is the amount of model input and generated content a model can handle within its documented limits. Context is the particular information you provide for one call: instructions, messages, evidence, and tool results. A large window gives…
Temperature and top-p
Temperature changes how sharply a model favors its higher-scoring next-token choices. Lower values generally reduce variation; higher values allow more variation. Top-p, also called nucleus sampling, restricts selection to a set of tokens covering a chosen…
System, user, assistant, and tool messages
Message roles identify the purpose and source of information. System or developer instructions describe application behavior, user messages contain requests, assistant messages contain model responses, and tool results supply external observations. Exact role…
Prompt engineering, zero-shot, and few-shot prompting
Prompt engineering is writing clear task instructions, inputs, constraints, and output expectations. Zero-shot prompting gives instructions without examples; few-shot prompting adds a small number of input/output examples. A prompt is part of the application…
Structured output and JSON output
JSON output is machine-readable data, such as an object with named fields. Structured output adds a declared schema so the response follows expected fields and types when the provider supports schema-constrained generation. Valid JSON, valid schema, and valid…
Function calling and tool calling
Function calling lets a model propose a named function and structured arguments. Tool calling is the broader pattern that includes functions and capabilities such as search or code execution. A proposed tool call is an untrusted request that your application…
Streaming
Streaming delivers response events as work happens instead of waiting for the entire response. Text events may contain small pieces called deltas. The browser can show progress and partial text while the server continues processing.
Multimodal models, vision, and audio
Multimodal models process more than one kind of input or output, such as text with images or audio. Vision means interpreting visual content; audio understanding includes spoken words and sometimes sounds or vocal context. Support differs by model and…
Model selection, routing, fallback, latency, and cost
Model selection chooses a model for a task. Routing chooses among models or processing paths per request, while fallback handles a failed or unavailable preferred path. Latency is waiting time; cost includes tokens, tools, retrieval, infrastructure, and…
Provider ecosystems: OpenAI, Anthropic, Gemini, and Azure OpenAI
Providers supply hosted model inference and related capabilities. OpenAI, Anthropic, and Google offer their own model ecosystems; Azure OpenAI provides access to supported OpenAI models within Azure's service and identity environment. Common concepts…
Python basics, lists, dictionaries, and sets
Python is a dynamically typed language widely used by AI libraries. A list is an ordered collection, a dictionary maps keys to values, and a set stores unique hashable values. Python uses indentation to define code blocks rather than braces.
Functions, classes, modules, and exceptions
Functions package operations; classes group state and behavior; modules are importable Python files or packages. Exceptions represent errors that interrupt normal control flow until handled. These serve the same broad purposes as functions, classes, imports,…
Difficulty is an editorial estimate. Completion means you chose to mark a question as understood.