---
title: "Discussion on \"Day 01: Why your first agent should be 40 lines, not a framework\" | Hashnode"
description: "Discussion on \"Day 01: Why your first agent should be 40 lines, not a framework\". The first agent I ever got working, I did not understand. I had installed a framework, pasted eleven lines out of its quickstart, and watched a correct answer appear. Then I changed the prompt slightl"
url: "https://hashnode.com/posts/the-40-line-agent/6ac903a79a41abbf2103357a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Day 01: Why your first agent should be 40 lines, not a framework](https://harshakatkam.dev/the-40-line-agent?utm_source=hashnode&utm_medium=feed)

The first agent I ever got working, I did not understand. I had installed a framework, pasted eleven lines out of its quickstart, and watched a correct answer appear. Then I changed the prompt slightl

Oct 9 · 9 min read · harshakatkam.dev  
Updated Oct 27  
Read the article

-   [#ai-agents](https://hashnode.com/tag/ai-agents)
-   [#llm](https://hashnode.com/tag/llm)
-   [#python](https://hashnode.com/tag/python)
-   [#ai](https://hashnode.com/tag/ai)
-   [#learning](https://hashnode.com/tag/learning)
-   [#agentic-ai](https://hashnode.com/tag/agentic-ai)

## Written by

[Harshavardhan Katkam](https://hashnode.com/@harshakatkam)

@harshakatkam · Hyderabad, India

  
[View profile](https://hashnode.com/@harshakatkam)

Senior Backend Engineer | Java | Distributed Systems | GenAI & AI Agents

## Responses 2

Markdown supported · ⌘↵ to post

[Kartik N V J K](https://hashnode.com/@kartik-nvj)

[Oct 12](https://hashnode.com/posts/the-40-line-agent/6ac903a79a41abbf2103357a/comment/6acd2cbe03d37def7133613f)

The 11-line framework quickstart breaking on a tiny prompt change is exactly why I tell people to start at 40 lines they understand. When you cannot see the control flow, you cannot tell whether the model failed or the framework did, so you end up debugging a black box. I went through a stretch of uninstalling coding CLIs one after another, and the model was almost never the actual problem. What made you draw the line at 40 lines specifically?

[netproxy](https://hashnode.com/@argumentmoney8117)

[Oct 9](https://hashnode.com/posts/the-40-line-agent/6ac903a79a41abbf2103357a/comment/6ac96e58928ea6e148dbc542)

The point about raise\_for\_status() is a good one — a bad key failing as KeyError: 'choices' three calls later is exactly the kind of debugging session that makes people distrust their own code. Starting raw makes the failure modes visible. Looking forward to the rest of the series.
