feat: split introspection backend from consolidation (trial Dolphin for her voice)
reflect()/think() can now run on a different model than memory consolidation: INTROSPECTION_BACKEND / INTROSPECTION_MODEL (default to SUMMARY_BACKEND, so unset = unchanged). Consolidation (summaries/profile/narrative) keeps the capable model; her *voice* (reflections, thoughts) can run a steerable tune. dream.py lets reflect()/think() self-resolve to the introspection backend; both now thread a `model` override into llm.complete. Trial live: introspection -> dolphin3:8b on the 3090; consolidation -> Qwen-32B on the MI50. Suite 73 green, ruff clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-4
@@ -214,7 +214,7 @@ def wander_seed() -> str:
|
||||
|
||||
|
||||
def reflect(backend: Backend | None = None, session_id: str | None = None,
|
||||
source: str = "manual") -> dict:
|
||||
source: str = "manual", model: str | None = None) -> dict:
|
||||
"""Reflect on recent activity and update the self-state. Returns new state.
|
||||
|
||||
Two steps, not one: she drafts a reflection, then examines her own draft —
|
||||
@@ -224,7 +224,9 @@ def reflect(backend: Backend | None = None, session_id: str | None = None,
|
||||
produces (reflections, the critique, and any deliberate journal note) is also
|
||||
appended to her permanent journal, tagged with `source`.
|
||||
"""
|
||||
backend = backend or config.load().summary_backend
|
||||
cfg = config.load()
|
||||
backend = backend or cfg.introspection_backend # her voice (may differ from consolidation)
|
||||
model = model or cfg.introspection_model
|
||||
state = load()
|
||||
state.setdefault("reflections", [])
|
||||
state.setdefault("metacognition", [])
|
||||
@@ -269,7 +271,7 @@ def reflect(backend: Backend | None = None, session_id: str | None = None,
|
||||
# Step 1 — draft a reflection.
|
||||
draft = _safe_json(llm.complete(
|
||||
[{"role": "system", "content": _REFLECT_PROMPT}, {"role": "user", "content": body}],
|
||||
backend=backend,
|
||||
backend=backend, model=model,
|
||||
))
|
||||
|
||||
# Step 2 — examine her own draft and revise it into a more honest version.
|
||||
@@ -279,7 +281,7 @@ def reflect(backend: Backend | None = None, session_id: str | None = None,
|
||||
revised = _safe_json(llm.complete(
|
||||
[{"role": "system", "content": _EXAMINE_PROMPT},
|
||||
{"role": "user", "content": examine_body}],
|
||||
backend=backend,
|
||||
backend=backend, model=model,
|
||||
))
|
||||
if revised: # fall back to the draft if the examine step doesn't parse
|
||||
update = revised
|
||||
|
||||
Reference in New Issue
Block a user