Building persistent LLM agents with long-term memory 📚🦙
Go to file
2024-12-03 16:13:38 -08:00
.github feat: Add endpoints to list Composio apps and actions (#2140) 2024-12-02 15:36:10 -08:00
.persist fix: Clean up and simplify docker entrypoint (#1235) (#1259) 2024-04-18 22:39:11 -07:00
alembic feat: refactor agent memory representation and modify routes for editing blocks (#2094) 2024-11-27 16:04:13 -08:00
assets docs: refresh readme (#1892) 2024-10-15 16:44:10 -07:00
configs/llm_model_configs chore: deprecate letta configure and remove config defaults (#1841) 2024-10-09 14:32:08 -07:00
db chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00
examples feat: refactor agent memory representation and modify routes for editing blocks (#2094) 2024-11-27 16:04:13 -08:00
letta fix: patch bug in pydantic request model for /v1/tools/run (#2152) 2024-12-03 16:13:38 -08:00
paper_experiments chore: Remove legacy code and instances of anon_clientid (#1942) 2024-10-25 16:25:45 -07:00
scripts chore: Move ID generation logic out of the ORM layer and into the Pydantic model layer (#1981) 2024-11-05 17:05:10 -08:00
tests feat: add POST route for testing tool execution via tool_id (#2139) 2024-12-02 18:57:04 -08:00
.dockerignore ci: update workflows (add autoflake and isort) (#1300) 2024-04-27 11:54:34 -07:00
.env.example feat: add defaults to compose and .env.example (#1792) 2024-10-01 09:50:13 -07:00
.gitattributes chore: .gitattributes (#1511) 2024-07-04 14:45:35 -07:00
.gitignore feat: Sandboxing for tool execution (#2040) 2024-11-22 10:34:08 -08:00
.pre-commit-config.yaml chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00
alembic.ini chore: support alembic (#1867) 2024-10-11 15:51:14 -07:00
CITATION.cff fix: Update CITATION.cff (#2009) 2024-11-06 23:00:17 -08:00
compose.yaml fix(compose.yaml): letta_server hostname mismatch (#2065) 2024-11-19 14:36:49 -08:00
CONTRIBUTING.md docs: update contributing (#2000) 2024-11-06 22:09:29 -08:00
dev-compose.yaml feat: rename docker to letta/letta (#2010) 2024-11-06 23:15:25 -08:00
development.compose.yml fix: fix core memory heartbeat issue (#1929) 2024-10-23 12:22:37 -07:00
docker-compose-vllm.yaml feat: rename docker to letta/letta (#2010) 2024-11-06 23:15:25 -08:00
Dockerfile chore: install all extras for prod (#1989) 2024-11-06 13:02:02 -08:00
init.sql chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00
LICENSE chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00
locust_test.py feat: refactor agent memory representation and modify routes for editing blocks (#2094) 2024-11-27 16:04:13 -08:00
main.py fix: misc fixes (bad link to old docs, composio print statement, context window selection) (#1992) 2024-11-06 16:38:16 -08:00
nginx.conf fix: Fix Docker compose startup issues (letta-ai#2056) (#2057) 2024-11-17 19:28:53 -08:00
poetry.lock feat: Add endpoints to list Composio apps and actions (#2140) 2024-12-02 15:36:10 -08:00
PRIVACY.md chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00
pyproject.toml feat: Add endpoints to list Composio apps and actions (#2140) 2024-12-02 15:36:10 -08:00
README.md docs: remove dollar prefix, make it convenient to copy (#2128) 2024-12-02 15:08:03 -08:00
TERMS.md chore: migrate package name to letta (#1775) 2024-09-23 09:15:18 -07:00

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.