
Stateful AI agents with persistent memory — formerly MemGPT, agents learn and self-improve over time
Letta (formerly MemGPT) is a framework for building stateful AI agents with 23k+ GitHub stars — a LangChain alternative focused on persistent memory and self-improving agents.
Compare Letta with LlamaIndex before you choose your stack.
| Letta | LangChain | |
|---|---|---|
| License | Apache-2.0 (open source) | Proprietary |
| Models | Bring your own keys / local models | Vendor-locked models |
| Deployment | Self-hosted or cloud | SaaS only |
| Privacy | Data stays on your infrastructure | Processed by vendor |
| Cost | Free software + API usage | Subscription pricing |
Choose Letta if you want open-source code, self-hosting options, and full control over your data and deployment.
Choose LangChain if you prefer a managed proprietary product with vendor support and minimal setup.
Browse more open-source alternatives to LangChain, or explore other tools in Developer Tools.
| License | Apache-2.0 |
| Stack | Python, TypeScript, PostgreSQL |
| Self-hosted | Yes — Letta OSS |
| Cloud | letta.com (managed) |
| Memory | Persistent, multi-tier |
pip install letta
Letta can be embedded in your application or run as a standalone server. The cloud version provides managed infrastructure and team features.
Yes. Letta is open source under Apache-2.0. You can self-host it at no software cost — you only pay for infrastructure or optional managed services.
Letta gives you source code access, self-hosting, and data ownership. LangChain is a proprietary product focused on managed convenience. See the comparison table above for a side-by-side breakdown.
Yes. Letta supports self-hosted deployment, which is a core reason teams choose it over LangChain. Check the Getting started or Self-hosting section for install commands.
Letta is actively maintained with a strong open-source community. Many teams run it in production as a Developer Tools alternative to LangChain. Review the At a glance table for license and stack details.
Browse alternatives to LangChain for more open-source options, including tools compared to LlamaIndex. Explore the full Developer Tools category for related projects.