---
title: "Consolidate Memories"
method: POST
path: "/v1/memories/consolidate"
tags: ["memories"]
---

# Consolidate Memories

`POST /v1/memories/consolidate`

## Request

- Base URL: `https://api.heirmos.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.heirmos.com/v1/memories/consolidate`
- Auth: HTTP bearer

Merge N memories into one via LLM (P7-2).

The new memory lands at ``body.paths[0]``; the rest are soft-deleted.
``source`` on the merged row is hard-coded to ``"consolidate"`` so audit
queries can distinguish AI-generated merges from user/AI writes.

## Request body

- ConsolidateRequest: POST /v1/memories/consolidate request body (P7-2).
  - `paths` string[], required

## Response `201`

Successful Response

- ConsolidateResponse: POST /v1/memories/consolidate response (P7-2). Returns the freshly inserted merged memory plus the paths that were archived in the process (so the caller can refresh its UI / cache).
  - `merged` MemoryRead, required: GET /v1/memories/{path:path} response — SPEC §5.3 line 326-339. `summary` is included even though SPEC's example omits it: the column exists (SPEC §4.1) and list responses surface it, so a single-memory read should too.
    - `id` string, uuid, required
    - `path` string, required
    - `title` string, nullable
    - `content` string, required
    - `summary` string, nullable
    - `tags` string[], required
    - `importance` number, required
    - `source` string, required
    - `version` integer, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `type` string, nullable
    - `scope` string, nullable
    - `status` string
    - `confidence` number, nullable
    - `privacy_sensitivity` number, nullable
    - `secondary_folders` string[]
    - `source_kind` string, nullable
    - `source_id` string, nullable
    - `evidence_quote` string, nullable
    - `ai_reasoning_summary` string, nullable
    - `valid_from` string, date-time, nullable
    - `valid_until` string, date-time, nullable
    - `occurred_at` string, date-time, nullable
    - `summary_for_ai` string, nullable
    - `retrieval_keywords` string[], nullable
    - `embedding_text` string, nullable
    - `folder_context` string, nullable
    - `related_memory_ids` string[], nullable
    - `dedup` DedupInfo: Advisory write-time dedup result — Phase 13 P13-2 (SPEC §10 + §15 #17). Rides on the ``POST /v1/memories`` response body **only** (never persisted). The server always saves the memory (201); this tells the client/user that the new memory resembles an existing one so they can choose to merge into ``suggested_path``. Propose-only — the server never blocks or auto-mutates.
      - `relation` 'same' | 'similar' | 'related' | 'conflicting' | 'new', required
      - `suggested_path` string, nullable
      - `rationale` string
      - `similarity` number, nullable
  - `archived_paths` string[], required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/heirmos/apis/heirmos-api.md) · [All operations](https://skmtc.dev/heirmos/apis/heirmos-api/llms.txt) · [OpenAPI document](https://skmtc.dev/heirmos/apis/heirmos-api/revisions/ed490b1866e7?raw)
