letta-ai / letta

Letta (formerly MemGPT) is a framework for creating LLM services with memory.
https://letta.com
Apache License 2.0
12.71k stars 1.38k forks source link

TypeError: LocalStateManager.__init__() got an unexpected keyword argument 'agent_config' #817

Open mongolu opened 10 months ago

mongolu commented 10 months ago

Describe the bug I'm trying to run the code from autogen from this file: memgpt/autogen/examples/memgpt_coder_autogen.ipynb A clear and concise description of what the bug is. In file memgpt/autogen/memgpt_agent.py at line 170, i think it should've been "agent_state": agent_config, .

LOGS:

Traceback (most recent call last):
  File "/LLMmodels/autogen/ytest.py", line 75, in <module>
    coder = create_memgpt_autogen_agent_from_config(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/autogen/memgpt_agent.py", line 95, in create_memgpt_autogen_agent_from_config
    autogen_memgpt_agent = create_autogen_memgpt_agent(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/autogen/memgpt_agent.py", line 172, in create_autogen_memgpt_agent
    persistence_manager = LocalStateManager(**persistence_manager_kwargs) if persistence_manager is None else persistence_manager
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: LocalStateManager.__init__() got an unexpected keyword argument 'agent_config'

Please describe your setup

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.


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:

mongolu commented 10 months ago

After modifying from "agent_config" into "agent_state", other error pops out:

Traceback (most recent call last):
  File "/LLMmodels/autogen/ytest.py", line 75, in <module>
    coder = create_memgpt_autogen_agent_from_config(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/autogen/memgpt_agent.py", line 95, in create_memgpt_autogen_agent_from_config
    autogen_memgpt_agent = create_autogen_memgpt_agent(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/autogen/memgpt_agent.py", line 172, in create_autogen_memgpt_agent
    persistence_manager = LocalStateManager(**persistence_manager_kwargs) if persistence_manager is None else persistence_manager
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/persistence_manager.py", line 54, in __init__
    self.archival_memory = EmbeddingArchivalMemory(agent_state)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/MemGPT/memgpt/memory.py", line 366, in __init__
    self.embed_model = embedding_model(agent_state.embedding_config)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'AgentConfig' object has no attribute 'embedding_config'. Did you mean: 'embedding_dim'?
cpacker commented 10 months ago

Hey @mongolu , sorry for the delay! This is basically a version issue - the latest code on this github repo is for the eventual 0.2.12 release, but the AutoGen part of the repo has not been updated yet so it won't work until #787 is finished.

If you want to use AutoGen, you should use 0.2.11. You can do this by grabbing the pip package (pip install pymemgpt or pip install pymemgpt==0.2.11), or by cloning the github repo then doing git checkout 0.2.11).