{% extends "base.html" %} {% block title %}Consolidation - {% if current_project == all_projects_value %}All Projects{% else %}{{ current_project|display_name }}{% endif %} - CodeContext{% endblock %} {% block content %}

Group Consolidation{% if current_project == all_projects_value %} - All Projects{% endif %}

Find and merge clusters of semantically similar memories to reduce duplicates.

Scan History {% if history_entries|length > 0 %} {{ history_entries|length }} {% endif %}
{% if current_view == 'scan' %}
Auto-Consolidation (runs on session start/end)
{{ clusters|length if clusters else 0 }}
Clusters Found
{{ total_memories }}
Memories in Clusters
{{ info.memory_count if info else 0 }}
Total Memories
{{ info.device|upper if info else 'CPU' }}
Device
{{ threshold }} (lower = stricter matching)
{% if clusters and clusters|length > 0 and current_project != all_projects_value %} {% elif current_project == all_projects_value %} {% endif %}
{% if tiers %}
Auto: {{ tiers.auto }} LLM Small: {{ tiers.llm_small }} LLM Large: {{ tiers.llm_large }}
{% endif %}
{% if clusters %} {% for cluster in clusters %}
{{ cluster.id }} {{ cluster.size }} memories {% if cluster.project %} {{ cluster.project|display_name }} {% endif %} Avg Distance: {{ "%.3f"|format(cluster.avg_distance) }}
{% endfor %} {% else %}

No clusters found. Click "Scan for Clusters" to search for similar memories.

{% endif %}
{% endif %} {% if current_view == 'history' %}
{% if history_entries %}
{% for entry in history_entries %}
COMPLETED {{ entry.project|display_name }} {{ entry.timestamp[:19].replace('T', ' ') if entry.timestamp else '' }}
{{ entry.clusters_processed }} clusters {{ entry.consolidated }} merged {{ entry.kept }} kept {{ entry.deleted }} deleted
{% if entry.results %}
{% for result in entry.results %}
{{ result.decision }} {{ result.reasoning }} {% if result.decision == 'merge' and result.merged_memory %}
Merged to: {{ result.merged_memory.title }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% else %}

No consolidation history yet.

Run a consolidation to see results here.

{% endif %}
{% endif %}
{% endblock %}