Step-by-Step Problem Solving (Chain-of-Thought) › Practical Applications for Your Personal Assistant

Michael BrenndoerferJune 17, 20254 min read
AI Agent HandbookAll chapters
Part 4 of 15Reasoning - Teaching the Agent to Think
Chapter 10Step-by-Step Problem Solving (Chain-of-Thought) › Practical Applications for Your Personal Assistant
Reading section 7 of 13 · Practical Applications for Your Personal Assistant · 4 minSection 7 of 13 · 4 min

Book contents

Section 7 of 13 · 4 min read

Step-by-Step Problem Solving (Chain-of-Thought) › Practical Applications for Your Personal AssistantOne section · Sections in this chapter7 / 13 ↓

Let's apply chain-of-thought reasoning to make your personal assistant more capable. Here are some scenarios where it helps:

Planning a Multi-Step Task

In[6]:
Code
from openai import OpenAI

client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

prompt = """I need to prepare for a presentation next Tuesday. I need to:
- Research the topic (3 hours)
- Create slides (4 hours)
- Practice presenting (2 hours)
- Get feedback from a colleague (1 hour)

Today is Thursday. I have 2 hours available each evening (Thu, Fri, Mon).
I have 6 hours available on Saturday.

Create a schedule for completing these tasks. Think through this step by step."""

## Using GPT-5 for multi-step planning and scheduling
response = client.chat.completions.create(
    model="gpt-5", messages=[{"role": "user", "content": prompt}]
)

print(response.choices[0].message.content)
Out[6]:
Console
Here’s a clear plan that finishes everything with buffer and puts feedback late enough to be useful but early enough to act on it.

Overall order (reasoning in brief):
- Do research before heavy slide-building.
- Finish a solid slide draft early Saturday, then practice so your colleague can react to both content and delivery.
- Get feedback Monday and still have time to incorporate it.

Schedule
- Thu evening (2h)
  - Research: 2h
  - Goal: finalize outline, key message, and source list.

- Fri evening (2h)
  - Research: 1h (completes 3h total)
  - Slides: 1h (build template, title/agenda, structure per outline)

- Sat (6h total)
  - Slides: 3h (complete main content, charts, examples, speaker notes)
  - Practice: 2h (two focused run-throughs; time yourself; note rough spots)
  - Polish: 1h (tighten slides based on practice notes, refine transitions)

- Mon evening (2h)
  - Feedback with colleague: 1h (share slides beforehand; do a brief run-through + Q&A)
  - Incorporate feedback: 1h (adjust slides, notes, and any tricky transitions)

What this covers
- Research: 3h (Thu 2h + Fri 1h)
- Create slides: 4h (Fri 1h + Sat 3h)
- Practice: 2h (Sat 2h)
- Feedback: 1h (Mon 1h)
- Buffer/improvements: 2h (Sat 1h polish + Mon 1h revisions)

Quick prep actions
- Today: book your colleague for Monday evening and send your outline by Friday night.
- After Saturday practice: note top 3 issues to specifically ask your colleague about.
- Optional: do a 10–15 min confidence run Tuesday morning if time allows.

If your colleague can’t meet Monday evening, swap the Saturday “polish” hour with the feedback session on Saturday and use Monday’s 2h entirely for revisions and a final run-through.

The model will break down the problem:

Let's think through this step by step.

Step 1: Calculate total time needed
- Research: 3 hours
- Create slides: 4 hours
- Practice: 2 hours
- Feedback: 1 hour
Total: 10 hours

Step 2: Calculate available time
- Thursday evening: 2 hours
- Friday evening: 2 hours
- Saturday: 6 hours
- Monday evening: 2 hours
Total: 12 hours (enough time with 2 hours buffer)

Step 3: Consider dependencies
- Must research before creating slides
- Must create slides before practicing
- Should get feedback after practicing

Step 4: Create schedule
Thursday evening (2 hours): Research (part 1)
Friday evening (2 hours): Research (part 2, complete)
Saturday (6 hours): Create slides (4 hours) + Practice (2 hours)
Monday evening (2 hours): Get colleague feedback (1 hour) + final practice (1 hour)

This schedule respects the dependencies and uses 11 of your 12 available hours.

Debugging Logic

Chain-of-thought is also valuable for helping users debug their own thinking:

In[7]:
Code
from openai import OpenAI

client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

prompt = """I'm trying to decide if I should buy a new laptop. Help me think through this decision step by step.

Current laptop: 4 years old, still works but slow
New laptop cost: \$1,200
My budget: \$2,000 saved for tech upgrades
Other needs: Might need a new phone in 6 months (\$800)

Should I buy the laptop now?"""

