[PR #2442] [MERGED] Fix calendar agent system prompt to not schdeule events when unavailable #2439

Closed
opened 2026-02-17 17:23:25 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/2442
Author: @tom1299
Created: 2/3/2026
Status: Merged
Merged: 3/13/2026
Merged by: @mdrxy

Base: mainHead: fix_personal_agent_scheduling


📝 Commits (3)

  • 8f7c4c6 Fix calendar agent system prompt to not schdeule events when unavailable
  • 7ad2cbf Update src/oss/langchain/multi-agent/subagents-personal-assistant.mdx
  • a491d7e Update src/oss/langchain/multi-agent/subagents-personal-assistant.mdx

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 src/oss/langchain/multi-agent/subagents-personal-assistant.mdx (+6 -2)

📄 Description

Overview

I was trying out the complete working example of the personal assistant tutorial and with the current system prompt, the calendar scheduling agent would always schedule an event, even if get_available_time_slots would not return a matching time slot. For example when I change the code of get_available_time_slots to something like this:

@tool
def get_available_time_slots(
    attendees: list[str],
    date: str,  # ISO format: "2024-01-15"
    duration_minutes: int
) -> list[str]:
    """Check calendar availability for given attendees on a specific date."""
    return []

Although this is just a tutorial of course, I think the sub agent should be smart enough to not schedule an event if there is no available time slot. This PR corrects the system prompt of the agent so that events are not scheduled, in the case where there is no suitable time slot.

I also changed the model of the complete example from claude-haiku-4-5-20251001 to gpt-4.1 since I never got the agent to work with the Anthropic model.

Note that I have tested the python code but could not test the typescript example.

Type of change

Type: Fix bug

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/2442 **Author:** [@tom1299](https://github.com/tom1299) **Created:** 2/3/2026 **Status:** ✅ Merged **Merged:** 3/13/2026 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `main` ← **Head:** `fix_personal_agent_scheduling` --- ### 📝 Commits (3) - [`8f7c4c6`](https://github.com/langchain-ai/docs/commit/8f7c4c6c2e4217b7e0394a36034f20224147f229) Fix calendar agent system prompt to not schdeule events when unavailable - [`7ad2cbf`](https://github.com/langchain-ai/docs/commit/7ad2cbf45922fe94ad76f51027cf7f9120e4edda) Update src/oss/langchain/multi-agent/subagents-personal-assistant.mdx - [`a491d7e`](https://github.com/langchain-ai/docs/commit/a491d7ef8fb65682e112ed900630f4c2618d02a5) Update src/oss/langchain/multi-agent/subagents-personal-assistant.mdx ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langchain/multi-agent/subagents-personal-assistant.mdx` (+6 -2) </details> ### 📄 Description ## Overview I was trying out the [complete working example](https://docs.langchain.com/oss/javascript/langchain/multi-agent/subagents-personal-assistant#complete-working-example) of the personal assistant tutorial and with the current system prompt, the calendar scheduling agent would always schedule an event, even if `get_available_time_slots` would not return a matching time slot. For example when I change the code of `get_available_time_slots` to something like this: ```python @tool def get_available_time_slots( attendees: list[str], date: str, # ISO format: "2024-01-15" duration_minutes: int ) -> list[str]: """Check calendar availability for given attendees on a specific date.""" return [] ``` Although this is just a tutorial of course, I think the sub agent should be _smart_ enough to not schedule an event if there is no available time slot. This PR corrects the system prompt of the agent so that events are not scheduled, in the case where there is no suitable time slot. I also changed the model of the complete example from `claude-haiku-4-5-20251001` to `gpt-4.1` since I never got the agent to work with the Anthropic model. Note that I have tested the python code but could not test the typescript example. ## Type of change **Type:** Fix bug ## Checklist <!-- Put an 'x' in all boxes that apply --> - [X] I have read the [contributing guidelines](README.md) - [X] I have tested my changes locally using `docs dev` - [ ] All code examples have been tested and work correctly - [ ] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:23:25 -05:00
yindo changed title from [PR #2442] Fix calendar agent system prompt to not schdeule events when unavailable to [PR #2442] [MERGED] Fix calendar agent system prompt to not schdeule events when unavailable 2026-06-05 18:18:35 -04:00
yindo closed this issue 2026-06-05 18:18:35 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#2439