Skip to content

feat(l3): dedicated l3Llm config slot for abstraction pass#1959

Merged
syzsunshine219 merged 8 commits into
MemTensor:dev-v2.0.23from
chiefmojo:feat/l3-dedicated-llm
Jul 9, 2026
Merged

feat(l3): dedicated l3Llm config slot for abstraction pass#1959
syzsunshine219 merged 8 commits into
MemTensor:dev-v2.0.23from
chiefmojo:feat/l3-dedicated-llm

Conversation

@chiefmojo

@chiefmojo chiefmojo commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Problem

L3 abstraction runs on the main llm. On cheap models (e.g. gemini-2.5-flash-lite) this over-extracts and truncates the JSON output, producing 'constraints'/'inference' must be an array errors. The slot is quality-sensitive and runs off the turn-response path — a slower but more capable model here improves world-model quality with no impact on latency.

Changes

Adds an l3Llm top-level config slot using the same SkillEvolverSchema shape as skillEvolver. When blank (the default), behavior is identical to today — deps.l3Llm ?? deps.llm falls through to the main LLM. When set, the L3 clustering → abstraction subscriber uses the dedicated client.

l3Llm:
  provider: openai_compatible
  endpoint: https://openrouter.ai/api/v1
  model: anthropic/claude-sonnet-4-5
  apiKey: sk-or-...
  • defaults.ts — blank default (inherits main llm)
  • schema.tsl3Llm: SkillEvolverSchema entry
  • memory-core.ts — bootstrap client (mirrors reflectLlm path; errors log, don't crash)
  • deps.ts / types.tsPipelineDeps.l3Llm and PipelineHandle.l3Llm fields
  • orchestrator.ts — threads the field through to the handle
  • orchestrator.test.ts — two tests: dedicated client threads through, null when unconfigured

Config example

Operators running a budget model as their main llm can now point L3 at a stronger model:

llm:
  provider: openai_compatible
  model: gemini-2.5-flash-lite  # cheap, fast, good for scoring

l3Llm:
  provider: openai_compatible
  model: anthropic/claude-sonnet-4-5  # slow ok — L3 is async
  apiKey: sk-or-...

L3 abstraction runs on the main `llm`, which on cheap models
(gemini-2.5-flash-lite) over-extracts and truncates the JSON,
producing "'constraints'/'inference' must be an array" failures —
Violet logged 180 such failures and produced only 2 world-model
facts total.

Add an `l3Llm` config slot (same SkillEvolverSchema shape as
`skillEvolver`). Blank inherits the main `llm` (zero behavior
change); set explicitly to run the clustering → world-model pass
on a stronger model. L3 is async/off the turn-response path, so
a slower-but-correct model has no impact on companion latency.

Wiring mirrors skillEvolver: schema + blank default + secret
redaction + bootstrap client + PipelineDeps/PipelineHandle field
+ orchestrator handle passthrough, consumed at the L3 subscriber
attach (`deps.l3Llm ?? deps.llm`).
@itxaiohanglover

Copy link
Copy Markdown

Good config design! Dedicated l3Llm config slot allows using a stronger model for L3 abstraction without affecting companion latency. The fallback to shared llm settings is sensible. Adding l3Llm.apiKey to SECRET_FIELD_PATHS is correct.

@Memtensor-AI Memtensor-AI changed the base branch from dev-20260604-v2.0.19 to dev-v2.0.22 July 1, 2026 13:15
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Automated Test Results: PASSED

Cloud test-engine rerun against dev-v2.0.22 completed successfully.

  • Run: tr-7220330f-3c8 on cloud test-engine 10010
  • memos_local_plugin/unit: 39 passed, 0 failed, 0 skipped

Manual code review is still required before merge.

@CarltonXiang CarltonXiang deleted the branch MemTensor:dev-v2.0.23 July 3, 2026 07:25
@syzsunshine219 syzsunshine219 reopened this Jul 3, 2026
@syzsunshine219 syzsunshine219 added the needs-audit Requires manual audit before merge label Jul 3, 2026
@syzsunshine219 syzsunshine219 changed the base branch from dev-v2.0.22 to main July 3, 2026 08:21
@Memtensor-AI Memtensor-AI added area:plugin OpenClaw & Hermes area:memory 记忆存储、检索、更新、召回逻辑 labels Jul 8, 2026
@Memtensor-AI Memtensor-AI requested a review from bittergreen July 8, 2026 11:43
@Memtensor-AI Memtensor-AI removed the area:memory 记忆存储、检索、更新、召回逻辑 label Jul 9, 2026
@syzsunshine219 syzsunshine219 changed the base branch from main to dev-v2.0.23 July 9, 2026 02:57
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (43/43 executed). memos_local_plugin/unit: 43/43. Duration: 12s [advisory, non-gating] AI-generated tests on branch test/auto-gen-05768d70954acbe1-20260709111339: 51/51 passed — these do NOT affect the PR verdict; review the branch manually.

Branch: feat/l3-dedicated-llm

@Memtensor-AI Memtensor-AI added area:memory 记忆存储、检索、更新、召回逻辑 area:model llm + embedder + reranker labels Jul 9, 2026
@Memtensor-AI Memtensor-AI removed area:memory 记忆存储、检索、更新、召回逻辑 area:model llm + embedder + reranker labels Jul 9, 2026
@Memtensor-AI

Copy link
Copy Markdown
Collaborator

✅ Automated Test Results: PASSED

All tests passed (43/43 executed). memos_local_plugin/unit: 43/43. Duration: 12s [advisory, non-gating] AI-generated tests on branch test/auto-gen-41b2127f5d64fbe6-20260709120727: 77/77 passed — these do NOT affect the PR verdict; review the branch manually.

Branch: feat/l3-dedicated-llm

@syzsunshine219 syzsunshine219 merged commit 9deb941 into MemTensor:dev-v2.0.23 Jul 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:plugin OpenClaw & Hermes needs-audit Requires manual audit before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants