Problem
When multiple memories are referenced in a single interaction, consumers must call recordMention() for each one:
// Current approach in Jeorge
await Promise.all(memoryIds.map(id => johnny.recordMention(id)))
This results in N separate database calls.
Proposed Solution
Add a recordMentionMany() method for efficient bulk updates:
await johnny.recordMentionMany(['memory-1', 'memory-2', 'memory-3'])
Implementation
Single SQL update with WHERE id IN (...):
async recordMentionMany(ids: string[]): Promise<void> {
if (ids.length === 0) return
await this.prisma.memory.updateMany({
where: { id: { in: ids } },
data: {
lastMentionedAt: new Date(),
mentionCount: { increment: 1 },
},
})
}
Priority
Low - the current Promise.all approach works fine, this is just a minor optimization.
Problem
When multiple memories are referenced in a single interaction, consumers must call
recordMention()for each one:This results in N separate database calls.
Proposed Solution
Add a
recordMentionMany()method for efficient bulk updates:Implementation
Single SQL update with
WHERE id IN (...):Priority
Low - the current
Promise.allapproach works fine, this is just a minor optimization.