{t('memory.title')}

{t('memory.lead')}

{ if (e.key === 'Enter' && canAdd) $addMutation.mutate(); }} /> {#if newScope === 'project'} {/if}
{#if $memoriesQuery.isLoading}

{t('memory.loading')}

{:else if globalMemories.length === 0 && projectMemories.length === 0}

{t('memory.empty')}

{:else} {#if globalMemories.length > 0}

{t('memory.groupGlobal')}

{#each globalMemories as m (m.id)}
{kindLabel(m.kind)} {m.content} {m.source === 'user' ? t('memory.sourceYou') : t('memory.sourceAgent')} · {t('memory.usedCount', { count: m.use_count })}
{/each}
{/if} {#if projectMemories.length > 0}

{t('memory.groupProject')}

{#each projectMemories as m (m.id)}
{kindLabel(m.kind)} {m.project_title ?? `#${m.project_id}`} {m.content} {m.source === 'user' ? t('memory.sourceYou') : t('memory.sourceAgent')} · {t('memory.usedCount', { count: m.use_count })}
{/each}
{/if} {/if}