The Iterative Reflective Expansion (IRE) Algorithm is a sophisticated reasoning framework that employs iterative hypothesis generation, simulation, and refinement to solve complex problems. It leverages a multi-step approach where an AI agent generates initial solution paths, evaluates their effectiveness through simulation, reflects on errors, and dynamically revises reasoning strategies.Documentation Index
Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
Workflow
- Generate initial hypotheses
- Simulate paths
- Reflect on errors
- Revise paths
- Select promising paths
- Synthesize solution
Class: IterativeReflectiveExpansion
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
agent | Agent | None | The Swarms agent instance used to perform reasoning tasks |
max_loops | int | 5 | Maximum number of loops for the reasoning process |
return_list | bool | False | If True, returns the conversation as a list of messages |
return_dict | bool | False | If True, returns the conversation as a dictionary |
prompt | str | GENERAL_REASONING_AGENT_SYS_PROMPT | The system prompt for the agent |
Methods
| Method | Description |
|---|---|
generate_initial_hypotheses | Generates an initial set of reasoning hypotheses based on the problem input |
simulate_path | Simulates a given reasoning path and evaluates its effectiveness |
meta_reflect | Performs meta-cognitive reflection on the provided error information |
revise_path | Revises the reasoning path based on the provided feedback |
select_promising_paths | Selects the most promising reasoning paths from a list of candidates |
synthesize_solution | Synthesizes a final solution from the promising paths and historical memory |
run | Executes the Iterative Reflective Expansion process on the provided problem |