-
Notifications
You must be signed in to change notification settings - Fork 44.4k
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
Display short-term and long-term memory usage #5
Comments
From what I was reading, you can take the context window, and compress chunks at the rear into summaries. |
Interesting idea! This would expand short-term memory. Currently Auto-GPT manages it's own "Long-Term Memory" which is "pinned" to the start of the context. |
Another approach could be to run history through an embeddings API, save the embeddings to a Vector DB, then do a lookup for relevant memories on each step. |
I've been meaning to look into this. Forgive my ignorance, I've never used them. |
All good! Thanks for your reply. In my (limited) understanding, adding embeddings is no more than adding a row to a DB (but with vector data). |
I really think this is an excellent idea. In fact it might be a huge win. This would basically give you an indefinite context window in effect, in terms of "long term" memory. Of course the discarding of "irrelevant" info in any given call to the model will be imperfect, but I'd bet it'll work pretty well. I was thinking about this myself this morning and wondered if anybody else already mentioned it. Basically I see it as an "associative memory", much like what we have in our own minds. You could perhaps have the GPT model generate a few orthogonal short summaries of what it just output and responded to (top 5?), store these in the vector db, and then get the most relevant "memories" for subsequent calls based on this same process. So combine these "N closest" memories with most recent and I think you'll get a very effective long term memory mechanism. Is there anyone out there that sees problems with this idea or has way to improve upon it? It seems super awesome to me... |
@Torantulino I'm going to pick this up if it is ok with you.
Let me know if there is anything here you'd like me to change. I should have a working version of this by EOD tomorrow EST. I would hope to then be able to extend this to processing files in large repos too and eventually I want to make this feed into the self improvement pipeline with respect to remembering where relevant local files are to large tasks. |
I believe it's possible to simply use a key-value store as memory and make it available to Auto-GPT as a tool, letting the model itself decide when and what to read from and write to the memory. Auto-GPT already has code execution implemented, so it has all Python functions available as tools, and this is just one more tool. To make the model aware of the memory tool and good at utilizing it, we would have to finetune it (e.g. using the Toolformer approach; there are two open-source implementations and this is more popular than the official one), and would need to collect some usage data (there isn't any paper or implementation that uses a memory tool yet AFAIK). Finetuning is available for ChatGPT-3.5 but not GPT-4, but I think we'll need to finetune anyway if we want Auto-GPT to create new tools and self-improve; we may also use an open model (many of them have LoRA finetuning implementations), which are be less powerful, but we may expose GPT-4 API to it and train it to use the API as a tool, so the whole system would not be less powerful. |
Actually, maybe we can make GPT models aware of the memory tool using the system message without the need of finetuning, since it's just a single simple tool. Something like
I'm not experienced in prompt engineering so there's definitely room for improvement. Notice that
so this should work better with GPT-4 than 3.5. If you have access, please try! |
This works. Hard to test this kind of thing concretely. But anecdotally it seems like it is much smarter now. |
See pull: #122 |
Is this resolved with the output of |
This would ideally be a part of a "quota"-like system so that sub-agents could be managed by agents higher up in the chain whenever there is a quota/constraint violation (soft/hard), as per #3466 |
This issue was closed automatically because it has been stale for 10 days with no activity. |
Auto-GPT currently pins it's Long-Term memory to the start of it's context window. It is able to manage this through commands.
Auto-GPT should be aware of it's short and long term memory usage so that it knows when something is doing to be deleted from it's memory due to context limits. e.g memory usage: (2555/4000 tokens)
This may lead to some interesting behaviour where it is less inclined to read long strings of text, or is more meticulous at saving information to long-term-memory when it sees it's running low on tokens.
The text was updated successfully, but these errors were encountered: