feat: add system prompt and memory block configuration for headless mode (#450)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-02 15:32:07 -08:00
committed by GitHub
parent 321519a1b7
commit a956a15db4
10 changed files with 399 additions and 139 deletions

View File

@@ -56,47 +56,48 @@ export const SYSTEM_PROMPTS: SystemPromptOption[] = [
{
id: "default",
label: "Default",
description: "Standard Letta Code system prompt (Claude-optimized)",
description: "Alias for letta-claude",
content: lettaAnthropicPrompt,
isDefault: true,
isFeatured: true,
},
{
id: "legacy",
label: "Legacy",
description: "Original system prompt",
content: systemPrompt,
id: "letta-claude",
label: "Letta Claude",
description: "Full Letta Code system prompt (Claude-optimized)",
content: lettaAnthropicPrompt,
isFeatured: true,
},
{
id: "letta-codex",
label: "Codex",
description: "For Codex models",
label: "Letta Codex",
description: "Full Letta Code system prompt (Codex-optimized)",
content: lettaCodexPrompt,
isFeatured: true,
},
{
id: "letta-gemini",
label: "Gemini",
description: "For Gemini models",
label: "Letta Gemini",
description: "Full Letta Code system prompt (Gemini-optimized)",
content: lettaGeminiPrompt,
isFeatured: true,
},
{
id: "anthropic",
id: "claude",
label: "Claude (basic)",
description: "For Claude models (no skills/memory instructions)",
description: "Basic Claude prompt (no skills/memory instructions)",
content: anthropicPrompt,
},
{
id: "codex",
label: "Codex (basic)",
description: "For Codex models (no skills/memory instructions)",
description: "Basic Codex prompt (no skills/memory instructions)",
content: codexPrompt,
},
{
id: "gemini",
label: "Gemini (basic)",
description: "For Gemini models (no skills/memory instructions)",
description: "Basic Gemini prompt (no skills/memory instructions)",
content: geminiPrompt,
},
];
@@ -109,19 +110,19 @@ export const SYSTEM_PROMPTS: SystemPromptOption[] = [
* 2. If it matches a subagent name, use that subagent's system prompt
* 3. Otherwise, use the default system prompt
*
* @param systemPromptId - The system prompt ID (e.g., "codex") or subagent name (e.g., "explore")
* @param systemPromptPreset - The system prompt preset (e.g., "letta-claude") or subagent name (e.g., "explore")
* @returns The resolved system prompt content
*/
export async function resolveSystemPrompt(
systemPromptId: string | undefined,
systemPromptPreset: string | undefined,
): Promise<string> {
// No input - use default
if (!systemPromptId) {
if (!systemPromptPreset) {
return SYSTEM_PROMPT;
}
// 1. Check if it matches a system prompt ID
const matchedPrompt = SYSTEM_PROMPTS.find((p) => p.id === systemPromptId);
const matchedPrompt = SYSTEM_PROMPTS.find((p) => p.id === systemPromptPreset);
if (matchedPrompt) {
return matchedPrompt.content;
}
@@ -129,7 +130,7 @@ export async function resolveSystemPrompt(
// 2. Check if it matches a subagent name
const { getAllSubagentConfigs } = await import("./subagents");
const subagentConfigs = await getAllSubagentConfigs();
const matchedSubagent = subagentConfigs[systemPromptId];
const matchedSubagent = subagentConfigs[systemPromptPreset];
if (matchedSubagent) {
return matchedSubagent.systemPrompt;
}