Repository navigation
Tags: redis/agent-memory-server
Tags
fix: wire compact_semantic_duplicates setting to env var (#182) * 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. * fix: resolve compact_semantic_duplicates default at call time the default was evaluated at function definition time, meaning test-time patches and runtime config reloads had no effect. use None sentinel with runtime resolution instead. add regression test for COMPACT_SEMANTIC_DUPLICATES env var parsing. * style: run pre-commit format to pass ci linter make format uses a different ruff version than the pre-commit hook (v0.3.2). re-ran with pre-commit run --all-files to match CI.
Merge pull request #138 from redis/fix/docket-task-timeouts fix: Add per-task timeouts for LLM-dependent Docket tasks
Merge pull request #138 from redis/fix/docket-task-timeouts fix: Add per-task timeouts for LLM-dependent Docket tasks
Fix empty text causing OpenAI embeddings API error (#134) ## Problem The compact_long_term_memories background task failed with: litellm.exceptions.BadRequestError: OpenAIException - Error code: 400 - {'error': {'message': "'$.input' is invalid..."}} This occurred because a memory with empty text was passed to OpenAI's embedding API, which rejects empty strings. ## Solution Two-layer approach: 1. **Reject empty text at API layer** - Prevent new memories with empty text from being created: - Added validation to CreateMemoryRecordRequest - Added validation to UpdateWorkingMemory - Added validation to LenientMemoryRecord 2. **Filter legacy data gracefully** - Handle existing invalid memories in the database: - Filter out memories with empty text/id in index_long_term_memories - Skip semantic deduplication for empty text in deduplicate_by_semantic_search - Raise clear ValueError in embed_documents/aembed_documents for empty strings ## Changes - agent_memory_server/models.py: Add validation to request models - agent_memory_server/long_term_memory.py: Filter invalid memories during indexing - agent_memory_server/llm/embeddings.py: Validate inputs before calling OpenAI - tests/integration/test_deduplication_e2e.py: Tests for both API rejection and legacy handling Bump version to 0.13.1
PreviousNext