莱塔代码
Letta Code

原始链接: https://www.letta.com/blog/letta-code

## Letta Code:持久且学习的编码代理 Letta Code 是一个全新的开源编码代理框架,专为**长期使用和持续学习**设计。与每次会话都从头开始的典型代理不同,Letta Code 代理在交互之间**持久存在**,积累记忆并随着经验而改进。 这通过**代理上下文工程、长期记忆和技能学习**来实现。用户可以通过 `/init` 初始化代理,并通过 `/remember` 明确提示学习。复杂的重复性任务可以形式化为可重用的**技能**(存储为 .md 文件并使用 Git 进行版本控制),以供将来使用,从而提高性能。代理还可以通过 `/search` 和 Letta API 访问过去的对话。 重要的是,Letta Code **与模型无关**,目前在 TerminalBench 上排名第一的开源工具,性能可与 LLM 提供商(如 Claude 和 Gemini)构建的工具相媲美。这意味着即使**不**利用其学习能力,也能获得强大的性能。 Letta Code 可以通过 npm 安装,并可与 Letta 开发者平台或自托管服务器一起使用。

## Letta Code:开源、内存优先的编码代理 Letta Code (letta.com) 是一款完全开源、模型无关的编码框架,目前在Terminal-Bench上的排名很高。它以“内存优先”方法为特色,专为能够随着时间推移学习用户、代码库和组织上下文的持久代理而设计。`/init`和`/remember`等工具帮助管理这种内存,而`/clear`则在保留学习上下文的同时重置聊天缓冲区。 来自Letta的开发者最初将其构建用于内部使用——Letta Code现在共同编写了他们GitHub仓库中的大部分PR。一个关键特性是“危险模式” (`--yolo`),用于沙盒环境,类似于Claude Code的权限设置。 讨论中强调了LLM“记忆”可能被污染或变得无用的问题,但Letta Code透明、基于文本的内存系统允许对提示进行完全控制和可见性。用户正在探索与现有工具(如Beads)的集成,以实现潜在的互补功能。该项目旨在避免重复任务并使代理能够从过去的错误中学习。
相关文章

原文

Letta Code is a memory-first coding agent, designed for working with agents that learn over time. When working with coding agents today, interactions happen in independent sessions. 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. Letta Code is also the #1 model-agnostic OSS harness on TerminalBench, and achieves comparable performance to harnesses built by LLM providers (Claude Code, Gemini CLI, Codex CLI) on their own models.

Continual Learning & Memory for Coding Agents 

Agents today accumulate valuable experience: they receive the user’s preferences and feedback, review significant parts of code, and observe the outcomes of taking actions like running scripts or commands. Yet today this experience is largely wasted. Letta agents learn from experience through agentic context engineering, long-term memory, and skill learning. The more you work with an agent, the more context and memory it accumulates, and the better it becomes. 

Memory Initialization 

When you get started with Letta Code, you can run an `/init` command to encourage your agent to learn about your existing project. This will trigger your agent to run deep research on your local codebase, forming memories and rewriting its system prompt (through memory blocks) as it learns.

Your agent will continue to learn automatically, but you can also explicitly trigger your agent to reflect and learn with the `/remember` command. 

Skill Learning 

Many tasks that we work on with coding agents are repeated or follow similar patterns - for example API patterns or running DB migrations. Once you’ve worked with an agent to coach it through a complex task, you can trigger it to learn a skill from its experience, so the agent itself or other agents can reference the skill for similar tasks in the future. Skill learning can dramatically improve performance on future similar tasks, as we showed with recent results on TerminalBench.

On our team, some skills that agents have contributed (with the help of human engineers) are: 

  • Generating DB migrations on schema changes
  • Creating PostHog dashboards with the PostHog CLI
  • Best practices for API changes   

Since skills are simply .md files, they can be managed in git repositories for versioning - or even used by other coding agents that support skills. 

Persisted State

Agents can also lookup past conversations (or even conversations of other agents) through the Letta API. The builtin `/search` command allows you to easily search through messages, so you can find the agent you worked on something with. The Letta API supports vector, full-text, and hybrid search over messages and available tools.

Letta Code is the #1 model-agnostic OSS coding harness 

Letta Code adds statefulness and learning to coding agents, but is the #1 model-agnostic, OSS harness on Terminal-Bench. Letta Code’s performance is comparable to provider-specific harnesses (Gemini CLI, Claude Code, Codex) across model providers, and significantly outperforms the previous leading model-agnostic harness, Terminus 2.

This means that even without memory, you can expect Letta Code agents to work just as well with a frontier model as they would with a specific harness built by the model provider. 

Getting Started with Letta Code 

To try out Letta Code, you can install it with npm install -g @letta-ai/letta-code or install from source (see the full documentation).

Letta Code can be used with the Letta Developer Platform, or with a self-hosted Letta server.

联系我们 contact @ memedata.com