Skip to content

feat(agent): compact system prompt + guided search flow#80

Merged
DavidSchmidt00 merged 3 commits intomainfrom
feat/guided-search-prompt
Apr 26, 2026
Merged

feat(agent): compact system prompt + guided search flow#80
DavidSchmidt00 merged 3 commits intomainfrom
feat/guided-search-prompt

Conversation

@DavidSchmidt00
Copy link
Copy Markdown
Owner

Summary

  • Compact prompt: rewrites the ~400-word system prompt down to ~180 words by collapsing redundant RULES/GOAL sections into one header line and removing self-evident instructions
  • Guided search flow: agent now collects club → date → time window one question at a time before any slot search or handoff, confirming even profile-stored values
  • Handoff quality: duration + court type are optional; relative dates are always resolved to YYYY-MM-DD; preferred_time is split into time_from/time_to; no follow-up message is sent after handoff_to_find
  • Profile section: changed from "do NOT ask if already set" to "confirm each before using"

Test plan

  • Say "find me a court" with no context — agent should ask for club first
  • Say club name — agent should ask for date next
  • Give a date — agent should ask for time window next
  • Give a time — agent should call handoff_to_find and open Find Mode with all fields pre-filled
  • Say "doesn't matter" when asked duration/court type — handoff should proceed without those fields
  • With profile preferences set — agent should confirm them rather than assuming
  • "Just tell me what's free at Lemon Padel tonight at 18:00" — agent should skip guided flow and call find_slots directly
  • All 141 existing tests pass

🤖 Generated with Claude Code

DavidSchmidt00 and others added 3 commits April 26, 2026 19:49
Replace the verbose ~400-word system prompt with a ~180-word version
that embeds an explicit one-question-at-a-time collection sequence
before any slot search or handoff.

- FIND SLOTS section: agent must collect club → date → time (one per
  reply), confirming even profile values; duration/court_type optional
- handoff_to_find: resolve relative dates, split preferred_time into
  time_from/time_to, no follow-up message after call
- Collapse redundant RULES + GOAL sections into a single header line
- Profile section now says "confirm each before using" instead of
  "do NOT ask if already set"
- tools.py: update_user_profile description lists preferred_time key;
  handoff_to_find description updated to match new prompt guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the "always ask/confirm each field one by one" flow with a
context-aware approach:

- Info already in the user's message is used directly, never re-asked
- Saved club preference is offered as a suggestion ("Shall I search
  at X?") rather than assumed or confirmed by asking
- Date + time both missing → ask for both in one question (fewer
  round-trips)
- Duration + court type remain optional, sourced from message/profile
- Profile section guidance updated to match: use as defaults, suggest
  club rather than assuming it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two issues from PR review:

- FIND SLOTS now requires club_slug to be resolved via find_clubs_by_name
  before calling handoff_to_find — prevents Find Mode opening with empty
  club field when only a name was given in conversation
- Profile-backed fields (date, time, duration, court_type) are now used
  silently as defaults when missing from the message, consistent with the
  profile section guidance; previously FIND SLOTS would ask even when
  a preferred_time was already saved

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@DavidSchmidt00 DavidSchmidt00 merged commit 685e633 into main Apr 26, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant