register_nested_chat
and move to the core library.
This notebook demonstrates the SocietyOfMindAgent, which runs a group
chat as an internal monologue, but appears to the external world as a
single agent. This confers three distinct advantages:
- It provides a clean way of producing a hierarchy of agents, hiding complexity as inner monologues.
- It provides a consistent way of extracting an answer from a lengthy group chat (normally, it is not clear which message is the final response, and the response itself may not always be formatted in a way that makes sense when extracted as a standalone message).
- It provides a way of recovering when agents exceed their context window constraints (the inner monologue is protected by try-catch blocks)
Learn more about configuring LLMs for agents here.