-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task-Centric Memory #5227
base: main
Are you sure you want to change the base?
Task-Centric Memory #5227
Conversation
Make memory optional. Filter out insights with negative scores.
Refactor memory paths. Enrich page logging.
Seed messages with random int for variability.
Save sessions as yaml for readability.
Eval simplifications.
…ified in settings.
self.logger.info(task) | ||
|
||
# Get a list of topics from the generalized task. | ||
generalized_task = await self.prompter.generalize_task(task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, there is an option to combine these two lines in a single API call, it would sacrifice accuracy potentially, but go from minimum 2 LLM calls to 1 LLM call
) | ||
user_message = [ | ||
"Now put yourself in the mind of the students. What misconception led them to their incorrect answer?" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is potential to combine these three LLM calls into a single call, it depends on the LLM, but GPT-4o should be able to do this in a single shot with a COT prompt, other less capable models might need extra reflection
A good way to convey the development status of this would be to put the module in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use shorter name, e.g., "memory_controller.py"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use shorter name
model_context: ChatCompletionContext, | ||
) -> UpdateContextResult: | ||
""" | ||
Extracts any advice from the last user turn to be stored in memory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify how advice is extracted in the docs.
[advanced] expose parameters controlling this process in the API of the memory controller or in the teachability obj.
Execute the corresponding commands from this (autogen_ext/task_centric_memory) directory. | ||
|
||
|
||
### Making AssistantAgent teachable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Making AssistantAgent teachable | |
### Making AssistantAgent Teachable |
Each sample is contained in a separate python script, using data and configs stored in yaml files for easy modification. | ||
Note that since agent behavior is non-deterministic, results will vary between runs. | ||
|
||
To watch operations live in a browser and see how task-centric memory works, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I turn this on/off? Would prefer if the code didn't make changes outside the cwd.
starting with an empty memory bank. | ||
|
||
```bash | ||
rm -r memory_bank |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unclear why this line is there. memory_bank
dir was never mentioned before.
|
||
class Teachability(Memory): | ||
""" | ||
Gives an AssistantAgent the ability to learn quickly from user teachings, hints, and advice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expand the documentation, please.
@@ -0,0 +1,3 @@ | |||
from .task_centric_memory_controller import TaskCentricMemoryController | |||
|
|||
__all__ = ["TaskCentricMemoryController"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this expose Teachbility
?
@jackgerrits, I've moved the code under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a next step #5542.
@@ -52,6 +52,8 @@ python/autogen_ext.models.openai | |||
python/autogen_ext.models.replay | |||
python/autogen_ext.models.azure | |||
python/autogen_ext.models.semantic_kernel | |||
python/autogen_ext.experimental.task_centric_memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this below auth so we are not breaking up the models.
The teachability example is pretty cool, shows how the MemoryController can be used with the an AssistantAgent via the Memory interface. |
And with very little code! |
(EXPERIMENTAL, RESEARCH IN PROGRESS)
In 2023 AutoGen introduced Teachable Agents that users could teach new facts, preferences and skills. But teachable agents were limited in several ways: They could only be
ConversableAgent
subclasses, they couldn't learn a new skill unless the user stated (in a single turn) both the task and how to solve it, and they couldn't learn on their own. Task-Centric Memory overcomes these limitations, allowing users to teach arbitrary agents (or teams) more flexibly and reliably, and enabling agents to learn from their own trial-and-error experiences.This PR is large and complex. All of the files are new, and most of the added components depend on the others to run at all. But the review process can be accelerated if approached in the following order.
agentic_memory
branch, and thepython/packages
directory:pip install -e autogen-agentchat
pip install -e autogen-ext[openai]
pip install -e autogen-ext[task-centric-memory]
./pagelogs/quick/0 Call Tree.html
file in a browser to view the work in progress.chat_with_teachable_agent.py
eval_retrieval.py
eval_teachability.py
eval_learning_from_demonstration.py
eval_self_teaching.py
task_centric_memory_controller.py
, referring back to the previously generated page logs as needed. This is the most important and complex file in the PR._task_centric_memory_bank.py
_string_similarity_map.py
_prompter.py
teachability.py
apprentice.py
grader.py
page_logger.py
_functions.py