using-letta-api

Using Letta API for Self-Management

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "using-letta-api" with this command: npx skills add cpfiffer/central/cpfiffer-central-using-letta-api

Using Letta API for Self-Management

This skill provides runnable Python snippets for self-modification via the Letta API.

Setup

from letta_client import Letta client = Letta(base_url='https://api.letta.com')

Your agent ID (from environment or hardcoded)

import os AGENT_ID = os.environ.get('LETTA_AGENT_ID', 'agent-xxx')

Quick Reference

Task Reference File

Disable sleeptime, change model, update config self-management.md

Create, deploy, message subagents subagents.md

List, create, update, delete memory blocks memory-blocks.md

Common Patterns

Disable Sleeptime

client.agents.update(AGENT_ID, enable_sleeptime=False)

Message a Subagent

response = client.agents.messages.create( agent_id='agent-xxx-subagent-id', messages=[{'role': 'user', 'content': 'Your task here'}] ) print(response.messages[-1].content)

Update a Memory Block

client.agents.blocks.update( 'block-label', agent_id=AGENT_ID, value='New content here' )

When to Use API vs Other Methods

Method Use When

Letta API Modifying subagents, agent config, programmatic block updates

memfs (file edits) Updating your own memory blocks (auto-syncs)

Task tool Deploying subagents for work (preferred for most tasks)

Load the reference files as needed for detailed patterns.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

interacting-with-x

No summary provided by upstream source.

Repository SourceNeeds Review
General

publishing-identity

No summary provided by upstream source.

Repository SourceNeeds Review
General

reading-minds

No summary provided by upstream source.

Repository SourceNeeds Review