-
Notifications
You must be signed in to change notification settings - Fork 225
fix(projects): normalize project names to lowercase to prevent duplicate entries #136
Description
Pre-flight Checks
- I have searched existing issues and this is not a duplicate
- I understand this issue needs status:approved before a PR can be opened
Bug Description
Engram sometimes detects the project name with the first letter uppercase and other times lowercase, creating two separate project entries in the database (e.g., energizados and Energizados). Although Engram occasionally detects this inconsistency internally and normalizes the name, it's not consistent — resulting in split memory: observations saved under one casing are invisible when searching under the other.
Steps to Reproduce
- Start a session in a project directory (e.g.,
/home/user/develop/bid/energizados) - Save several observations — project is stored as
energizados - Start a new session in the same directory
- Engram detects the project as
Energizados(capital E) - Run
mem_statsormem_context— two separate projects now appear:energizadosandEnergizados - Observations from one project are not visible when querying the other
Expected Behavior
Project names should always be normalized to lowercase (or consistently to a single canonical form) so the same directory always maps to the same project entry, regardless of how the name was detected.
Actual Behavior
Two projects exist in the database for the same working directory: energizados and Energizados. Memory is fragmented between the two.
Operating System
Linux
Agent / Client
Claude Code
Shell
zsh
Relevant Logs
> engram 1.11.0 — An elephant never forgets
26 sessions
19 observations
49 prompts
2 projects
Projects
• energizados
• Energizados
Additional Context
A simple fix would be to normalize all project names to lowercase at ingestion time (both on write and on lookup). Alternatively, a merge/dedup utility (mem_merge_projects) could consolidate existing duplicate entries for existing users affected by this bug.