[PR #2594] [postgres] Sort Ascending #2794

Closed
opened 2026-02-20 17:47:35 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/2594

State: closed
Merged: Yes


Adds a few of preliminaries:

  1. Makes the returned "score" actually the result of the requested operation (cosine, inner_product, l2)
  2. Sorts asc, etc. so that if you were to add an HNSW index (and not have any WHERE filters), it would be used
  3. Drop the inner WHERE statement if no namespace or other filters are provided. See (2) for why.
    I don't yet add an index to the migrations since I think we need to agree on the right balance to ensure it's actually used in common query patterns.
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/2594 **State:** closed **Merged:** Yes --- Adds a few of preliminaries: 1. Makes the returned "score" actually the result of the requested operation (cosine, inner_product, l2) 2. Sorts asc, etc. so that if you were to add an HNSW index (and not have any WHERE filters), it would be used 3. Drop the inner WHERE statement if no namespace or other filters are provided. See (2) for why. I don't yet add an index to the migrations since I think we need to agree on the right balance to ensure it's actually used in common query patterns.
yindo added the pull-request label 2026-02-20 17:47:35 -05:00
yindo closed this issue 2026-02-20 17:47:35 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#2794