Files
OpenHands/agenthub
Robert Brennan 4304aceff3 remove openai key assertion, enable alternate embedding models (#231)
* remove openai key assertion

* support different embedding models

* add todo

* add local embeddings

* Make lint happy (#232)

* Include Azure AI embedding model (#239)

* Include Azure AI embedding model

* updated requirements

---------

Co-authored-by: Rohit Rushil <rohit.rushil@honeywell.com>

* Update agenthub/langchains_agent/utils/memory.py

* Update agenthub/langchains_agent/utils/memory.py

* add base url

* add docs

* Update requirements.txt

* default to local embeddings

* Update llm.py

* fix fn

---------

Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
Co-authored-by: RoHitRushil <43521824+RohitX0X@users.noreply.github.com>
Co-authored-by: Rohit Rushil <rohit.rushil@honeywell.com>
2024-03-27 14:58:47 -04:00
..

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.