PlanningAgent extends BaseAgent and specialises it for task decomposition. Given a high-level objective it returns a structured list of step strings suitable for handing off to an ExecutionAgent.
Import
Constructor
The LangChain chat model used for plan generation.
Override the default system instruction. The built-in prompt instructs the model to act as an expert planning agent and return only a valid JSON object with a
"plan" key:Display name used in log messages. Inherited from
BaseAgent.Methods
generate_plan
invoke(task), strips any markdown fences from the response, parses the JSON payload, and returns the value of the "plan" key as a list of strings.
The high-level objective to decompose into steps.
List[str] — ordered list of step descriptions.
Expected LLM response format:
If the model returns malformed JSON (or wraps the response in a
```json fence that cannot be cleaned), the JSON parse failure is logged at WARNING level and the raw response string is returned as a single-element list: [raw_response].invoke (inherited)
See BaseAgent.invoke().