Yufan Song 426e429b18 chore: remove useless browsing code in CodeActSWEAgent (#2438) hace 1 año
..
SWE_agent 42c6b506b5 Lazy launching BrowseEnv / making BrowseEnv optional (#2155) hace 1 año
browsing_agent fd29b8faa8 refactor (#2442) hace 1 año
codeact_agent 9605106e72 feat: append_file incl. all tests [agentskills] (#2346) hace 1 año
codeact_swe_agent 426e429b18 chore: remove useless browsing code in CodeActSWEAgent (#2438) hace 1 año
delegator_agent c82666fea3 chores: fix DelegatorAgent description (#2446) hace 1 año
dummy_agent c82666fea3 chores: fix DelegatorAgent description (#2446) hace 1 año
micro a9a2f10170 Revamp AgentRejectAction and allow ManagerAgent to handle rejection (#1735) hace 1 año
monologue_agent 0c92144220 Refactor MonologueAgent, PlannerAgent add response parser (#2400) hace 1 año
planner_agent 0c92144220 Refactor MonologueAgent, PlannerAgent add response parser (#2400) hace 1 año
README.md b0b19e6c25 Update AgentHubREADME.md (#2290) hace 1 año
__init__.py 01ef90205d Add CodeActSWEAgent to remove browsing & github + improvements on agentskills (#2105) hace 1 año

README.md

Agent Framework Research

In this folder, there may exist multiple implementations of Agent that will be used by the framework.

For example, agenthub/codeact_agent, etc. Contributors from different backgrounds and interests can choose to contribute to any (or all!) of these directions.

Constructing an Agent

The abstraction for an agent can be found here.

Agents are run inside of a loop. At each iteration, agent.step() is called with a State input, and the agent must output an Action.

Every agent also has a self.llm which it can use to interact with the LLM configured by the user. See the LiteLLM docs for self.llm.completion.

State

The state contains:

  • A history of actions taken by the agent, as well as any observations (e.g. file content, command output) from those actions
  • A list of actions/observations that have happened since the most recent step
  • A root_task, which contains a plan of action
    • The agent can add and modify subtasks through the AddTaskAction and ModifyTaskAction

Actions

Here is a list of available Actions, which can be returned by agent.step():

You can use action.to_dict() and action_from_dict to serialize and deserialize actions.

Observations

There are also several types of Observations. These are typically available in the step following the corresponding Action. But they may also appear as a result of asynchronous events (e.g. a message from the user, logs from a command running in the background).

Here is a list of available Observations:

You can use observation.to_dict() and observation_from_dict to serialize and deserialize observations.

Interface

Every agent must implement the following methods:

step

def step(self, state: "State") -> "Action"

step moves the agent forward one step towards its goal. This probably means sending a prompt to the LLM, then parsing the response into an Action.

search_memory

def search_memory(self, query: str) -> list[str]:

search_memory should return a list of events that match the query. This will be used for the recall action.

You can optionally just return [] for this method, meaning the agent has no long-term memory.