cpacker / MemGPT

Create LLM agents with long-term memory and custom tools 📚🦙
https://memgpt.readme.io
Apache License 2.0
11.43k stars 1.24k forks source link

Autogen create_memgpt_autogen_agent_from_config - ImportError: cannot import name 'add_default_presets' from 'memgpt.presets.presets' #1589

Open ibabbar opened 1 month ago

ibabbar commented 1 month ago

Describe the bug I cannot use basic examples when trying to use autogen agent: create_memgpt_autogen_agent_from_config

Please describe your setup

Screenshots

image

Additional context

MemGPT Config


If you're not using OpenAI, please provide additional information on your local LLM setup:

Local LLM details

If you are trying to run MemGPT with local LLMs, please provide the following information:

mctouch commented 1 month ago

Please describe your setup

How did you install memgpt? pip install pymemgpt? pip install pymemgpt-nightly? git clone? pip install pymemgpt Describe your setup What's your OS (Windows/MacOS/Linux)? MacOS How are you running memgpt? Python 3.12.4

same issue

ll /Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py -rw-r--r--@ 1 mctouch staff 3.4K 29 Jul 20:27 /Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py ❯ /Users/mctouch/micromamba/envs/autogen/bin/python /Users/mctouch/code/MemGPT/memgpt/autogen/examples/agent_groupchat.py Traceback (most recent call last): File "/Users/mctouch/code/MemGPT/memgpt/autogen/examples/agent_groupchat.py", line 168, in coder = create_memgpt_autogen_agent_from_config( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/autogen/memgpt_agent.py", line 465, in create_memgpt_autogen_agent_from_config autogen_memgpt_agent = create_autogen_memgpt_agent( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/autogen/memgpt_agent.py", line 348, in create_autogen_memgpt_agent from memgpt.presets.presets import add_default_presets ImportError: cannot import name 'add_default_presets' from 'memgpt.presets.presets' (/Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py). Did you mean: 'add_default_tools'?

❯ ll /Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py -rw-r--r--@ 1 mctouch staff 3.4K 29 Jul 20:27 /Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py

cat /Users/mctouch/micromamba/envs/autogen/lib/python3.12/site-packages/memgpt/presets/presets.py | grep add_default_presets

No references found in the repo.

Mac osx

sarahwooders commented 1 month ago

Sorry the autogen integration is broken right now. If you are trying to do multi-agent, we recommend just passing messages between agents (examples coming soon).

raolak commented 1 month ago

@sarahwooders blocked on same issue...wanted to try memgpt with autogen. any idea on when we can expect fix?

ibabbar commented 1 month ago

@sarahwooders even for single ConversableAgents - I'd love examples, and even happy to recommend/contribute fixes if you need assistance

CellCS commented 1 month ago

Reproduce this issue by using 'azure' in https://github.com/cpacker/MemGPT/blob/main/memgpt/autogen/examples/agent_groupchat.py

image

image

Harinisri29 commented 1 month ago

Hi I am also facing the same issue. Did anyone found the solution?

ImportError: cannot import name 'add_default_presets' from 'memgpt.presets.presets'

mustangproject commented 1 month ago

See the same issue. Any fix yet?
ImportError: cannot import name 'add_default_presets' from 'memgpt.presets.presets' (/home/vor/Documents/VOR_PROJECTS/VOR_PYTHON/env-vor/lib/python3.11/site-packages/memgpt/presets/presets.py)

milorddev commented 1 month ago

same issue on ubuntu 22.04 using ollama local setup, doing some digging myself, will edit here as I find stuff:

Findings:

Since the code for the bugged section within the memgpt_agent.py is

preset_obj = ms.get_preset(name=agent_config["preset"] if "preset" in agent_config else config.preset, user_id=user.id)
        if preset_obj is None:
            # create preset records in metadata store
            from memgpt.presets.presets import add_default_presets

            add_default_presets(user.id, ms)
            # try again
            preset_obj = ms.get_preset(name=agent_config["preset"] if "preset" in agent_config else config.preset, user_id=user.id)
            if preset_obj is None:
                print("Couldn't find presets in database, please run `memgpt configure`")
                sys.exit(1)

we can potentially get around this by just adding a preset to the config instead of relying on the defaults