-
Notifications
You must be signed in to change notification settings - Fork 20k
Open
Labels
coreRelated to the package `langchain-core`Related to the package `langchain-core`feature requestrequest for an enhancement / additional functionalityrequest for an enhancement / additional functionality
Description
Checked other resources
- This is a feature request, not a bug report or usage question.
- I added a clear and descriptive title that summarizes the feature request.
- I used the GitHub search to find a similar feature request and didn't find it.
- I checked the LangChain documentation and API reference to see if this feature already exists.
- This is not related to the langchain-community package.
Feature Description
Implement message ID normalization for improved caching efficiency with chat models.
Messages have unique IDs which are used as part of the cache keys generation process, causing functionally identical messages to create separate cache entries.
This feature would add a _strip_ids_from_messages function to normalize messages before cache key generation, ensuring that messages with identical content produce cache hits regardless of their unique identifiers.
Use Case
Messages with identical content but different IDs bypass cache hits, leading to reduced cache effectiveness and hit rates.
Proposed Solution
No response
Alternatives Considered
No response
Additional Context
Original attempt in #32642
Metadata
Metadata
Assignees
Labels
coreRelated to the package `langchain-core`Related to the package `langchain-core`feature requestrequest for an enhancement / additional functionalityrequest for an enhancement / additional functionality