Skip to content

[Feature] Plan and execute module #8752

@kapilreddy

Description

@kapilreddy

What feature would you like to see?

Implement a "Plan and Execute" module as part of DsPy's core library to support modern agent workflows that follow the plan-first, execute-later pattern.

ReAct

[LLM Call 1]
Thought: I need to find the current population of Tokyo
Action: search("Tokyo current population 2024")

[LLM Call 2] 
Observation: Tokyo metropolitan area has 37.4 million people
Thought: This seems like the metro area. Let me get the city proper population
Action: search("Tokyo city proper population 2024")

[LLM Call 3]
Observation: Tokyo city has 14.0 million people
Thought: Now I have both figures to give a complete answer
Action: respond_to_user

Plan and Execute

[LLM Call 1 - Planning Phase]
Thought: To answer about Tokyo's population, I should:
1. Search for current Tokyo population data
2. Clarify if they want city proper vs metropolitan area  
3. Get the most recent official figures
4. Present both if relevant

[LLM Call 2 - First Action]
Action: search("Tokyo population 2024 official statistics")

[LLM Call 3 - Second Action] 
Observation: Multiple results showing different boundaries...
Action: search("Tokyo metropolitan area vs city proper population")

[LLM Call 4 - Final Response]
Observation: Clear distinction found...
Final Response: [Complete answer with both figures]

Would you like to contribute?

  • Yes, I'd like to help implement this.
  • No, I just want to request it.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions