Skip to content

Commit a048fa7

Browse files
committed
fix: wire compact_semantic_duplicates setting to env var
the compact_semantic_duplicates parameter in compact_long_term_memories() was hardcoded to True with no corresponding Settings field. setting COMPACT_SEMANTIC_DUPLICATES=false as an env var had no effect because pydantic-settings never read it. add the field to Settings so the docket perpetual scheduler respects the env var.
1 parent d9d788c commit a048fa7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

agent_memory_server/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ class Settings(BaseSettings):
489489

490490
# Compaction settings
491491
compaction_every_minutes: int = 10
492+
compact_semantic_duplicates: bool = True
492493

493494
# Docket task timeout for LLM-dependent tasks (in minutes)
494495
# This controls how long tasks like memory compaction, extraction, and summarization

agent_memory_server/long_term_memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ async def compact_long_term_memories(
638638
redis_client: Redis | None = None,
639639
vector_distance_threshold: float = 0.2,
640640
compact_hash_duplicates: bool = True,
641-
compact_semantic_duplicates: bool = True,
641+
compact_semantic_duplicates: bool = settings.compact_semantic_duplicates,
642642
perpetual: Perpetual = Perpetual(
643643
every=timedelta(minutes=settings.compaction_every_minutes), automatic=True
644644
),

0 commit comments

Comments
 (0)