# Day 2: The Basics

> You'll learn how LLMs, agents, and tools work together: the building blocks of every AI coding assistant. Understanding these basics helps you use and evaluate tools with confidence.

- **Source:** https://ainativesoftware.engineering/roadmap/day-2
- **Site:** AI-Native Software Engineering — https://ainativesoftware.engineering/book

- **Day:** 2 of 7
- **Topics:** 7
- **Reading time:** 18 minutes

You'll learn how LLMs, agents, and tools work together: the building blocks of every AI coding assistant. Understanding these basics helps you use and evaluate tools with confidence.

## The 7 topics

- 01 · [How Large Language Models Work](https://ainativesoftware.engineering/roadmap/day-2/how-large-language-models-work.md) — Tokens, context windows, attention mechanisms, and why LLMs are surprisingly good at code, and where they still fail. _(3 min)_
- 02 · [Prompt Engineering for Engineers](https://ainativesoftware.engineering/roadmap/day-2/prompt-engineering-for-engineers.md) — How to craft prompts that produce consistent, reliable results, and how the same techniques are used offensively to break AI systems. _(3 min)_
- 03 · [From Autocomplete to Agents](https://ainativesoftware.engineering/roadmap/day-2/from-autocomplete-to-agents.md) — The evolution from single-turn code completion to autonomous multi-step agents: what defines an agent, how the agentic loop works, and when to use agents versus simpler approaches. _(2 min)_
- 04 · [Building an Agent in 50 Lines of Code](https://ainativesoftware.engineering/roadmap/day-2/building-an-agent-in-50-lines-of-code.md) — A ground-up look at what an agent really is under the hood: an inference client, a set of tools, and a while loop, using Hugging Face's Tiny Agents as a concrete reference. _(3 min)_
- 05 · [Memory and State in Agent Workflows](https://ainativesoftware.engineering/roadmap/day-2/memory-and-state-in-agent-workflows.md) — How agents retain and retrieve information across steps and sessions: short-term context, long-term memory, and practical strategies to prevent context rot. _(2 min)_
- 06 · [AI Failure Modes Every Engineer Must Know](https://ainativesoftware.engineering/roadmap/day-2/ai-failure-modes-every-engineer-must-know.md) — Hallucination, confident wrongness, context drift, and the foundational security risks that arise when AI agents can take actions in the world. _(3 min)_
- 07 · [Human in the Loop](https://ainativesoftware.engineering/roadmap/day-2/human-in-the-loop.md) — Why keeping humans in the decision loop is essential when working with AI agents, and how to design workflows that stay under control. _(2 min)_

**Every curated resource in day 2**

- [Intro to Large Language Models](https://www.youtube.com/watch?v=zjkBMFhNj_g)
- [What Are LLMs? – Hugging Face Agents Course](https://huggingface.co/learn/agents-course/en/unit1/what-are-llms)
- [Artificial Analysis – Independent AI Model Benchmarking](https://artificialanalysis.ai/)
- [The Ultimate Guide to Prompt Engineering – Lakera](https://www.lakera.ai/blog/prompt-engineering-guide)
- [Gandalf – AI Red Teaming Challenge by Lakera](https://gandalf.lakera.ai/)
- [What Are AI Agents? – Google Cloud](https://cloud.google.com/discover/what-are-ai-agents)
- [What Are Tools? – Hugging Face Agents Course](https://huggingface.co/learn/agents-course/en/unit1/tools)
- [Tiny Agents: an MCP-powered agent in 50 lines of code – Hugging Face](https://huggingface.co/blog/tiny-agents)
- [Types of Memory in AI Agents – Taskade](https://www.taskade.com/blog/ai-agent-memory)
- [OWASP Top 10 for Agentic Applications](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/)
- [MCP Security Issues Threatening AI Infrastructure – Docker](https://www.docker.com/blog/mcp-security-issues-threatening-ai-infrastructure/)
- [Human in the Loop - jsdevai.com](https://jsdevai.com/pillars/hitl)

- **Previous day:** [Day 1: What is AI-Native Engineering](https://ainativesoftware.engineering/roadmap/day-1.md)
- **Next day:** [Day 3: The AI Agents Landscape](https://ainativesoftware.engineering/roadmap/day-3.md)
- **All days:** [The 7-day roadmap](https://ainativesoftware.engineering/roadmap.md)

---

_AI-Native Software Engineering by Alfonso Graziano (O'Reilly Media, Early Release; print edition February 2027). Every page of ainativesoftware.engineering is also served as Markdown: append `.md` to any URL. Index: https://ainativesoftware.engineering/llms.txt — whole site in one file: https://ainativesoftware.engineering/llms-full.txt._
