digger yu ed3bf194c7 fix typo (#286) 1 ano atrás
..
codeact_agent ed3bf194c7 fix typo (#286) 1 ano atrás
langchains_agent 4304aceff3 remove openai key assertion, enable alternate embedding models (#231) 1 ano atrás
README.md 3cb1e05c8c update readme for new abstraction (#173) 1 ano atrás
__init__.py 430527680f Server: load environment variables from .env and document environment variables (#137) 1 ano atrás

README.md

Agent Framework Research

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

For example, agenthub/langchain_agent, agenthub/metagpt_agent, 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.

On a high-level, at each step, an agent takes in a State object and outputs an Action.

Your 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.

We now have two main categories of actions:

  • ExecutableAction: will produces a corresponding Observation (source here) for the agent to take the next Action.
  • NotExecutableAction: will produces a NullObservation by the controller, which could means telling the agent to ignore this action.

For ExecutableAction, we currently have:

  • CmdRunAction and CmdKillAction for bash command (see source here).
  • FileReadAction and FileWriteAction for file operations (see source here).
  • BrowseURLAction to open a web page (see source here).
  • AgentThinkAction, AgentFinishAction: these are non-executable actions for agent to update its status to the user. For example, agent could use AgentThink to explain its though process to the user (see source here).
  • AgentEchoAction: the agent can produce some messages as its own Observation in the next .step, this will produces a AgentMessageObservation (see source here).
  • AgentRecallAction: recalls a past memory (see source here).

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.