{"id":27075129,"url":"https://github.com/cpacker/MemGPT","last_synced_at":"2025-04-06T00:02:46.778Z","repository":{"id":199649450,"uuid":"703411624","full_name":"letta-ai/letta","owner":"letta-ai","description":"Letta (formerly MemGPT) is the stateful agents framework with memory, reasoning, and context management.","archived":false,"fork":false,"pushed_at":"2025-03-31T18:22:06.000Z","size":31306,"stargazers_count":15678,"open_issues_count":53,"forks_count":1632,"subscribers_count":129,"default_branch":"main","last_synced_at":"2025-04-01T20:52:33.415Z","etag":null,"topics":["ai","ai-agents","llm","llm-agent"],"latest_commit_sha":null,"homepage":"https://docs.letta.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/letta-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-11T07:38:37.000Z","updated_at":"2025-04-01T18:56:03.000Z","dependencies_parsed_at":"2023-10-25T22:28:32.579Z","dependency_job_id":"522f2fbd-edc6-4c92-bcd8-f245501c2e7c","html_url":"https://github.com/letta-ai/letta","commit_stats":null,"previous_names":["cpacker/memgpt","letta-ai/letta"],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letta-ai%2Fletta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letta-ai%2Fletta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letta-ai%2Fletta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letta-ai%2Fletta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letta-ai","download_url":"https://codeload.github.com/letta-ai/letta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415950,"owners_count":20935388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agents","llm","llm-agent"],"created_at":"2025-04-06T00:01:41.535Z","updated_at":"2025-04-06T00:02:46.769Z","avatar_url":"https://github.com/letta-ai.png","language":"Python","funding_links":[],"categories":["Python","Projects and Implementations","其他LLM框架","7. OS","推理 Inference","⚙️ Agent Operations","Memory Frameworks","Community Projects","Projects","chatbot","Applications","Large Language Models (LLMs)","LLM应用与智能体 (Agent)","Autonomous Agents","State \u0026 Memory","Other LLM Frameworks","Memory"],"sub_categories":["文章","4.3 Tree Search + Web Agents","🧠 Memory","Open Source","Applications","提示语（魔法）","Contribute to our Repository","LLM 评估与数据","Videos Playlists"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/Letta-logo-RGB_GreyonTransparent_cropped_small.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/Letta-logo-RGB_OffBlackonTransparent_cropped_small.png\"\u003e\n    \u003cimg alt=\"Letta logo\" src=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/Letta-logo-RGB_GreyonOffBlack_cropped_small.png\" width=\"500\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eLetta (previously MemGPT)\u003c/h1\u003e\n\n**☄️ New release: Letta Agent Development Environment (_read more [here](#-access-the-ade-agent-development-environment)_) ☄️**\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot_light.png\"\u003e\n    \u003cimg alt=\"Letta logo\" src=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot.png\" width=\"800\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n---\n\n\u003ch3\u003e\n\n[Homepage](https://letta.com) // [Documentation](https://docs.letta.com) // [ADE](https://docs.letta.com/agent-development-environment) // [Letta Cloud](https://forms.letta.com/early-access)\n\n\u003c/h3\u003e\n\n**👾 Letta** is an open source framework for building stateful LLM applications. You can use Letta to build **stateful agents** with advanced reasoning capabilities and transparent long-term memory. The Letta framework is white box and model-agnostic.\n\n[![Discord](https://img.shields.io/discord/1161736243340640419?label=Discord\u0026logo=discord\u0026logoColor=5865F2\u0026style=flat-square\u0026color=5865F2)](https://discord.gg/letta)\n[![Twitter Follow](https://img.shields.io/badge/Follow-%40Letta__AI-1DA1F2?style=flat-square\u0026logo=x\u0026logoColor=white)](https://twitter.com/Letta_AI)\n[![arxiv 2310.08560](https://img.shields.io/badge/Research-2310.08560-B31B1B?logo=arxiv\u0026style=flat-square)](https://arxiv.org/abs/2310.08560)\n\n[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-silver?style=flat-square)](LICENSE)\n[![Release](https://img.shields.io/github/v/release/cpacker/MemGPT?style=flat-square\u0026label=Release\u0026color=limegreen)](https://github.com/cpacker/MemGPT/releases)\n[![Docker](https://img.shields.io/docker/v/letta/letta?style=flat-square\u0026logo=docker\u0026label=Docker\u0026color=0db7ed)](https://hub.docker.com/r/letta/letta)\n[![GitHub](https://img.shields.io/github/stars/cpacker/MemGPT?style=flat-square\u0026logo=github\u0026label=Stars\u0026color=gold)](https://github.com/cpacker/MemGPT)\n\n\u003ca href=\"https://trendshift.io/repositories/3612\" target=\"_blank\"\u003e\u003cimg src=\"https://trendshift.io/api/badge/repositories/3612\" alt=\"cpacker%2FMemGPT | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"/\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\u003e [!IMPORTANT]\n\u003e **Looking for MemGPT?** You're in the right place!\n\u003e\n\u003e The MemGPT package and Docker image have been renamed to `letta` to clarify the distinction between MemGPT *agents* and the Letta API *server* / *runtime* that runs LLM agents as *services*. Read more about the relationship between MemGPT and Letta [here](https://www.letta.com/blog/memgpt-and-letta).\n\n---\n\n## ⚡ Quickstart\n\n_The recommended way to use Letta is to run use Docker. To install Docker, see [Docker's installation guide](https://docs.docker.com/get-docker/). For issues with installing Docker, see [Docker's troubleshooting guide](https://docs.docker.com/desktop/troubleshoot-and-support/troubleshoot/). You can also install Letta using `pip` (see instructions [below](#-quickstart-pip))._\n\n### 🌖 Run the Letta server\n\n\u003e [!NOTE]\n\u003e Letta agents live inside the Letta server, which persists them to a database. You can interact with the Letta agents inside your Letta server via the [REST API](https://docs.letta.com/api-reference) + Python / Typescript SDKs, and the [Agent Development Environment](https://app.letta.com) (a graphical interface).\n\nThe Letta server can be connected to various LLM API backends ([OpenAI](https://docs.letta.com/models/openai), [Anthropic](https://docs.letta.com/models/anthropic), [vLLM](https://docs.letta.com/models/vllm), [Ollama](https://docs.letta.com/models/ollama), etc.). To enable access to these LLM API providers, set the appropriate environment variables when you use `docker run`:\n```sh\n# replace `~/.letta/.persist/pgdata` with wherever you want to store your agent data\ndocker run \\\n  -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \\\n  -p 8283:8283 \\\n  -e OPENAI_API_KEY=\"your_openai_api_key\" \\\n  letta/letta:latest\n```\n\nIf you have many different LLM API keys, you can also set up a `.env` file instead and pass that to `docker run`:\n```sh\n# using a .env file instead of passing environment variables\ndocker run \\\n  -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \\\n  -p 8283:8283 \\\n  --env-file .env \\\n  letta/letta:latest\n```\n\nOnce the Letta server is running, you can access it via port `8283` (e.g. sending REST API requests to `http://localhost:8283/v1`). You can also connect your server to the Letta ADE to access and manage your agents in a web interface.\n\n### 👾 Access the ADE (Agent Development Environment)\n\n\u003e [!NOTE]\n\u003e For a guided tour of the ADE, watch our [ADE walkthrough on YouTube](https://www.youtube.com/watch?v=OzSCFR0Lp5s), or read our [blog post](https://www.letta.com/blog/introducing-the-agent-development-environment) and [developer docs](https://docs.letta.com/agent-development-environment).\n\nThe Letta ADE is a graphical user interface for creating, deploying, interacting and observing with your Letta agents. For example, if you're running a Letta server to power an end-user application (such as a customer support chatbot), you can use the ADE to test, debug, and observe the agents in your server. You can also use the ADE as a general chat interface to interact with your Letta agents.\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot_light.png\"\u003e\n    \u003cimg alt=\"ADE screenshot\" src=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot.png\" width=\"800\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\nThe ADE can connect to self-hosted Letta servers (e.g. a Letta server running on your laptop), as well as the Letta Cloud service. When connected to a self-hosted / private server, the ADE uses the Letta REST API to communicate with your server.\n\n#### 🖥️ Connecting the ADE to your local Letta server\nTo connect the ADE with your local Letta server, simply:\n1. Start your Letta server (`docker run ...`)\n2. Visit [https://app.letta.com](https://app.letta.com) and you will see \"Local server\" as an option in the left panel\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot_agents.png\"\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot_agents_light.png\"\u003e\n    \u003cimg alt=\"Letta logo\" src=\"https://raw.githubusercontent.com/letta-ai/letta/refs/heads/main/assets/example_ade_screenshot_agents.png\" width=\"800\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n🔐 To password protect your server, include `SECURE=true` and `LETTA_SERVER_PASSWORD=yourpassword` in your `docker run` command:\n```sh\n# If LETTA_SERVER_PASSWORD isn't set, the server will autogenerate a password\ndocker run \\\n  -v ~/.letta/.persist/pgdata:/var/lib/postgresql/data \\\n  -p 8283:8283 \\\n  --env-file .env \\\n  -e SECURE=true \\\n  -e LETTA_SERVER_PASSWORD=yourpassword \\\n  letta/letta:latest\n```\n\n#### 🌐 Connecting the ADE to an external (self-hosted) Letta server\nIf your Letta server isn't running on `localhost` (for example, you deployed it on an external service like EC2):\n1. Click \"Add remote server\"\n2. Enter your desired server name, the IP address of the server, and the server password (if set)\n\n---\n\n## 🧑‍🚀 Frequently asked questions (FAQ)\n\n\u003e _\"Do I need to install Docker to use Letta?\"_\n\nNo, you can install Letta using `pip` (via `pip install -U letta`), as well as from source (via `poetry install`). See instructions below.\n\n\u003e _\"What's the difference between installing with `pip` vs `Docker`?\"_\n\nLetta gives your agents persistence (they live indefinitely) by storing all your agent data in a database. Letta is designed to be used with a [PostgreSQL](https://en.wikipedia.org/wiki/PostgreSQL) (the world's most popular database), however, it is not possible to install PostgreSQL via `pip`, so the `pip` install of Letta defaults to using [SQLite](https://www.sqlite.org/). If you have a PostgreSQL instance running on your own computer, you can still connect Letta (installed via `pip`) to PostgreSQL by setting the environment variable `LETTA_PG_URI`.\n\n**Database migrations are not officially supported for Letta when using SQLite**, so if you would like to ensure that you're able to upgrade to the latest Letta version and migrate your Letta agents data, make sure that you're using PostgreSQL as your Letta database backend. Full compatability table below:\n\n| Installation method | Start server command | Database backend | Data migrations supported? |\n|---|---|---|---|\n| `pip install letta` | `letta server` | SQLite | ❌ |\n| `pip install letta` | `export LETTA_PG_URI=...` + `letta server` | PostgreSQL | ✅ |\n| *[Install Docker](https://www.docker.com/get-started/)*  |`docker run ...` ([full command](#-run-the-letta-server)) | PostgreSQL | ✅ |\n\n\u003e _\"How do I use the ADE locally?\"_\n\nTo connect the ADE to your local Letta server, simply run your Letta server (make sure you can access `localhost:8283`) and go to [https://app.letta.com](https://app.letta.com). If you would like to use the old version of the ADE (that runs on `localhost`), downgrade to Letta version `\u003c=0.5.0`.\n\n\u003e _\"If I connect the ADE to my local server, does my agent data get uploaded to letta.com?\"_\n\nNo, the data in your Letta server database stays on your machine. The Letta ADE web application simply connects to your local Letta server (via the REST API) and provides a graphical interface on top of it to visualize your local Letta data in your browser's local state.\n\n\u003e _\"Do I have to use your ADE? Can I build my own?\"_\n\nThe ADE is built on top of the (fully open source) Letta server and Letta Agents API. You can build your own application like the ADE on top of the REST API (view the documention [here](https://docs.letta.com/api-reference)).\n\n\u003e _\"Can I interact with Letta agents via the CLI?\"_\n\nThe recommended way to use Letta is via the REST API and ADE, however you can also access your agents via the CLI.\n\n\u003cdetails\u003e\n\u003csummary\u003eView instructions for running the Letta CLI\u003c/summary\u003e\n\nYou can chat with your agents via the Letta CLI tool (`letta run`). If you have a Letta Docker container running, you can use `docker exec` to run the Letta CLI inside the container:\n```sh\n# replace `\u003cletta_container_id\u003e` with the ID of your Letta container, found via `docker ps`\ndocker exec -it \u003cletta_container_id\u003e letta run\n```\n\nYou can also use `docker ps` within the command to automatically find the ID of your Letta container:\n```\ndocker exec -it $(docker ps -q -f ancestor=letta/letta) letta run\n```\n\nIn the CLI tool, you'll be able to create new agents, or load existing agents:\n```\n🧬 Creating new agent...\n? Select LLM model: letta-free [type=openai] [ip=https://inference.memgpt.ai]\n? Select embedding model: letta-free [type=hugging-face] [ip=https://embeddings.memgpt.ai]\n-\u003e  🤖 Using persona profile: 'sam_pov'\n-\u003e  🧑 Using human profile: 'basic'\n-\u003e  🛠️  8 tools: send_message, pause_heartbeats, conversation_search, conversation_search_date, archival_memory_insert, archival_memory_search, core_memory_append, core_memory_replace\n\n🎉 Created new agent 'InspiringSpinach'\n\nHit enter to begin (will request first Letta message)\n\n💭 User engaged. Recognize as Chad. Acknowledge presence and establish connection. Explore interests and engage in meaningful discourse.\n🤖 Hello, Chad. It's nice to meet you. I am keen on learning and exploring new ideas and concepts. Is there a specific topic you'd like to discuss today?\n\n\u003e Enter your message: my name is Brad, not Chad...\n\n💭 A discrepancy in identity. Reflect this change in core memory. Apologize for the oversight, and rectify the error.\n⚡🧠 [function] updating memory with core_memory_replace\n         First name: Chad\n        → First name: Brad\n💭 Apologize for the mistake in recognizing his name, and begin the conversation anew, addressing him by the correct name this time.\n🤖 I apologize for the oversight, Brad. Let's restart. It's a pleasure to meet you, Brad. Is there a specific topic you'd like to discuss today?\n\n\u003e Enter your message:\n```\n\u003c/details\u003e\n\n---\n\n## ⚡ Quickstart (pip)\n\n\u003e [!WARNING]\n\u003e **Database migrations are not officially supported with `SQLite`**\n\u003e\n\u003e When you install Letta with `pip`, the default database backend is `SQLite` (you can still use an external `postgres` service with your `pip` install of Letta by setting `LETTA_PG_URI`).\n\u003e\n\u003e We do not officially support migrations between Letta versions with `SQLite` backends, only `postgres`. If you would like to keep your agent data across multiple Letta versions we highly recommend using the Docker install method which is the easiest way to use `postgres` with Letta.\n\n\u003cdetails\u003e\n\n\u003csummary\u003eView instructions for installing with pip\u003c/summary\u003e\n\nYou can also install Letta with `pip`, which will default to using `SQLite` for the database backends (whereas Docker will default to using `postgres`).\n\n### Step 1 - Install Letta using `pip`\n```sh\npip install -U letta\n```\n\n### Step 2 - Set your environment variables for your chosen LLM / embedding providers\n```sh\nexport OPENAI_API_KEY=sk-...\n```\n\nFor Ollama (see our full [documentation](https://docs.letta.com/install) for examples of how to set up various providers):\n```sh\nexport OLLAMA_BASE_URL=http://localhost:11434\n```\n\n### Step 3 - Run the Letta CLI\n\nYou can create agents and chat with them via the Letta CLI tool (`letta run`):\n```sh\nletta run\n```\n```\n🧬 Creating new agent...\n? Select LLM model: letta-free [type=openai] [ip=https://inference.memgpt.ai]\n? Select embedding model: letta-free [type=hugging-face] [ip=https://embeddings.memgpt.ai]\n-\u003e  🤖 Using persona profile: 'sam_pov'\n-\u003e  🧑 Using human profile: 'basic'\n-\u003e  🛠️  8 tools: send_message, pause_heartbeats, conversation_search, conversation_search_date, archival_memory_insert, archival_memory_search, core_memory_append, core_memory_replace\n\n🎉 Created new agent 'InspiringSpinach'\n\nHit enter to begin (will request first Letta message)\n\n💭 User engaged. Recognize as Chad. Acknowledge presence and establish connection. Explore interests and engage in meaningful discourse.\n🤖 Hello, Chad. It's nice to meet you. I am keen on learning and exploring new ideas and concepts. Is there a specific topic you'd like to discuss today?\n\n\u003e Enter your message: my name is Brad, not Chad...\n\n💭 A discrepancy in identity. Reflect this change in core memory. Apologize for the oversight, and rectify the error.\n⚡🧠 [function] updating memory with core_memory_replace\n         First name: Chad\n        → First name: Brad\n💭 Apologize for the mistake in recognizing his name, and begin the conversation anew, addressing him by the correct name this time.\n🤖 I apologize for the oversight, Brad. Let's restart. It's a pleasure to meet you, Brad. Is there a specific topic you'd like to discuss today?\n\n\u003e Enter your message:\n```\n\n### Step 4 - Run the Letta server\n\nYou can start the Letta API server with `letta server` (see the full API reference [here](https://docs.letta.com/api-reference)):\n```sh\nletta server\n```\n```\nInitializing database...\nRunning: uvicorn server:app --host localhost --port 8283\nINFO:     Started server process [47750]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\nINFO:     Uvicorn running on http://localhost:8283 (Press CTRL+C to quit)\n```\n\u003c/details\u003e\n\n---\n\n## 🤗 How to contribute\n\nLetta is an open source project built by over a hundred contributors. There are many ways to get involved in the Letta OSS project!\n\n* **Contribute to the project**: Interested in contributing? Start by reading our [Contribution Guidelines](https://github.com/cpacker/MemGPT/tree/main/CONTRIBUTING.md).\n* **Ask a question**: Join our community on [Discord](https://discord.gg/letta) and direct your questions to the `#support` channel.\n* **Report issues or suggest features**: Have an issue or a feature request? Please submit them through our [GitHub Issues page](https://github.com/cpacker/MemGPT/issues).\n* **Explore the roadmap**: Curious about future developments? View and comment on our [project roadmap](https://github.com/cpacker/MemGPT/issues/1533).\n* **Join community events**: Stay updated with the [event calendar](https://lu.ma/berkeley-llm-meetup) or follow our [Twitter account](https://twitter.com/Letta_AI).\n\n---\n\n***Legal notices**: By using Letta and related Letta services (such as the Letta endpoint or hosted service), you are agreeing to our [privacy policy](https://www.letta.com/privacy-policy) and [terms of service](https://www.letta.com/terms-of-service).*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpacker%2FMemGPT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpacker%2FMemGPT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpacker%2FMemGPT/lists"}