[PR #6111] fix(checkpoint): preserve non-ascii text in InMemoryStore embeddings #4840

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

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

State: closed
Merged: Yes


Description

  • Set ensure_ascii=False for all json.dumps calls in get_text_at_path. Preserves non-ASCII text instead of embedding \uXXXX escapes.

Before

store.put(("user_123", "memories"), "1", {"text": "这是中文"})
# embeds {"text": "\\u8fd9\\u662f\\u4e2d\\u6587"}

After

store.put(("user_123", "memories"), "1", {"text": "这是中文"})
# embeds {"text": "这是中文"}

Tests

  • Add unit tests test_non_ascii in checkpoint, checkpoint-postgres, and checkpoint-sqlite that write non-ascii records to a store, searches with the same strings, and asserts the correct top hit.

Issue

Fixes #5946

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6111 **State:** closed **Merged:** Yes --- ### Description * Set `ensure_ascii=False` for all `json.dumps` calls in `get_text_at_path`. Preserves non-ASCII text instead of embedding `\uXXXX` escapes. **Before** ```python store.put(("user_123", "memories"), "1", {"text": "这是中文"}) # embeds {"text": "\\u8fd9\\u662f\\u4e2d\\u6587"} ``` **After** ```python store.put(("user_123", "memories"), "1", {"text": "这是中文"}) # embeds {"text": "这是中文"} ``` ### Tests * Add unit tests `test_non_ascii` in checkpoint, checkpoint-postgres, and checkpoint-sqlite that write non-ascii records to a store, searches with the same strings, and asserts the correct top hit. ### Issue Fixes #5946
yindo added the pull-request label 2026-02-20 17:50:50 -05:00
yindo closed this issue 2026-02-20 17:50:50 -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#4840