feat(memory): add memory consolidation task and switch source_episode_ids to JSON

- Added `memory_consolidation` to the task list and updated `__all__` in test files.
- Updated `source_episode_ids` in `Fact` model to use JSON for cross-database compatibility.
- Revised related database migrations to use JSONB instead of ARRAY.
- Adjusted test concurrency in Makefile for improved test performance.
This commit is contained in:
2026-01-05 15:38:52 +01:00
parent cf6291ac8e
commit b232298c61
4 changed files with 18 additions and 14 deletions

View File

@@ -247,11 +247,12 @@ def upgrade() -> None:
sa.Column("predicate", sa.String(255), nullable=False),
sa.Column("object", sa.Text(), nullable=False),
sa.Column("confidence", sa.Float(), nullable=False, server_default="0.8"),
# Source episode IDs stored as JSON array of UUID strings for cross-db compatibility
sa.Column(
"source_episode_ids",
postgresql.ARRAY(postgresql.UUID(as_uuid=True)),
postgresql.JSONB(astext_type=sa.Text()),
nullable=False,
server_default="{}",
server_default="[]",
),
sa.Column("first_learned", sa.DateTime(timezone=True), nullable=False),
sa.Column("last_reinforced", sa.DateTime(timezone=True), nullable=False),