This release is a pre-release and may not be stable for production use.
Letta (formerly MemGPT)
Letta is the platform for building stateful agents: open AI with advanced memory that can learn and self-improve over time.
- Quickstart: Build your first stateful agent in 5 minutes using Python or TypeScript
- Understanding agent memory: Learn about memory blocks, tools, and how Letta agents maintain state
- Examples and tutorials: Working code examples for common use cases and agent patterns
- API reference: Complete REST API and SDK documentation for Python and TypeScript
[!TIP] Letta Code is a memory-first coding harness, built on top of the Letta API. Instead of working in independent sessions, you work with a persisted agent that learns over time and is portable across models. You can use Letta Code to interact with any Letta agent via the CLI.
Read more about how to use Letta Code on the official docs page, or on the GitHub repo.
Get started with the Letta API
Use the Letta API to build stateful agents that remember, learn, and improve over time. Letta allows you to build agents on any model provider, including OpenAI, Anthropic, Google Gemini, and more.
Installation
TypeScript / Node.js:
npm install @letta-ai/letta-client
Python:
pip install letta-client
Hello World example
Below is a quick example of creating a stateful agent and sending it a message. See the full quickstart guide for complete documentation.
Running the examples require a Letta Developer Platform account, or a self-hosted Letta server.
TypeScript:
import Letta from "@letta-ai/letta-client";
const client = new Letta({ apiKey: process.env.LETTA_API_KEY });
// Create your agent
const agentState = await client.agents.create({
model: "openai/gpt-4.1",
embedding: "openai/text-embedding-3-small",
memory_blocks: [
{
label: "human",
value:
"Name: Timber. Status: dog. Occupation: building Letta, infrastructure to democratize self-improving superintelligence",
},
{
label: "persona",
value:
"I am a self-improving superintelligence. Timber is my best friend and collaborator.",
},
],
tools: ["web_search", "run_code"],
});
console.log("Agent created with ID:", agentState.id);
// Send your agent a message
const response = await client.agents.messages.create(agentState.id, {
input: "What do you know about me?",
});
for (const message of response.messages) {
console.log(message);
}
Python:
from letta_client import Letta
import os
client = Letta(api_key=os.getenv("LETTA_API_KEY"))
# Create your agent
agent_state = client.agents.create(
model="openai/gpt-4.1",
embedding="openai/text-embedding-3-small",
memory_blocks=[
{
"label": "human",
"value": "Name: Timber. Status: dog. Occupation: building Letta, infrastructure to democratize self-improving superintelligence"
},
{
"label": "persona",
"value": "I am a self-improving superintelligence. Timber is my best friend and collaborator."
}
],
tools=["web_search", "run_code"]
)
print(f"Agent created with ID: {agent_state.id}")
# Send your agent a message
response = client.agents.messages.create(
agent_id=agent_state.id,
input="What do you know about me?"
)
for message in response.messages:
print(message)
Contributing
Letta is an open source project built by over a hundred contributors from around the world. There are many ways to get involved in the Letta OSS project!
- Join the Discord: Chat with the Letta devs and other AI developers.
- Chat on our forum: If you're not into Discord, check out our developer forum.
- Follow our socials: Twitter/X, LinkedIn, YouTube
Legal notices: By using Letta and related Letta services (such as the Letta endpoint or hosted service), you are agreeing to our privacy policy and terms of service.
Metadata
Release files for letta-nightly 0.16.1.dev20251229104436
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| letta_nightly-0.16.1.dev20251229104436.tar.gz | 7.9 MB | Without provenance | Details for letta_nightly-0.16.1.dev20251229104436.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| letta_nightly-0.16.1.dev20251229104436-py3-none-any.whl | Python 3 | none | any | Details for letta_nightly-0.16.1.dev20251229104436-py3-none-any.whl |
Total release size: 9.2 MB
Release files / letta_nightly-0.16.1.dev20251229104436.tar.gz
| Download URL | letta_nightly-0.16.1.dev20251229104436.tar.gz |
|---|---|
| Size | 7.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5ee8b45647a313b58487b6f68d15db88866265844363072ac51b66ff6e12cb5
|
|
BLAKE2b-256 checksum How to use checksums |
e7ca3f1a1c1e50d4c4430e8efd50f7fd664c9fa46c11bfd7f08cb5c9e90fb935
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / letta_nightly-0.16.1.dev20251229104436-py3-none-any.whl
| Download URL | letta_nightly-0.16.1.dev20251229104436-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d43aa887900ff4aecd22dce0a598a33d19751cfeb62bee6153c268f9f7c59979
|
|
BLAKE2b-256 checksum How to use checksums |
85f97de644438cd677b3504f54e66f07e4ebd507c935c932797446f16c9491bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for letta-nightly 0.16.1.dev20251229104436
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.