Design an Agent: Split FR and NFR First
An agent is one more system you design. Script what you can, leave real judgment to the LLM, and let repeated judgments graduate into scripts.
An agent is one more system you design. Script everything you can, and leave only real judgment to the LLM.
The story
I built a personal assistant agent called North. Every day, it reads my journal, my goals, and my to-do list, and it reminds me on Telegram. In the morning, it sends an energy forecast. In the afternoon, it checks whether I am stuck. At night, it reminds me to do my review.
At first, I thought the key to an agent was the prompt. Later, I found that most problems were not in the prompt at all.
One day, North got a to-do snapshot that was 4 days old. The snapshot said, “Three tired days in a row, so reduce the load today.” The data was already stale. But if North trusted it, North was ready to tell me to do less, with full confidence.
The problem was not the model. It was what I let the model see, and what I let it calculate by itself. From then on, I designed my agent the way I design any system.
Later, I attended a talk by 「大大帶我飛」. It gave me a framework: five questions, the layers of a harness, and three kinds of loops. Almost every mistake I made with North fits into one box of that framework. This series puts the two together: the framework from the talk, and how North really runs.
Who this is for
- Software engineers who already use AI and want to build their own agent
- People with some vibe coding (building software by prompting AI) experience who want to know how an agent works inside
- Readers of Design Yourself as a System who want to apply the same thinking to an agent
Route map
1: Know what to build
- Write the Intent Before the Prompt: write one sentence of intent, then answer five questions.
- Agent Design Is the FR/NFR Split: fixed steps go to scripts, and judgment goes to the LLM.
2: Build the workplace
- The Harness Is the Agent’s Workplace: the model is one layer, and the harness is the whole workplace.
- Context: What the Agent Sees This Step: stale data makes an agent wrong with confidence.
- Few Tools, Clear Boundaries: the stronger the tools, the earlier you draw the lines.
3: Run it and make it better
- Three Loops in an Agent System: the inner, outer, and meta loops.
- How Do You Know the Agent Did Well?: first, make the agent report what it did.
- Graduate NFR into FR: a judgment that repeats becomes a script.
Three core ideas
- Intent comes before the prompt. First say why the agent exists. Only then write its prompt (deeper dive).
- Fewer judgment paths are better. Scripts compute, and the LLM only judges (deeper dive).
- An agent improves by graduation, not by editing itself. A judgment made three times is a rule (deeper dive).
How this links to the last series
In Design Yourself as a System, I used system design to design myself: observe first, then get feedback, then adjust. North is part of that system. This series applies the same principles to the agent itself.
How well an agent works rarely depends on the model. It mostly depends on the system you design around it.
Start with part 01, Write the Intent Before the Prompt. The series ends with Graduate NFR into FR, where the agent starts to get better.
References:
- A talk by 「大大帶我飛」