Skip to content

fix(aws): honor zero MemoryDB distance threshold - #1241

Open
WOLIKIMCHENG wants to merge 1 commit into
langchain-ai:mainfrom
WOLIKIMCHENG:fix/inmemorydb-zero-distance-threshold
Open

fix(aws): honor zero MemoryDB distance threshold#1241
WOLIKIMCHENG wants to merge 1 commit into
langchain-ai:mainfrom
WOLIKIMCHENG:fix/inmemorydb-zero-distance-threshold

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Summary

Treat distance_threshold=0.0 as an explicitly configured threshold when building MemoryDB vector queries.

  • Use VECTOR_RANGE for every non-None threshold and bind the exact value.
  • Use KNN only when the threshold is None.
  • Preserve positive-threshold behavior.
  • Add unit coverage for zero, positive, and absent thresholds.

Testing

  • Focused unit tests: 3 passed
  • Ruff check and format check
  • Mypy on the changed source and test files
  • Syntax, import, and diff hygiene checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant