Skip to content

letta-ai/letta-code

Repository files navigation

Letta Code

npm Discord

Letta Code is a memory-first agent harness, designed for long-lived agents that can learn from experience and maintain a cohesive identity across models (Claude, GPT, Gemini, GLM, Kimi, and more).

You can interact with Letta Code agents through:

Letta Code is a frontier coding agent and can also be used as a long-lived personal agent.

Feature Overview

Tip

Letta Code agents are designed to be self-configuring. If you want to configure something (e.g. skills, behavior, hooks, permissions), try asking your agent to do it for you.

Feature Description
Self-improvement & Learning Agents programmatically rewrite their context to improve and adapt over time, including system prompt learning (through memory blocks) and skill learning. Configure periodic dreaming with /sleeptime, audit memory quality with /doctor, and view memory with /palace
Message search Search across all messages and agents with /search. Agent can also search their own conversations or the conversations of other agents
MemFS All context (including memory blocks) is tracked via git. Sync context to a custom GitHub repository by setting /memory-repository set git@github.com:...
Skills Loads global skills (~/.letta), project-scoped skills (.agents/skills), and agent-scoped skills (stored in MemFS). View skills with /skills and create with /skill-creator
Subagents & Multi-agent Call built-in subagents (general-purpose, forked, recall, history-analyzer) async or sync. Agents can call any other agent (including themselves) as subagents
Messaging Integrations Chat with the same agent from Slack, Telegram, your browser (chat.letta.com) including mobile, and through custom channels
Hooks Run custom scripts at key points of agent execution to automate workflows
Permissions Set permission modes and customize what actions are auto-approved or auto-denied
Crons & Schedules Configure heartbeats and crons, and let agents work across time with self-managed schedules
Remote & Multi-Env Agents work across multiple environments. Make any machine available as a remote environment by running letta server --env-name "..."
Secrets Make secrets available as environment variables (across machines) while obfuscating their values from context

See the full list of slash commands in our documentation.

Get started

Install the package via npm:

npm install -g @letta-ai/letta-code

Navigate to your project directory and run letta (see various command-line options on the docs).

Run /connect to configure your own LLM API keys (OpenAI / ChatGPT, Anthropic, zAI coding plan, etc.), and use /model to swap models.

For slow local inference servers, configure a provider-level timeout when connecting. For example, LM Studio-compatible llama-server backends that need up to 10 minutes for large-context compaction can use:

letta --backend local connect lmstudio --base-url http://127.0.0.1:1234/v1 --timeout 600s

Timeouts are stored per local provider in milliseconds; pass --no-timeout or --timeout false to disable the provider timeout.

You can also download the desktop app for MacOS, Windows, and Linux. Agents created in the CLI are available via the desktop app, and vice versa.

Philosophy

Letta Code is built around long-lived agents that persist across sessions and improve with use. Rather than working in independent sessions, each session is tied to a persisted agent that learns.

Claude Code / Codex / Gemini CLI (Session-Based)

  • Sessions are independent
  • No learning between sessions
  • Context = messages in the current session + AGENTS.md
  • Relationship: Every conversation is like meeting a new contractor

Letta Code (Agent-Based)

  • Same agent across sessions
  • Persistent memory and learning over time
  • /clear starts a new conversation (aka "thread" or "session"), but memory persists
  • Relationship: Like having a coworker or mentee that learns and remembers

Agent Memory & Learning

If you’re using Letta Code for the first time, you will likely want to run the /init command to initialize the agent’s memory system:

> /init

Over time, the agent will update its memory as it learns. To actively guide your agents memory, you can use the /remember command:

> /remember [optional instructions on what to remember]

Letta Code works with skills (reusable modules that teach your agent new capabilities in a .skills directory), but additionally supports skill learning. You can ask your agent to learn a skill from its current trajectory with the command:

> /skill [optional instructions on what skill to learn]

Read the docs to learn more about skills and skill learning.

Community maintained packages are available for Arch Linux users on the AUR:

yay -S letta-code # release
yay -S letta-code-git # nightly

Made with 💜 in San Francisco

About

The memory-first coding agent

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages