Skip to content

Teachability for any agent#1091

Merged
sonichi merged 34 commits into
mainfrom
teach_cap
Jan 7, 2024
Merged

Teachability for any agent#1091
sonichi merged 34 commits into
mainfrom
teach_cap

Conversation

@rickyloynd-microsoft

@rickyloynd-microsoft rickyloynd-microsoft commented Dec 28, 2023

Copy link
Copy Markdown
Contributor

Why are these changes needed?

It’s often useful to combine multiple advanced capabilities into a single agent, as OpenAI has done with their recently released GPTs and Assistants, for which function calling, code interpreter, and RAG capabilities can work together in a composable and chainable way. But AutoGen makes it hard to chain advanced capabilities because ConversableAgent obtains each agent reply from just one registered reply function. Given the mutual exclusivity among registered reply functions, the capabilities of (for example) RetrieveAssistantAgent and TeachableAgent cannot be easily chained (combined in producing a single response) today; any given reply can leverage one or the other but not both.

This PR enhances ConversableAgent to support chainable capabilities by means of a lightweight hook-registration mechanism allowing multiple capabilities to contribute to each agent reply. Leveraging this new mechanism, teachability can now be added to any agent that inherits from ConversableAgent by instantiating a Teachability object (which replaces the original TeachableAgent class) and calling its add_to_agent(agent) method. For illustration, teachability can now be added to OpenAI Assistants through GPTAssistantAgent (unmodified by this PR), successfully combining teachability in a chain with whatever capabilities the particular OpenAI Assistants have (tools including functions, code interpreter, and retrieval). Teachable OpenAI Assistants are demonstrated in a new notebook.

The original teachability tests, notebook, documentation, and blog post are all updated.

Related issue number

Closes #534, #535, #782

Checks

@rickyloynd-microsoft

Copy link
Copy Markdown
Contributor Author

LGTM. In this PR or a separate PR, could you add the added notebook to this example page via https://github.com/microsoft/autogen/blob/main/website/docs/Examples.md

Now added!

@rickyloynd-microsoft

Copy link
Copy Markdown
Contributor Author

@sonichi Is this test currently expected to fail?

OpenAI4ContribTests / CompressionTest (ubuntu-latest, 3.9) (pull_request_target)

@sonichi

sonichi commented Jan 7, 2024

Copy link
Copy Markdown
Contributor

@sonichi Is this test currently expected to fail?

OpenAI4ContribTests / CompressionTest (ubuntu-latest, 3.9) (pull_request_target)

Yes. #1073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Teachability for any agent

7 participants