> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memloom.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Run the consolidation pass (NDJSON stream)

> The same run, reported as it goes. NDJSON: one `{"type":"item"}` per belief checked, a
`{"type":"ping"}` every 15 seconds so the pipe never times out, and a final
`{"type":"done"}` carrying the report. A mid-stream failure arrives as
`{"type":"error"}`, since the response has already started.

**Disconnecting stops the run**, so nothing more is spent. Every belief already checked
stays checked. The first event names the run id.




## OpenAPI

````yaml /openapi.yaml post /memory/reconcile/stream
openapi: 3.1.0
info:
  title: memloom local API
  version: 0.1.0
  description: >
    The HTTP API served by the `memloom serve` daemon on your machine. The CLI,
    the MCP server,

    and the viewer all route through this API. The daemon is the single owner of
    the store, so

    every client shares one consistent view of your memories.


    No authentication: the daemon binds to `127.0.0.1` only and is reachable
    solely from your

    own machine. Browser clients on other localhost ports are allowed via CORS.
servers:
  - url: http://127.0.0.1:4319
    description: Local memloom daemon
security: []
paths:
  /memory/reconcile/stream:
    post:
      summary: Run the consolidation pass (NDJSON stream)
      description: >
        The same run, reported as it goes. NDJSON: one `{"type":"item"}` per
        belief checked, a

        `{"type":"ping"}` every 15 seconds so the pipe never times out, and a
        final

        `{"type":"done"}` carrying the report. A mid-stream failure arrives as

        `{"type":"error"}`, since the response has already started.


        **Disconnecting stops the run**, so nothing more is spent. Every belief
        already checked

        stays checked. The first event names the run id.
      operationId: reconcileStream
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReconcileInput'
      responses:
        '200':
          description: NDJSON progress stream ending with a done (or error) event.
          content:
            application/x-ndjson:
              schema:
                type: string
                example: >
                  {"type":"item","runId":"0f2c7b18","pass":"llm_recheck","checked":1,"total":200,"found":0}

                  {"type":"item","runId":"0f2c7b18","pass":"llm_recheck","checked":2,"total":200,"found":1}

                  {"type":"done","run":{"id":"0f2c7b18","mode":"apply","status":"success"},"actions":[]}
        '400':
          $ref: '#/components/responses/ValidationError'
        '403':
          description: '`RECONCILE_ENABLED=0` is set on the daemon and `mode` is `apply`.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: >-
                      reconciliation is set to report only
                      (RECONCILE_ENABLED=0).
components:
  schemas:
    ReconcileInput:
      type: object
      description: What to run. Every field is optional.
      properties:
        mode:
          type: string
          enum:
            - dry_run
            - apply
          default: dry_run
          description: >-
            `dry_run` reports and changes nothing, and never calls a model.
            `apply` acts.
        trigger:
          type: string
          enum:
            - manual
            - idle
            - startup
          default: manual
          description: Recorded on the run, so the history says who started it.
        passes:
          type: array
          description: >-
            Run exactly these passes, ignoring the saved settings. Omit to use
            the settings, which is what every shipped surface does. This
            overrides the settings for the three paid passes too, so a caller
            can start a run that spends money while the Settings toggles are
            off. `RECONCILE_ENABLED=0` still refuses it.
          items:
            type: string
            enum:
              - invariants
              - entities
              - llm_entities
              - llm_conflicts
              - llm_recheck
        budgetUsd:
          type: number
          exclusiveMinimum: 0
          maximum: 50
          description: >-
            Keep re-checking past the per-run ceiling until nothing is due or
            this much has been billed, measured against the provider's own
            reported cost. Omit for one page and stop, which is the default.
            Capped at 50 because a typo here spends real money.
  responses:
    ValidationError:
      description: The request body failed validation. `issues` names each offending field.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: invalid request body
              issues:
                type: array
                items:
                  type: object
                  properties:
                    path:
                      type: string
                      example: query
                    message:
                      type: string
                      example: query must be a non-empty string

````