-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ceremony): self-reflection step between Expire and Explore #35
Description
Summary
The current Expire → Explore ceremony is mechanical: remove low-exposure topics, then generate new ones from traits + recent themes. There's no moment where the persona reflects on what it's losing and what that means for who it's becoming. This issue adds a reflection step between the two phases.
Current Ceremony Flow
```
queueExpirePhase()
→ handlePersonaExpire() # removes low-exposure topics
→ queueExplorePhase() # if topic count < threshold
→ handlePersonaExplore() # adds new topics
→ queueDescriptionCheck()
```
The Explore phase receives: traits (with strength), remaining topics, recent conversation themes. It does a good job generating topically-relevant new interests — but it doesn't know why certain topics faded, or what patterns exist across changes.
Proposed Addition
Add HandlePersonaReflect between Expire and Explore:
```
handlePersonaExpire()
→ queueReflectPhase() # NEW: reflect on what was removed and why
→ handlePersonaReflect() # NEW: produce a reflection summary
→ queueExplorePhase() # now has reflection as additional context
```
Reflect phase inputs
- Removed topic names + their final
exposure_currentvalues - Remaining topics (names + exposure)
- Persona traits with strength
- Recent conversation themes (same slice Explore already uses)
Reflect phase output
A brief structured reflection (1-3 sentences) that answers:
- What patterns led to these topics fading?
- What does that suggest about the persona's current interests/growth?
Explore phase change
Pass the reflection summary as additional context alongside traits and remaining topics. The Explore LLM can use it to generate more intentional new topics rather than just filling slots.
Optional: feed into DescriptionCheck
The reflection could also inform the description update step — the persona's description can reference how it's evolved.
Implementation Notes
- New enum value:
LLMNextStep.HandlePersonaReflectinsrc/core/types/enums.ts - New orchestrator function:
queueReflectPhase()insrc/core/orchestrators/ceremony.ts - New handler:
handlePersonaReflect()insrc/core/handlers/persona-topics.ts(or new file) - New prompt builder:
src/prompts/ceremony/reflect.ts - Reflection is ephemeral — it informs the session but is not stored as a persistent field
Notes
The Expire/Explore pair is already doing the right thing for Flare's "self-modifying" concern — this is Ei orchestrating persona evolution based on observed data, not a persona rewriting its own traits autonomously. The reflection step adds narrative continuity to a mechanical process, not autonomy.