## Using GPT-5 for structured decision-making and analysis
response = client.chat.completions.create(
    model="gpt-5", messages=[{"role": "user", "content": prompt}]
)

print(response.choices[0].message.content)
Out[7]:
Console
Let’s walk through it step by step and land on a clear recommendation.

1) How painful is the slowness?
- If your current laptop is costing you >10–15 minutes a day or feels unreliable, the productivity gain and reduced stress from a new one can easily justify the cost over the next few years.
- If it’s mostly “annoying but workable,” consider a cheap tune‑up first (see Step 4).

2) Budget math (don’t forget tax and extras)
- Laptop listed price: $1,200
- After tax (example 8%): ~$1,296
- Possible extras you might actually need: $0–$200 (warranty, dock, case, adapter)
- Your tech fund: $2,000
- Phone in ~6 months: $800 (+ tax ≈ $864 at 8%)
What this means: A $1,200 laptop likely leaves you with ~$704 after tax, which is short of the ~$864 you’ll want for the phone. You’ll need to either:
- Save an additional ~$160+ over the next six months, or
- Buy a slightly cheaper laptop (target ≤$1,050 before tax), or
- Plan to sell/trade‑in your old laptop to cover the gap.

3) Timing and deals
- Big discount windows typically come soon (back‑to‑school/late summer, and major sales events). Waiting 4–10 weeks could shave $100–$300 off.
- New model cycles also create discounts on last year’s configs that are still excellent.

4) Lower‑cost ways to speed up your current laptop (often $50–$200)
- If you have a hard drive, upgrade to an SSD. Biggest single speed boost.
- Bump RAM to 16 GB if you run many browser tabs/apps.
- Clean install the OS and remove startup bloat; ensure you have 20%+ free disk space.
- Replace an old battery if it’s throttling performance.
These can buy you 6–18 months for a fraction of the price, keeping phone money intact.

5) Resale/trade‑in can close the gap
- A 4‑year‑old working laptop can often fetch $100–$300 depending on brand/spec/condition. That alone could cover tax on the new laptop or the phone shortfall.

6) Decision rule (pick the scenario that fits you best)
- Buy now if:
  - The slowness is materially hurting your work or reliability is questionable, AND
  - You can either save an extra ~$200 before the phone purchase, sell the old laptop, or find a deal that keeps your all‑in laptop cost ≤$1,150 after tax.
- Wait (or try a cheap upgrade) if:
  - The laptop is slow but stable, AND
  - You need to preserve the full ~$864 for the phone and don’t want to count on new savings, AND/OR
  - You can wait for an upcoming sale to bring the laptop closer to ~$1,000–$1,100 before tax.

My take based on your numbers
- If you can comfortably add at least ~$200 to your tech fund over the next six months (or are fine selling the old laptop), it’s reasonable to buy now—especially if the slowness is costing you time daily.
- If adding savings is uncertain and the slowness is tolerable, hold off 4–8 weeks for a sale or do a $100–$200 upgrade now, then reassess.

If you want, tell me:
- Your main tasks (web, Office, coding, design, gaming)
- Current laptop specs (CPU, RAM, storage type: HDD vs SSD)
- Any brand/OS preferences
I can help you decide whether an upgrade will fix it and/or suggest specific new models that fit an all‑in target and keep the phone budget safe.

The model will help structure the decision:

Let's think through this step by step.

Step 1: Assess the urgency
- Current laptop still works, just slow
- This suggests want, not urgent need
- You can likely wait if needed

Step 2: Check the budget
- Total budget: \$2,000
- Laptop cost: \$1,200
- Phone cost (in 6 months): \$800
- Total needed: \$2,000
- Remaining after both: \$0

Step 3: Consider timing
- If you buy the laptop now: \$800 left for phone
- That's exactly enough for the phone
- But no buffer for unexpected expenses

Step 4: Evaluate alternatives
- Wait on laptop, buy phone when needed: keeps more flexibility
- Buy laptop now: commits most of your budget
- Fix/upgrade current laptop: might be cheaper option

Step 5: Recommendation
Given that your current laptop works (just slow) and you have a more predictable phone need in 6 months, consider:
- Option A: Wait on the laptop purchase until after you assess the phone situation
- Option B: Look into cheaper laptop upgrades (RAM, SSD) to extend current laptop life
- Option C: If the laptop significantly impacts your work/productivity, buy it now but plan carefully for the phone purchase

The decision depends on how much the slow laptop affects your daily life versus the importance of maintaining budget flexibility.

This kind of structured thinking helps users make better decisions by explicitly considering all factors.