Self Configurationのロゴ

Self Configuration

組織
letta-ai
self-configuration

Lettaエージェント自身の実行時の動作を設定します。モデル、コンテキストウィンドウ、システムプロンプト、推論、会話ごとのオーバーライド、圧縮設定、圧縮プロンプトが対象です。エージェントやユーザーが自己変更、要約や圧縮の調整、IDやシステム指示の変更、モデル設定の調整、会話単位のオーバーライドのテストを求めた場合に使用します。

Add to TypingMind

概要

公開者letta-ai
リポジトリskills
スキル名self-configuration
スター
144
フォーク
25
同梱ファイル
5
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    letta-aiがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Self Configuration」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/letta-ai/skills/tree/main/letta/self-configuration
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/letta-ai/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/letta/self-configuration .claude/skills/self-configuration
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSelf Configurationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSelf Configurationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Self Configurationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Letta self-configuration

Use the Letta API when an agent needs to change its own persistent defaults or the current conversation's temporary runtime settings.

Safety rule

Ask before changing persistent agent defaults unless the user explicitly requested the change. Persistent changes include agent model, system prompt, context window, model settings, and compaction settings. Prefer conversation-scoped changes for experiments.

Decision tree

  • Need a temporary model/context experiment? Patch the current conversation.
  • Need persistent model, system prompt, or compaction behavior? Patch the agent.
  • Need better summaries after context eviction? Use the Compaction settings section and prompt patterns.
  • Need provider keys, BYOK setup, or server deployment env vars? Use the broader Letta configuration/API skills instead.
  • Need to design a new agent from scratch? Use the agent-development skill.

Environment

bash
BASE_URL="${LETTA_BASE_URL:-https://api.letta.com}"
: "${LETTA_API_KEY:?Set LETTA_API_KEY}"
: "${AGENT_ID:?Set AGENT_ID}"

Use AGENT_ID for yourself. Use CONVERSATION_ID for the current thread when it is available.

Inspect first

bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" | \
  jq '{id, model, context_window_limit, llm_config, model_settings, compaction_settings, system_chars: (.system | length)}'

Choose the API target

TargetEndpointPersistenceUse for
AgentPATCH /v1/agents/$AGENT_IDPersistent across conversationsmodel defaults, context window, system prompt, compaction settings
ConversationPATCH /v1/conversations/$CONVERSATION_IDCurrent conversation onlytemporary model/context/reasoning experiments

Quick patches

Context window only

context_window_limit is top-level. Do not put it inside model_settings.

bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context_window_limit": 64000}'

Conversation-scoped:

bash
: "${CONVERSATION_ID:?Set CONVERSATION_ID}"

curl -sS -X PATCH "$BASE_URL/v1/conversations/$CONVERSATION_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"context_window_limit": 64000}'

Agent-level model update

model_settings is usually treated as a replacement object, not a deep merge. Read the current agent first and include any existing settings you want to keep. Provider-specific examples live in references/model-settings.md.

bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.2",
    "context_window_limit": 272000,
    "model_settings": {
      "provider_type": "openai",
      "parallel_tool_calls": true,
      "reasoning": { "reasoning_effort": "medium" },
      "max_output_tokens": 128000
    }
  }'

Conversation-scoped model update

bash
: "${CONVERSATION_ID:?Set CONVERSATION_ID}"

curl -sS -X PATCH "$BASE_URL/v1/conversations/$CONVERSATION_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.2",
    "context_window_limit": 64000,
    "model_settings": {
      "provider_type": "openai",
      "parallel_tool_calls": true,
      "reasoning": { "reasoning_effort": "low" }
    }
  }'

Safe conversation-scoped model test

A successful PATCH means the API accepted the configuration shape. It does not always prove the selected model handle can generate at runtime for the current server, provider, account, or routing configuration. The first actual model call may still fail with a resolver/provider error.

For model experiments, prefer this bounded recipe:

  1. Save or inspect the current agent/conversation configuration.
  2. Patch the current conversation, not persistent agent defaults.
  3. Verify the response or re-fetch the conversation to confirm the config changed.
  4. Run a tiny low-risk runtime test in the same conversation.
  5. If the runtime test fails, revert the conversation to the saved known-good model/settings.

This keeps failed model-handle experiments from damaging the agent's persistent continuity or requiring the user to repair global defaults.

System prompt replacement

