Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/memos-local-plugin/core/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const DEFAULT_CONFIG: ResolvedConfig = {
apiKey: "",
timeoutMs: 45_000,
maxRetries: 3,
maxTokens: 4_000,
},
skillEvolver: {
// Empty by default — falls back to the shared `llm` settings.
Expand All @@ -52,6 +53,7 @@ export const DEFAULT_CONFIG: ResolvedConfig = {
apiKey: "",
temperature: 0,
timeoutMs: 60_000,
maxTokens: 4_000,
},
algorithm: {
lightweightMemory: {
Expand Down
15 changes: 15 additions & 0 deletions apps/memos-local-plugin/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ const LlmSchema = Type.Object({
timeoutMs: NumberInRange(45_000, 1_000),
/** Max retries on transient errors. */
maxRetries: NumberInRange(3, 0, 10),
/**
* Max output tokens per LLM call. Default 4_000 — sufficient budget for
* reasoning models (deepseek-reasoner, o1*, gpt-5-thinking) that burn
* hundreds of tokens on chain-of-thought before content. Below ~2_000
* the JSON reflection / synth prompts get truncated mid-string and the
* bridge logs `llm.json malformed`.
*/
maxTokens: NumberInRange(4_000, 1_024, 32_768),
}, { default: {} });

/**
Expand All @@ -89,6 +97,13 @@ const SkillEvolverSchema = Type.Object({
apiKey: StringWithDefault(""),
temperature: NumberInRange(0, 0, 2),
timeoutMs: NumberInRange(60_000, 1_000),
/**
* Max output tokens per skill-evolver LLM call. Same reasoning budget
* as `llm.maxTokens` — 4_000 covers typical crystallisation JSON
* (multi-policy evidence rollup + decision rationale) without hitting
* the 32k OpenAI ceiling.
*/
maxTokens: NumberInRange(4_000, 1_024, 32_768),
}, { default: {} });

const AlgorithmSchema = Type.Object({
Expand Down