-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Labels
status:needs-reviewNeeds maintainer reviewNeeds maintainer review
Description
📋 Pre-flight Checks
- I have searched existing issues and this is not a duplicate
- I understand this issue needs
status:approvedbefore a PR can be opened
🔍 Problem Description
Engram currently determines project identity using only the git remote URL (or basename as fallback). This creates a fundamental limitation: two repositories that logically belong to the same project are treated as completely separate projects.
Example scenarios:
- "myapp" (main repo) + "myapp-installer" (installer tools repo) → treated as different projects
- Worktrees of the same repo accessed via different paths → different project names
This leads to:
- Memory fragmentation across "duplicate" projects
- Inconsistent context when working on related repositories
- No way to query or group memories across a project family
Related issue: #55 (Worktree support) - this would help with that use case.
💡 Proposed Solution
Introduce a project aliasing system that allows multiple project identifiers to resolve to a single canonical project.
Schema Proposal
CREATE TABLE project_aliases (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project TEXT NOT NULL, -- canonical project name
alias TEXT NOT NULL, -- alias or git_url
type TEXT NOT NULL DEFAULT 'alias', -- 'alias' | 'git_url'
created_at TEXT NOT NULL DEFAULT datetime('now')
);Behavior
- Alias matching: When a project name is detected, check if it exists as an alias pointing to a canonical project
- Git URL optional verification: Store git URLs as optional verification, not requirement
- Backward compatible: If no alias matches, use the detected name as-is (current behavior)
- Cross-alias search: When searching/filtering by project, automatically include all aliases
CLI Usage
# List all aliases
engram aliases list
# List aliases for specific project
engram aliases list --project myapp
# Add alias
engram aliases add myapp myapp-installer
# Add git_url for verification
engram aliases add myapp https://github.com/user/myapp.git --type git_url
# Remove alias
engram aliases remove myapp-installerHTTP API
GET /projects/aliases # List all aliases grouped by project
GET /projects/aliases?project=myapp # List aliases for specific project
POST /projects/aliases # Add alias {"project": "...", "alias": "...", "type": "alias|git_url"}
DELETE /projects/aliases/{alias} # Remove alias
Key Functions
ResolveProject(name)- resolves alias to canonical projectGetProjectAndAliases(name)- returns canonical + all aliases (for IN queries)- Modified
RecentObservations,RecentSessions,Searchto search across aliases
📦 Affected Area
- Store (database, queries)
- CLI (commands, flags)
- HTTP Server (API endpoints)
📎 Additional Context
This enables workflows like:
- Grouping "myapp", "myapp-installer", "myapp-docs" under one project
- Worktree support by allowing worktree paths as aliases
- Optional git URL verification for disambiguation without requiring git
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:needs-reviewNeeds maintainer reviewNeeds maintainer review