AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Support the GPTCache memory backend

Open SimFG opened this issue 2 years ago • 14 comments

Background

Over the past two days, I've been studying Auto GPT and find the idea very innovative, which excites me. I created a project called GPTCache, which I think would be a suitable memory module for the current project. Based on what I understand, the current memory module primarily relies on the ten most recent message texts. After conducting an embedding operation, a vector search is performed to obtain context information. This enables the OpenAI ChatComplete interface to have context from previous messages and obtain information for the next task. By integrating GPTCache, the process of obtaining context information can be even more customizable. GPTCache offers the following capabilities:

  • The embedding module in GPTCache supports multiple embedding implementations.
  • The store module in GPTCache has a useful extension method for vector storage, allowing for better data management, such as eviction and separate storage of scalar and vector data.
  • By setting a threshold, the similarity evaluation module in GPTCache can obtain more relevant context information. Setting the threshold to 0 is consistent with other backend methods of the current memory.

Fully utilizing GPTCache would require additional development time, but its capabilities could significantly enhance the functionality and performance of the current memory module. Therefore, I believe it's worth it.

Changes

Support the GPTCache memory backend

Documentation

Test Plan

like the TestLocalCache, only change the creating cache method.

# TestLocalCache
self.cache = LocalCache(cfg)

# TestGPTCache
self.cache = GPTCacheMemory(cfg)

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [x] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [x] I have not snuck in any "extra" small tweaks changes

SimFG avatar Apr 17 '23 08:04 SimFG

@richbeales @p-i-

SimFG avatar Apr 17 '23 13:04 SimFG

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 17:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 17 '23 17:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 22:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 17 '23 22:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 18 '23 14:04 github-actions[bot]

@Torantulino help me check it, thank you 🤗

SimFG avatar Apr 18 '23 14:04 SimFG

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 18 '23 14:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 19 '23 21:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 19 '23 22:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 20 '23 22:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 21 '23 02:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 22 '23 12:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 24 '23 09:04 github-actions[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2023 6:11am

vercel[bot] avatar Apr 28 '23 06:04 vercel[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 30 '23 04:04 github-actions[bot]

This is a mass message from the AutoGPT core team. Our apologies for the ongoing delay in processing PRs. This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

p-i- avatar May 05 '23 00:05 p-i-

@SimFG I wouldn't get too discouraged - the Re-Arch is coming along pretty fast. We are revamping memory with the re-arch, so once that is done, you should be able to continue work

anonhostpi avatar May 08 '23 02:05 anonhostpi

@anonhostpi I will continue to pay attention, the reason for closing this PR is because this PR maybe ineffective after the Re-Arch. Of course, there may be a delay for me when the refactoring is completed, and I am very much looking forward to receiving this news.

SimFG avatar May 08 '23 03:05 SimFG