-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Rewrite memory condenser #2021
Rewrite memory condenser #2021
Conversation
opendevin: rework and doc according to review mypy, algo fixes
…e (Claude) Update CodeAct agent to use new memory condenser interface (Claude) Fix docstring (Claude) Fix docstring for condense method (Claude) Fix __init__ docstring (Claude) Revert "Implement lazy condensing, repeated condensing, and simplify interface (Claude)" This reverts commit 216cb215ed67a553bd340028cc0525a8ecf56f86. add SummaryObservation to init fix stuff Co-authored-by: OpenDevin <[email protected]>
…evin into enyst/memories-condenser
Currently: Old prompt:
What one condense does: {
"action": "SUMMARIZE",
"actions": "IPythonRunCellAction, IPythonRunCellAction, CmdRunAction, MessageAction",
"summary": "An attempt was made to create a file named 'hello_world.sh', but it already existed, so the file was opened, the 'Hello World' script was verified, and the script was successfully executed."
} |
481f449
to
aa01bda
Compare
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.
Adding a comment to note that I'll review this again when it's ready. Please re-request review at that point.
Closing reason? |
Closed in favor of #2937 . 2937 re-implements this PR using memGPT prompts and some of its algo, and we're working to get it merged. |
This PR is proposing an implementation of the memory condenser inspired by this comment. #1771 (review)
memory component
The agent uses memory component to select stuff, summarize stuff, truncate stuff ==> which it then injects in the context.
Please note: the refactoring of state.history is a bit large and it changes the basic assumption that events come in tuples (action, observation). They no longer did in the Event Stream anyway, but the controller was still filling in the blanks for the Agent and its history, so they continued to rely on tuples.
This PR reimplements the "short term history" part of the Memory component to work like a memory stream basically: it doesn't store its own versions, it doesn't fill in tuples, it just filters the stream and uses summaries in place of chunks of events to send to the LLM when necessary.
Goals:
max_input_tokens
is hitQuick overview of the memory component:
https://github.com/OpenDevin/OpenDevin/tree/enyst/memories-condenser/opendevin/memory
Not included in this PR:
[ ] if the agent needs original events content, it should be able to retrieve itshould_condense
or include more in prompt messages that don't get summarized)Note: this PR is CodeAct/Claude's playground. 😅