Skip to content
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

Vector memory revamp (part 1: refactoring) #4208

Merged
merged 62 commits into from
May 25, 2023

Conversation

Pwuts
Copy link
Member

@Pwuts Pwuts commented May 15, 2023

Work in progress on the memory system.

⚠️ For more info, see #3536 ⚠️

🔭 Primary todo's

  • Robust and reliable memorization routines for basic content (WIP)

    • Webpages
    • Text files
  • Good memory search/retrieval based on relevance (WIP)
    For a given query (e.g. a prompt or question), we need to be able to find the most relevant memories.

    Must be implemented separately for each memory backend provider:

    • Milvus

    (The other currently implemented providers are not in this list because they may be moved to plugins.)

🛠️ Secondary todo's

  • Refactoring
    • autogpt.memory module structure
    • MemoryItem entity as a uniform interface
      • Update JSON memory backend
      • Update Redis memory backend
        • deferred; see comment in previous section
      • Update Milvus memory backend
    • Move all text processing to autogpt.processing (WIP)
  • Improving text summarization
    • Rough rework (using text-davinci-003 and classic text completions)
    • Preliminary fine-tuning of prompts
    • Extensive testing & cross-model fine-tuning
    • Cost & speed optimization

🔧 Other changes

  • Added llm_utils.create_text_completions
  • Added llm_utils.@metered decorator for functions that make API calls to OpenAI

@vercel
Copy link

vercel bot commented May 15, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 25, 2023 6:21pm

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 15, 2023
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

@github-actions

This comment was marked as duplicate.

@github-actions

This comment was marked as duplicate.

@Pwuts
Copy link
Member Author

Pwuts commented May 25, 2023

Remaining todo's, to be addressed in a follow-up PR:

  • Fix test coverage
  • Limit number of chunks in summarize_text to prevent excessive costs
  • Talk to @collijk about VectorMemoryProvider interface
  • Move prompts and prompt templates to autogpt/prompts/default_prompts.py
    • initial value of MessageHistory.summary
    • summarization prompt in summarize_text()
    • summarization prompt in MessageHistory.update_running_summary
    • message template in MessageHistory.summary_message()

@github-actions

This comment was marked as duplicate.

@github-actions
Copy link
Contributor

We committed some changes to this branch, please run

git fetch
git rebase origin/memory

before pushing more changes to the remote.

@github-actions

This comment was marked as duplicate.

Copy link
Member

@ntindle ntindle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open an issue for the nits that were closed related to prompting :)

@Pwuts Pwuts merged commit bfbe613 into Significant-Gravitas:master May 25, 2023
9 of 10 checks passed
@Pwuts Pwuts changed the title WIP: Vector memory revamp (part 1: refactoring) Vector memory revamp (part 1: refactoring) May 25, 2023
@Pwuts Pwuts modified the milestones: v0.5.0 Release, v0.4.0 Release May 25, 2023
DGdev91 added a commit to DGdev91/Auto-GPT that referenced this pull request May 25, 2023
Pwuts added a commit that referenced this pull request Jun 10, 2023
* Add settings for custom base url and embedding dimension

Making the openai base url and embedding dimension configurable, these are useful to integrate AutoGPT with other models, like LLaMA

* Update to milvus.py to load the configuration also in the init_collection function

* Update radismem.py to get rid of Config() loading

* Update local.py to get rid of Config() loading

* Correct code format (python black)

* Revert DEFAULT_EMBED_DIM name to EMBED_DIM to keep tests  valid

* Better description for EMBED_DIM setting

* Set MockConfig to the type Config in Milvus test

* Fix formatting

* Update Milvus test, using Config() instead of building a mock config

* using the last milvus test code from main

* Remove embed_dim , no more needed after #4208

* Add example for OPENAI_BASE_URL

---------

Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
@collijk collijk mentioned this pull request Jun 22, 2023
Copy link

@wisdoms6969 wisdoms6969 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

Copy link

@wisdoms6969 wisdoms6969 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gg

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

Successfully merging this pull request may close these issues.

[issue in need of revisiting] Retrieval Augmentation / Memory
6 participants