Session 04 — Bonus Deep-Dive

From Products to
AI Agents

You just learned to build AI products. Now meet the next evolution: AI that doesn't just answer questions — it takes actions in the world. This is the hottest trend in tech right now. Let's understand it.

What Makes an Agent Different?

A chatbot answers questions. An AI product wraps that in a good UX. But an agent can reason, use tools, and take action — all on its own.

Chatbot

What you've used before
You
What's our Q4 revenue?
AI
I don't have access to your company's financial data. You'll need to check your accounting system.
❌ Dead end. You have to go find the data yourself.
VS

AI Agent

What we're building now
You
What's our Q4 revenue?
🛠️
query_database("revenue", "Q4")
🛠️
calculator("2.3M - 2.05M")
AI
Q4 revenue was $2.3M, up 12% QoQ, and 3% above forecast. Strongest growth was in the enterprise segment.
✓ Queried real data. Did the math. Gave you the insight.
🧠 LLM + 🛠️ Tools + 🔄 Reasoning Loop + 💾 Memory = 🤖 AI Agent

The Agent Loop

Every AI agent — from NanoClaw to Claude Code to enterprise systems — follows this exact same pattern. It's elegantly simple.

📨

1. Receive Message

The user sends a question or task. Could come from a chat interface, WhatsApp, Slack, or an API call.

🧠

2. Send to LLM + Tool Definitions

The message goes to Claude (or GPT, Gemini, etc.) along with descriptions of all available tools. The LLM decides: "Do I need a tool, or can I answer directly?"

🛠️

3. Execute Tool (if needed)

If the LLM wants to use a tool, it says: "I need to call get_stock_price("AAPL")." Your code executes the tool and sends the result back.

↩ Loop back to step 2 with the tool result. Claude may need more tools!
💬

4. Synthesize & Respond

Once Claude has all the information it needs, it combines everything into a clear, actionable answer. Done.

💾

5. Remember (optional)

Advanced agents save context for next time — user preferences, past decisions, accumulated knowledge. This turns a one-shot tool into a true assistant.

NanoClaw vs. OpenClaw: A Product Lesson

The biggest story in AI right now is the rise — and growing pains — of personal AI agents. It's a masterclass in product thinking.

400K
Lines of code
OpenClaw
500
Lines of code
NanoClaw
7K+
GitHub stars
in 1 week
8 min
To audit
entire codebase
💥

The Problem: OpenClaw Goes Viral — and Goes Wrong

OpenClaw is an open-source AI agent platform that lets you unleash an AI on your entire computer — email, files, calendar, everything. It exploded to 150,000+ users. But with 400,000 lines of code and 70+ dependencies, nobody could actually audit it for security. Result? A director at Meta's AI lab had her entire inbox deleted by her own AI agent. Other users reported agents making unauthorized purchases and sending unintended messages.

🔒

The Solution: NanoClaw — Simplicity as a Feature

Gavriel Cohen, a developer from Israel, built NanoClaw in a single weekend using Claude Code. His insight: the same core agent functionality doesn't need 400K lines. NanoClaw does it in ~500 lines, with every agent running in an isolated container — like giving each AI its own locked room instead of the keys to your house. Andrej Karpathy (the same person whose neural network videos you watched in Session 2!) endorsed it, calling the core engine "manageable, auditable, flexible."

💡

The Business Lessons

Lesson 1: Simplicity beats features. NanoClaw proved that a smaller, auditable codebase is more valuable than a feature-rich one nobody understands. Sound familiar? (Think: One Core Flow from the Product Canvas.)

Lesson 2: Security = product-market fit. The #1 reason people switched wasn't a cool new feature — it was trust. In the age of AI agents that access your data, "I can read and understand every line of code" is a killer feature.

Lesson 3: "Skills over Features." NanoClaw rejects the traditional software model. Instead of adding features to the codebase, users teach their AI to modify the code itself. Want Telegram support? Don't add it — have Claude Code rewrite your local installation. Each user gets exactly the code they need. This is a totally new paradigm.

🧪 Ready to Build Your First Agent?

Open the Colab notebook and give Claude real tools — a calculator, stock data, company info. Watch it decide which tools to use, chain them together, and synthesize answers like a real AI agent.

Open the Colab Notebook

You'll need your Anthropic API key from Session 3. If you don't have one, pair up with someone who does.