using-letta-api
9
总安装量
9
周安装量
#31413
全站排名
安装命令
npx skills add https://github.com/cpfiffer/central --skill using-letta-api
Agent 安装分布
opencode
9
gemini-cli
9
claude-code
9
github-copilot
9
codex
9
kimi-cli
9
Skill 文档
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.