feat: Implement Today's Workflow and Agent Huddle enhancements

This commit is contained in:
ajaysi
2026-03-01 20:15:31 +05:30
parent 62d9c2e836
commit f8f7ddeb2a
25 changed files with 1852 additions and 272 deletions

View File

@@ -46,4 +46,27 @@ class DailyWorkflowTask(Base):
plan = relationship("DailyWorkflowPlan", back_populates="tasks")
class TaskHistory(Base):
"""
Tracks historical tasks for self-learning.
Used by TaskMemoryService to prevent redundant suggestions and learn from rejections.
"""
__tablename__ = "task_history"
id = Column(Integer, primary_key=True, index=True)
user_id = Column(String(255), nullable=False, index=True)
task_hash = Column(String(64), nullable=False, index=True) # Hash of title + description
title = Column(String(255), nullable=False)
description = Column(Text, nullable=False)
pillar_id = Column(String(30), nullable=False)
status = Column(String(30), nullable=False) # completed, dismissed, rejected
source_agent = Column(String(50), nullable=True)
feedback_score = Column(Integer, nullable=True) # -1 (bad), 0 (neutral), 1 (good)
feedback_text = Column(Text, nullable=True)
created_at = Column(DateTime, default=datetime.utcnow, index=True)
# Metadata for vector index linking
vector_id = Column(String(36), nullable=True)
Index("ix_daily_workflow_plans_user_date", DailyWorkflowPlan.user_id, DailyWorkflowPlan.date, unique=True)
Index("ix_task_history_user_hash", TaskHistory.user_id, TaskHistory.task_hash)