> ## 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.

# One assistant turn (SSE)

> Run one chat turn through the assistant's agentic loop: the model decides whether to
call hybrid recall (up to three times), then streams a grounded answer with `[n]`
citation markers validated against the returned sources. The response is a
server-sent-event stream of JSON events: `tool_call` and `tool_result` while the
model searches, `delta` per answer fragment, then one terminal `done` (sessionId,
messageId, answer, sources) or `error`.

Omit `sessionId` to start a new chat (titled from this message). `model` overrides
the configured chat model for this turn only; it must support tool calling on
OpenRouter. Requires a chat-capable LLM: offline mode answers 503 with a setup hint.




## OpenAPI

````yaml /openapi.yaml post /assistant/chat
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:
  /assistant/chat:
    post:
      summary: One assistant turn (SSE)
      description: >
        Run one chat turn through the assistant's agentic loop: the model
        decides whether to

        call hybrid recall (up to three times), then streams a grounded answer
        with `[n]`

        citation markers validated against the returned sources. The response is
        a

        server-sent-event stream of JSON events: `tool_call` and `tool_result`
        while the

        model searches, `delta` per answer fragment, then one terminal `done`
        (sessionId,

        messageId, answer, sources) or `error`.


        Omit `sessionId` to start a new chat (titled from this message). `model`
        overrides

        the configured chat model for this turn only; it must support tool
        calling on

        OpenRouter. Requires a chat-capable LLM: offline mode answers 503 with a
        setup hint.
      operationId: assistantChat
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  example: what are my plans for today?
                sessionId:
                  type: string
                  format: uuid
                  description: Continue an existing chat; omit to create one.
                model:
                  type: string
                  description: Per-turn OpenRouter model override (see /assistant/models).
                  example: anthropic/claude-sonnet-5
      responses:
        '200':
          description: The SSE event stream for this turn.
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/ValidationError'
        '503':
          description: No chat-capable LLM configured (offline mode).
components:
  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

````