{"id":38,"library":"letta","title":"MemGPT / Letta","description":"Stateful agent framework formerly known as MemGPT. Renamed to Letta in September 2024. PyPI package moved from memgpt to letta. Two packages: letta (full server runtime) and letta-client (API client only). Agents are server-side persistent resources, not in-process Python objects.","status":"renamed","version":"0.16.4","language":"python","source_language":"en","source_url":"https://github.com/letta-ai/letta","tags":["memory","agents","stateful","letta","memgpt","python","llm"],"install":[{"cmd":"pip install letta-client","lang":"bash","label":"Python (API client only, recommended)"},{"cmd":"pip install letta","lang":"bash","label":"Python (full server runtime)"},{"cmd":"docker run -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data -p 8283:8283 -e OPENAI_API_KEY=your_key letta/letta:latest","lang":"bash","label":"Docker (recommended server deployment)"}],"dependencies":[{"reason":"Default LLM backend. Required unless configured to use another provider.","package":"openai","optional":false},{"reason":"Required by letta server for agent persistence. Docker image bundles it.","package":"postgresql","optional":true}],"imports":[{"note":"memgpt package is abandoned. All imports from memgpt.* will fail.","wrong":"from memgpt import create_client","symbol":"Letta","correct":"from letta_client import Letta"},{"note":"Only use letta (not letta_client) if you are running the full server runtime locally.","wrong":"import memgpt","symbol":"Letta (server)","correct":"from letta import create_client"}],"quickstart":{"code":"from letta_client import Letta\nimport os\n\nclient = Letta(api_key=os.getenv(\"LETTA_API_KEY\"))\n\nagent = client.agents.create(\n    model=\"openai/gpt-4o\",\n    memory_blocks=[\n        {\"label\": \"human\", \"value\": \"Name: Alice\"},\n        {\"label\": \"persona\", \"value\": \"I am a helpful assistant.\"}\n    ]\n)\n\nresponse = client.agents.messages.create(\n    agent.id,\n    input=\"Hello, remember my name.\"\n)\nprint(response.messages[0].content)","lang":"python","description":"Create a stateful Letta agent via the API client. Requires a running Letta server or Letta Cloud API key."},"warnings":[{"fix":"pip install letta-client and update all imports to from letta_client import Letta","message":"pip install memgpt is abandoned. Package renamed to letta in September 2024. All memgpt.* imports fail.","severity":"breaking","affected_versions":"memgpt < 0.4.0"},{"fix":"Start the server via Docker (letta/letta:latest) or use Letta Cloud before making any client calls.","message":"Letta agents are server-side resources, not in-process Python objects. You cannot instantiate an agent locally without a running Letta server.","severity":"breaking","affected_versions":"all"},{"fix":"Use letta-client SDK with client.agents.create() and client.agents.messages.create().","message":"Old memgpt API patterns (create_client(), Agent(), memgpt.run()) do not exist in the letta package. Architecture changed completely.","severity":"breaking","affected_versions":"memgpt all versions"},{"fix":"If you only need the client, use `pip install letta-client`. If you intend to install the full `letta` server package, ensure your Python environment is 3.10 or higher (e.g., use a `python:3.10-slim` or newer Docker image) or run the server via Docker directly.","message":"The `letta` package (full server runtime) is distinct from `letta-client`. While most applications only need `letta-client`, attempting to install `letta` (the server) directly requires Python >= 3.10.","severity":"breaking","affected_versions":"letta all versions"},{"fix":"Ignore any tutorial using memgpt package or memgpt.* imports. Use letta-client docs at docs.letta.com.","message":"MemGPT as a term now refers only to the research paper's agent design pattern, not the framework. Searching 'MemGPT Python' returns a mix of abandoned pymemgpt, transition-era letta 0.x, and current letta-client code — all incompatible.","severity":"gotcha","affected_versions":"all"}],"env_vars":{"optional":[{"name":"LETTA_BASE_URL","note":"Override to point at self-hosted server. Defaults to https://api.letta.com."}],"required":[{"name":"LETTA_API_KEY","note":"Required for Letta Cloud. Not needed for self-hosted server."},{"name":"OPENAI_API_KEY","note":"Required when using OpenAI as the LLM backend (default)."}]},"last_verified":"2026-05-12T05:23:15.026Z","next_check":"2026-04-01T00:00:00.000Z","problems":[{"fix":"Uninstall the old package (if present) with `pip uninstall memgpt` and install the new package using `pip install letta` (for server and client) or `pip install letta-client` (for client only). Then update your Python imports from `memgpt` to `letta.client`.","cause":"The Python package 'memgpt' has been renamed to 'letta' and is no longer available under its old name on PyPI.","error":"ModuleNotFoundError: No module named 'memgpt'"},{"fix":"Install the `letta` package using `pip install letta` to get the new CLI, and then use the `letta` command instead of `memgpt`.","cause":"The command-line interface executable for MemGPT has been renamed to `letta` and is not found in your system's PATH under the old name.","error":"memgpt command not found"},{"fix":"If you intend to run the Letta server or access its internal modules, you must install the complete `letta` package using `pip install letta` instead of `letta-client`.","cause":"You have installed `letta-client`, which only provides the API client components, but are attempting to import server-side modules that are exclusive to the full `letta` server package.","error":"ModuleNotFoundError: No module named 'letta.server'"},{"fix":"Ensure the `letta` server is running (e.g., by executing `letta run` in a separate terminal) and that your client application is configured to connect to the correct host and port.","cause":"The `letta` server, which your client application is attempting to connect to, is either not running or is inaccessible at the default (or specified) network address and port.","error":"letta connection refused"},{"fix":"Access agent-related operations through the `agents` property of the client, for example, `client.agents.create(...)` to create a new agent on the server.","cause":"You are attempting to call an agent creation method directly on the `Client` object, but agent management operations are typically accessed via the `client.agents` interface.","error":"AttributeError: 'Client' object has no attribute 'create_agent'"}],"ecosystem":"pypi","meta_description":null,"install_score":97,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.63,"mem_mb":32.1,"disk_size":"564.1M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.1,"mem_mb":19.1,"disk_size":"90.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.03,"mem_mb":32.1,"disk_size":"578M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.8,"mem_mb":19.1,"disk_size":"161M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.32,"mem_mb":33.3,"disk_size":"621.6M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.57,"mem_mb":20.8,"disk_size":"98.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.35,"mem_mb":27.1,"disk_size":"636M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.3,"mem_mb":20.8,"disk_size":"169M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.88,"mem_mb":32.7,"disk_size":"603.8M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.6,"mem_mb":20.6,"disk_size":"89.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.41,"mem_mb":26.6,"disk_size":"618M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.58,"mem_mb":20.6,"disk_size":"160M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.46,"mem_mb":21.5,"disk_size":"86.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.84,"mem_mb":27.1,"disk_size":"927M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.43,"mem_mb":21.5,"disk_size":"158M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.07,"mem_mb":19.3,"disk_size":"89.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.92,"mem_mb":19.3,"disk_size":"160M"}]},"quickstart_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}