Engineering Assistant on Letta: Self-Updating Memory, Archival Search, and Portable Workflows

16 November 20260 views

Covers building an agent that independently manages blocks of primary memory, accesses a vector archive, and calls deterministic tools; it also examines shared state across multiple agents, streaming output, and exporting the workflow as a portable file.

Engineering Assistant on Letta: Self-Updating Memory, Archival Search, and Portable Workflows

Purpose of the assistant

This tutorial builds a stateful engineering assistant on Letta. The agent is given the description “Engineering copilot with inspectable long-term memory.” The architecture combines memory, search, tools, multi-agent interaction, and execution traces.

Criterion: the assistant is suited to stateful engineering tasks and verifiable long-term memory.

Core memory blocks and self-updating

Core memory consists of four verifiable blocks. The agent can update them on its own.

The code defines four blocks with different default values and limits.

BlockContentsDefault valueLimit
persona“I am Mnemo, an engineering copilot. I am terse, concrete, and I never invent facts — if I don't know something I say so and then go look it up.”—3000
humanPersistent information about the engineer: name, role, stack, preferences, and working style.Unknown so far.3000
project_stateCurrent project state: milestones, blockers, decisions, and their rationale.(empty)5000
lessonsLessons learned and mistakes not to repeat; format — one line per lesson.(empty)2000

Criterion: the blocks separate the agent's role, the engineer's profile, project state, and lessons learned. The limits define the boundaries of each block.

Embedding, tags, and model configuration

The code sets openai/text-embedding-3-small as the agent's embedding. The code assigns the tags ["tutorial", "copilot"]. The code lists the preferred models: openai/gpt-4.1, openai/gpt-4o-mini, anthropic/claude-sonnet-4-20250514. The system selects the first available model in the list. If none are found, the system uses the first model returned.

Criterion: the list order sets the priority. The fallback is the first model returned.

Programmatic access and agent collaboration

Programmatic access to the blocks serves two purposes.

  • state synchronization;
  • sharing between multiple agents.

Access is provided to the core memory blocks.

Criterion: shared access to the blocks is needed to synchronize state between agents.

Archival memory and semantic search

Archival vector memory is used for semantic search. It is part of the assistant's architecture.

Criterion: archival search is needed for semantic queries over accumulated data.

Server-side risk assessment tool and streaming execution

A custom server-side tool performs deterministic risk assessment. Streaming execution is part of the assistant's architecture.

Criterion: risk assessment requires a server-side tool with deterministic logic. Execution requires streaming.

Server-side history and portable scenarios

Server-side message history supports persistent conversations. .af export provides portability.

Criterion: persistent conversations require server-side history. Scenario portability requires .af export.

Frequently asked questions

Engineering Assistant on Letta: Self-Updating Memory, Archival Search, and Portable Workflows