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

Can't create and use agent normaly. #2401

Open
4 tasks
femto opened this issue Jan 30, 2025 · 3 comments
Open
4 tasks

Can't create and use agent normaly. #2401

femto opened this issue Jan 30, 2025 · 3 comments

Comments

@femto
Copy link

femto commented Jan 30, 2025

Describe the bug
Can't create and use agent normaly.

Please describe your setup
git clone
then letta server

  • Describe your setup
    • Mac
    • Terminal

Screenshots
After creating agent and try to use it, the normal ade screen flashes, and then following screen:
Image

Additional context
seemed some requests also not normal?
INFO: ::1:53055 - "GET /v1/agents/agent-79478aae-241e-452b-b2c1-54e86b926ad7/archival-memory HTTP/1.1" 404 Not Found
INFO: ::1:53040 - "GET /v1/agents/agent-79478aae-241e-452b-b2c1-54e86b926ad7 HTTP/1.1" 200 OK
INFO: ::1:53041 - "GET /v1/tools/composio/apps HTTP/1.1" 400 Bad Request
INFO: ::1:53053 - "GET /v1/agents/agent-79478aae-241e-452b-b2c1-54e86b926ad7/sources HTTP/1.1" 200 OK
INFO: ::1:53054 - "GET /v1/agents/agent-79478aae-241e-452b-b2c1-54e86b926ad7/context HTTP/1.1" 200 OK

Letta Config
[defaults]
preset = memgpt_chat
persona = sam_pov
human = basic

[archival_storage]
type = postgres
path = /Users/femtozheng/.letta
uri = postgresql://letta:letta@localhost:5432/letta

[recall_storage]
type = postgres
path = /Users/femtozheng/.letta
uri = postgresql://letta:letta@localhost:5432/letta

[metadata_storage]
type = sqlite
path = /Users/femtozheng/.letta

[version]
letta_version = 0.6.6


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

Local LLM details

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

  • The exact model you're trying to use (e.g. dolphin-2.1-mistral-7b.Q6_K.gguf)
  • The local LLM backend you are using (web UI? LM Studio?)
  • Your hardware for the local LLM backend (local computer? operating system? remote RunPod?)
@sarahwooders
Copy link
Collaborator

Could you please upgrade to the latest version? For the web ADE, you need to have the latest server version or else there will be API mismatches.

To avoid having to upgrade regularly, you can also use Letta desktop if you're on Mac.

@femto
Copy link
Author

femto commented Jan 30, 2025

will try Letta desktop, but I want to learn letta code,now git pull,
with LETTA_PG_URI=postgresql://letta:letta@localhost:5432/letta
already alembic upgrade head

Traceback (most recent call last):
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/typer/main.py", line 340, in __call__
    raise e
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/typer/main.py", line 323, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/typer/core.py", line 743, in main
    return _main(
           ^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/typer/core.py", line 198, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/typer/main.py", line 698, in wrapper
    return callback(**use_params)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/cli/cli.py", line 63, in server
    from letta.server.rest_api.app import start_server
  File "/Users/femtozheng/python-project/letta/letta/server/rest_api/app.py", line 38, in <module>
    server = SyncServer(default_interface_factory=lambda: interface())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/server/server.py", line 313, in __init__
    self.tool_manager.upsert_base_tools(actor=self.default_user)
  File "/Users/femtozheng/python-project/letta/letta/utils.py", line 560, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/services/tool_manager.py", line 197, in upsert_base_tools
    self.create_or_update_tool(
  File "/Users/femtozheng/python-project/letta/letta/utils.py", line 560, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/services/tool_manager.py", line 42, in create_or_update_tool
    tool = self.get_tool_by_name(tool_name=pydantic_tool.name, actor=actor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/utils.py", line 560, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/services/tool_manager.py", line 93, in get_tool_by_name
    tool = ToolModel.read(db_session=session, name=tool_name, actor=actor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/orm/sqlalchemy_base.py", line 30, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/letta/orm/sqlalchemy_base.py", line 303, in read
    if found := db_session.execute(query).scalar():
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
    return self._execute_internal(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 2251, in _execute_internal
    result: Result[Any] = compile_state_cls.orm_execute_statement(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/orm/context.py", line 305, in orm_execute_statement
    result = conn.execute(
             ^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
    return meth(
           ^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 515, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1638, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1843, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1983, in _exec_single_context
    self._handle_dbapi_exception(
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2352, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1964, in _exec_single_context
    self.dialect.do_execute(
  File "/Users/femtozheng/python-project/letta/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 942, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column tools.tool_type does not exist
LINE 1: SELECT tools.name, tools.tool_type, tools.return_char_limit,...
                           ^

[SQL: SELECT tools.name, tools.tool_type, tools.return_char_limit, tools.description, tools.tags, tools.source_type, tools.source_code, tools.json_schema, tools.id, tools.created_at, tools.updated_at, tools.is_deleted, tools._created_by_id, tools._last_updated_by_id, tools.organization_id 
FROM tools 
WHERE tools.name = %(name_1)s AND tools.organization_id = %(organization_id_1)s AND tools.is_deleted = false AND tools.is_deleted = false]
[parameters: {'name_1': 'archival_memory_insert', 'organization_id_1': 'org-00000000-0000-4000-8000-000000000000'}]
(Background on this error at: https://sqlalche.me/e/20/f405)
python-BaseException

@sarahwooders
Copy link
Collaborator

If you want to build from source, I recommend doing:

docker build . -t letta/letta:local

docker run \                                                                                                                                                        ─╯
 -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \
 -p 8283:8283 \
 -e ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY} \
 -e OPENAI_API_KEY=${OPENAI_API_KEY} letta/letta:local

This will run a server that reflects any changes that you've made locally. However if you change the API schemas, the ADE will not work. I'd recommend interacting the the server via the Python SDK or with REST APIs instead.

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

No branches or pull requests

2 participants