Only use system when the user explicitly asks to change the persistent system prompt. It is a full replacement, not an append.

bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" | jq -r '.system'

Then send the complete replacement prompt:

bash
curl -sS -X PATCH "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"system": "<FULL replacement system prompt. Preserve important existing instructions.>"}'

Safer bundled updater

Use scripts/update-agent-settings.ts when you want a dry-runable patch that can optionally merge existing model_settings or compaction_settings before updating.

bash
npx tsx <SKILL_DIR>/scripts/update-agent-settings.ts \
  --target agent \
  --context-window-limit 64000 \
  --dry-run

Examples and all flags are in references/api-patch-examples.md.

Compaction settings

Compaction runs when message history grows too large for the context window. Letta replaces older messages with a summary while keeping recent messages in context. The summary appears before the remaining recent messages, so a custom compaction prompt should preserve enough background for the later messages to make sense.

Customize compaction when the default summary loses important continuity, tone, relationship context, implementation details, or user feedback.

Compaction fields

FieldUse
modesliding_window, all, self_compact_sliding_window, or self_compact_all.
promptCustom summarization prompt.
modelOptional cheaper/faster summarizer model.
model_settingsOptional summarizer model settings.
prompt_acknowledgementOptional boolean for summarizers that add acknowledgements/meta-commentary.
clip_charsMax summary length in characters. Default is 50000.
sliding_window_percentageFraction of messages to summarize in sliding-window modes. Docs default: 0.3.

Choose a compaction mode

  • Use sliding_window by default. It summarizes older messages with a separate summarizer call and keeps recent messages intact.
  • Use self_compact_sliding_window when the agent's own persona/system prompt is important for summary quality or prompt-cache reuse.
  • Use all only when maximum space reduction matters more than preserving recent raw messages.
  • Use self_compact_all for all-message compaction with the agent system prompt included.

Prompt requirements

Every custom compaction prompt should:

  • State whether evicted messages come from the beginning of the context window.
  • Say the summary will appear before remaining recent messages.
  • Say not to continue the conversation, answer transcript questions, or call tools.
  • Require incorporation of any existing summary being evicted.
  • Preserve exact user requests, names, IDs, URLs, file paths, dates, and quoted phrases when they matter.
  • Include lookup hints for detailed content that cannot fit.
  • End with "Only output the summary."

For complete prompt templates, read references/compaction-prompt-patterns.md.

Update compaction with the bundled script

bash
npx tsx <SKILL_DIR>/scripts/update-compaction-prompt.ts \
  --prompt-file /tmp/compaction-prompt.txt \
  --mode self_compact_sliding_window \
  --clip-chars 50000 \
  --dry-run

The script preserves existing compaction_settings fields unless flags override them. It uses LETTA_API_KEY, AGENT_ID, and LETTA_BASE_URL unless corresponding flags are provided.

SDK examples

TypeScript and Python examples live in references/api-patch-examples.md.

Verify

bash
curl -sS "$BASE_URL/v1/agents/$AGENT_ID" \
  -H "Authorization: Bearer $LETTA_API_KEY" | \
  jq '{id, model, context_window_limit, llm_config_context_window: .llm_config.context_window, model_settings, compaction_settings, system_chars: (.system | length)}'

Guardrails

  • Ask before changing persistent agent defaults unless explicitly requested.
  • Prefer conversation-scoped updates for experiments.
  • Keep context windows only as large as needed. Bigger windows increase latency and cost.
  • Preserve existing model_settings and compaction_settings fields unless intentionally changing them.
  • For self-compaction prompts, always forbid tool use and conversation continuation.
  • If an update returns 400, first check model handle validity, provider type, and whether settings are in the expected shape.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Self Configuration」では何ができますか?

Lettaエージェント自身の実行時の動作を設定します。モデル、コンテキストウィンドウ、システムプロンプト、推論、会話ごとのオーバーライド、圧縮設定、圧縮プロンプトが対象です。エージェントやユーザーが自己変更、要約や圧縮の調整、IDやシステム指示の変更、モデル設定の調整、会話単位のオーバーライドのテストを求めた場合に使用します。

TypingMindでSelf Configurationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Self Configurationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSelf Configurationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/letta-ai/skills/tree/main/letta/self-configurationを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Self Configurationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Self Configurationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSelf Configurationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Self Configuration」は無料ですか?

はい。letta-aiがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