Skip to content

feat(memory): add SemanticStateAccumulator to TurnContext for MemCoT semantic state tracking #3574

@bug-ops

Description

@bug-ops

Description

Implement the semantic state memory component from MemCoT (arXiv:2604.08216, #3564).

Add a SemanticStateAccumulator to TurnContext in zeph-core that:

  • Summarizes the conceptual state after each LLM turn
  • Accumulates semantic deltas across the conversation
  • Feeds into ReasoningMemory retrieval as enriched query context

Config flag: memory.memcot.enabled (default: false). When disabled, accumulator is a no-op.

The accumulator must use a fast-tier provider (e.g., gpt-4o-mini) per the multi-model design rule — never a quality-tier provider. The distillation prompt must be short and cost-bounded.

Acceptance Criteria

  • memory.memcot.enabled config flag wires/no-ops the accumulator
  • Integration test on a multi-turn fixture shows accumulator content in debug dump
  • No regression on single-turn benchmark
  • Feature is completely invisible when enabled = false (no latency, no LLM calls)

References

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityenhancementNew feature or requestmemoryzeph-memory crate (SQLite)researchResearch-driven improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions