feat(memory): implement step-based extraction pipeline architecture

Introduce ExtractionStep abstraction with modular pipeline stages:
- Add base ExtractionStep class with render/call/parse lifecycle
- Implement StatementExtractionStep, TripletExtractionStep,
  EmbeddingStep, EmotionStep, GraphBuildStep, and DedupStep
- Add SidecarStepFactory for hot-pluggable non-critical steps
- Define Pydantic I/O schemas for all pipeline stages
- Refactor WritePipeline to orchestrate new step-based flow
- Add NEW_PIPELINE_ENABLED env switch for old/new pipeline routing
- Add emotion_enabled config flag to MemoryConfig
- Fix workspace_id reference in get_end_user_connected_config
This commit is contained in:
lanceyq
2026-04-23 15:47:46 +08:00
parent 41535c34e6
commit a98011fc8a
20 changed files with 3102 additions and 144 deletions

View File

@@ -421,6 +421,9 @@ class MemoryConfig:
pruning_scene: Optional[str] = "education"
pruning_threshold: float = 0.5
# Pipeline config: Emotion extraction
emotion_enabled: bool = False
# Ontology scene association
scene_id: Optional[UUID] = None
ontology_class_infos: list[dict] = field(default_factory=list)