Agentic AI Notebook
Phase 28

AI Software Engineer

~3 min read

Concept & How It Works

  • Key points are in the visual diagram above.

Why Does It Exist?

This capstone proves you can build the same plan→code→test→review loop used by Cursor, Devin, and internal codegen bots — not a chatbot that pastes code snippets.

Real-World Analogy

A junior engineer with terminal access and a PR template — you remain the tech lead who approves the plan and merges.
Loading diagram...

Visual Workflows

What is AI Software Engineer?

Loading diagram...

Example

Scenario

Issue: 'Add rate limiting to POST /login.' Planner identifies auth middleware and tests. Coder adds token-bucket decorator. Sandbox runs 47 tests — 1 fails. Debugger fixes off-by-one in window size. Reviewer opens PR #142 with benchmark table showing 429 responses after 10 req/min.

Solution

In Capstone Projects, apply AI Software Engineer to this scenario: Issue: 'Add rate limiting to POST /login. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Practice Task

Do this before moving to the next module — reading alone is not enough.

Open the Code Walkthrough below and run it locally. Change one parameter related to AI Software Engineer (e.g. model, temperature, top_k, or tool name), observe the difference in output, and write 2–3 sentences explaining what changed.

Code Walkthrough

Highlighted lines show where AI Software Engineer happens in the code.

AI Software Engineer
1# LangGraph-style state (simplified)2class AgentState(TypedDict):  # define a data structure or component3    task: str4    plan: list[str]5    patches: list[str]6    test_log: str7    attempts: int8
9def coder_node(state):  # define a reusable function10  patch = llm.invoke(f"Task: {state['task']}\nPlan step: {state['plan'][0]}")11  result = sandbox.apply_and_test(patch)12  return {"patches": [patch], "test_log": result.log, "attempts": state["attempts"] + 1}  # return the result

Commands to Remember

Commands to Remember

  • git checkout -b capstone/project-name # isolate capstone work
  • docker-compose up -d # run full stack locally

Common Mistakes

  • Letting the agent edit files without running tests
  • Sending entire repo in every prompt instead of retrieval
  • No human gate before merge to main

Cheat Sheet

Quick recap — the most important points from this module.

Cheat Sheet

quick ref
  • Planner → Coder → Sandbox → PR
  • apply_patch not full file rewrite
  • Max retry on test fail