servers icon indicating copy to clipboard operation
servers copied to clipboard

Optimize Memory Search: Normalize entity names and observation contents to lowercase on add, create and delete for consistent comparisons

Open bernoussama opened this issue 7 months ago • 1 comments

Description

Normalized entity and relation properties to lowercase before saving to ensure consistent search behavior in the knowledge graph. This prevents duplicate entries that differ only by case and improves search accuracy.

Server Details

  • Server: memory
  • Changes to: tools (knowledge graph functionality)

Motivation and Context

Unnecessary Normalizing to lowercase on each call to searchNodes function. This change ensures all entity and relation properties are consistently stored in lowercase format, improving data integrity and search reliability.

How Has This Been Tested?

Not tested

Breaking Changes

No breaking changes. This is a non-breaking improvement to internal data handling.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)

Checklist

  • [x] I have read the MCP Protocol Documentation
  • [x] My changes follows MCP security best practices
  • [x] I have tested this with an LLM client
  • [x] My code follows the repository's style guidelines
  • [x] New and existing tests pass locally
  • [x] I have added appropriate error handling

Additional context

This change affects how entity and relation data is stored internally but maintains backward compatibility with existing client interactions. The normalized approach provides more consistent behavior for user queries.

bernoussama avatar May 13 '25 23:05 bernoussama