Skip to main content

Create LLM agents with long-term memory and custom tools

Project description

Letta logo

Letta (previously MemGPT)

Homepage // Documentation // Letta Cloud

👾 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.

Discord Twitter Follow arxiv 2310.08560

Apache 2.0 Release GitHub

cpacker%2FMemGPT | Trendshift

[!NOTE] Looking for MemGPT? You're in the right place!

The MemGPT package and Docker image have been renamed to letta to clarify the distinction between MemGPT agents and the API server / runtime that runs LLM agents as services.

You use the Letta framework to create MemGPT agents. Read more about the relationship between MemGPT and Letta here.

⚡ Quickstart

The two main ways to install Letta are through pypi (pip) or via Docker:

  • pip (guide below) - the easiest way to try Letta, will default to using SQLite and ChromaDB for the database backends
  • Docker (guide here) - recommended for production settings, will default to using Postgres (+ pgvector) for the database backend

Step 1 - Install Letta using pip

$ pip install -U letta

Step 2 - Set your environment variables for your chosen LLM / embedding providers

$ export OPENAI_API_KEY=sk-...

For Ollama (see our full documentation for examples of how to set up various providers):

$ export OLLAMA_BASE_URL=http://localhost:11434

Step 3 - Run the Letta CLI

You can create agents and chat with them via the Letta CLI tool (letta run):

$ letta run
🧬 Creating new agent...
? Select LLM model: letta-free [type=openai] [ip=https://inference.memgpt.ai]
? Select embedding model: letta-free [type=hugging-face] [ip=https://embeddings.memgpt.ai]
->  🤖 Using persona profile: 'sam_pov'
->  🧑 Using human profile: 'basic'
->  🛠️  8 tools: send_message, pause_heartbeats, conversation_search, conversation_search_date, archival_memory_insert, archival_memory_search, core_memory_append, core_memory_replace

🎉 Created new agent 'InspiringSpinach'

Hit enter to begin (will request first Letta message)

💭 User engaged. Recognize as Chad. Acknowledge presence and establish connection. Explore interests and engage in meaningful discourse.
🤖 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?

> Enter your message: my name is Brad, not Chad...

💭 A discrepancy in identity. Reflect this change in core memory. Apologize for the oversight, and rectify the error.
⚡🧠 [function] updating memory with core_memory_replace
         First name: Chad
        → First name: Brad
💭 Apologize for the mistake in recognizing his name, and begin the conversation anew, addressing him by the correct name this time.
🤖 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?

> Enter your message:

Step 4 - Run the Letta server

You can start the Letta API server with letta server (see the full API reference here):

$ letta server
Initializing database...
Running: uvicorn server:app --host localhost --port 8283
INFO:     Started server process [47750]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:8283 (Press CTRL+C to quit)

When you start the Letta API server, the ADE (Agent Development Environment) will be available on http://localhost:8283: Screenshot of the Letta ADE (Agent Development Environment)

In Letta, all agents are stored/persisted in the same database, so the agents you create in the CLI are accessible via the API and ADE, and vice versa. Check out the quickstart guide on our docs for a tutorial where you create an agent in the Letta CLI and message the same agent via the Letta API.

🤗 How to contribute

Letta is an open source project built by over a hundred contributors. There are many ways to get involved in the Letta OSS project!

  • Contribute to the project: Interested in contributing? Start by reading our Contribution Guidelines.
  • Ask a question: Join our community on Discord and direct your questions to the #support channel.
  • Report ssues or suggest features: Have an issue or a feature request? Please submit them through our GitHub Issues page.
  • Explore the roadmap: Curious about future developments? View and comment on our project roadmap.
  • Join community events: Stay updated with the event calendar or follow our Twitter account.

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

letta_nightly-0.5.3.dev20241120201258.tar.gz (919.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file letta_nightly-0.5.3.dev20241120201258.tar.gz.

File metadata

File hashes

Hashes for letta_nightly-0.5.3.dev20241120201258.tar.gz
Algorithm Hash digest
SHA256 33a0a77f2a83185fccc5f27439cf78616cbabc947fb83090f3cb36adb856d88f
MD5 f948eaff0e8648742ffde5146910af8b
BLAKE2b-256 87b22c28605d1900b427d624ecc9a2fd08e896238e161eff8b231109f1aa53ae

See more details on using hashes here.

File details

Details for the file letta_nightly-0.5.3.dev20241120201258-py3-none-any.whl.

File metadata

File hashes

Hashes for letta_nightly-0.5.3.dev20241120201258-py3-none-any.whl
Algorithm Hash digest
SHA256 f49d37ac96e99f658d2b50ec44069aafe5dd8136c0a1b3cb1d59cf781b128749
MD5 44fdbb6bf81955fcf344ce4d3d006806
BLAKE2b-256 4690c5505edb49d3e89627f15d5ef7fc27bf5a39e1e9088b9d8d39d7d24b89df

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page