{"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)."}]},"search_vec":"'2024':15 'agent':4,36,50 'api':33 'client':32,34 'former':6 'framework':5 'full':26 'in-process':44 'known':7 'letta':2,12,22,25,31,52 'letta-cli':30 'llm':55 'memgpt':1,9,20,53 'memori':49 'move':18 'object':48 'packag':17,24 'persist':41 'process':46 'pypi':16 'python':47,54 'renam':10 'resourc':42 'runtim':28 'septemb':14 'server':27,39 'server-sid':38 'side':40 'state':3,51 'two':23","created_at":"2026-03-16T04:39:09.011572+00:00","updated_at":"2026-04-16T18:58:21.289042+00:00","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,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.16.8","cli_name":"letta","cli_version":"sh: 1: letta: not found","type":"library","homepage":"https://letta.com","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/letta/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-27","last_verified":"2026-08-26","next_check":"2026-07-27","install_tag":"verified"}}