Skip to content

[!WARNING] RePlan is no longer maintained and is not included on the main file/bootstrap.

Introduction

Implementation of the Cognition Layer Algorithm ($A_1$) with RePlan

RePlan is a ReAct-based agent that uses multiple tools to focus on control, permission, and failure reaction of the $A_1$ algorithm. To achieve this, we use the LangChain ReAct agent and chain each action done by the agent into an agent_scratchpad where the agent can think and review the actions and results obtained.

The core of this agent resides in its tools. As LangChain states:

Docs: "Agents are only as good as the tools they have."

The tools provided to RePlan are the following: 1. PlanexV2 as a Tool: We reused PlanexV2's capability to generate Exelent files from queries and reformatted it as a tool fully integrated into RePlan. This enables RePlan to planify from a given query. 2. ExecutionWrapper as a Tool: We integrated the control of the execution layer with a set of tools that enable the agent to listen to the feedback obtained from the actions, approve or deny actions, or create new tasks.

Results

Key Advantages

  1. Reaction: The agent can react to failures, generating new plans or new approaches to the user query.
  2. Control: RePlan can accept or deny steps by taking advantage of the ControlledSequence type in Exelent.
  3. Better Results: Using RePlan results in better performance and more effective utilization of Planex actions.

Key Disadvantages

  1. Token Cost: Minimizing the tokens used in RePlan is challenging, as the thinking process of ReAct trades reliability and usability for more expensive requests to the LLM.
  2. Not Exelent Aware: Although RePlan can generate Exelent code, it cannot modify the plan, relying on Planex for plan generation.
  3. Not Context Aware: ReAct can gather information about the system but encounters the same awareness issues as Planex when planning.

This module can be tested like other agents by using the following command:

# We recommend using --debug to fully trace all that happens inside RePlan 
python ecm/core/main.py --agent RePlan --debug