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

# Distill a note

> A proposed note from a conversation or task, read masked, for a person to approve.



## OpenAPI

````yaml openapi/en/cell.json POST /v1/agent-memory/distill
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/agent-memory/distill:
    post:
      tags:
        - agent-memory
      summary: Distill a note
      description: >-
        Proposes one note from a conversation or task, read already masked; a
        person approves it.


        **Authentication.** Source key with the `agent_memory:write` scope, or a
        Console person token with the `integration` role (or admin).
      operationId: distill_v1_agent_memory_distill_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DistillRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentNoteProposal'
          description: >-
            The proposal, still without text; read `GET
            /v1/agent-memory/proposals` for the result.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    DistillRequest:
      additionalProperties: false
      description: >-
        Asks for a proposed note from one conversation or task, read already
        masked (10, C.5).
      properties:
        conversation_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Conversation Id
        source_id:
          description: The agent whose memory the note would join.
          format: uuid
          title: Source Id
          type: string
        task_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Task Id
      required:
        - source_id
      title: DistillRequest
      type: object
    AgentNoteProposal:
      additionalProperties: false
      properties:
        body:
          title: Body
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        decided_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Decided At
        decided_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Decided By
        evidence:
          anyOf:
            - $ref: '#/components/schemas/Evidence'
            - type: 'null'
        kind:
          $ref: '#/components/schemas/AgentNoteKind'
        note_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          description: The note an approval created.
          title: Note Id
        origin:
          description: >-
            `distilled` from a conversation or task; `agent` when the space
            holds agent writes for a person.
          enum:
            - distilled
            - agent
          title: Origin
          type: string
        problem:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Why a distillation failed: `nothing_to_propose`, `personal_data`,
            `no_turns`, or `unconfirmed_link` (the conversation spoke only
            through a link a claim made and nobody confirmed yet; ask again once
            it is confirmed).
          title: Problem
        proposal_id:
          format: uuid
          title: Proposal Id
          type: string
        source_id:
          format: uuid
          title: Source Id
          type: string
        status:
          $ref: '#/components/schemas/ProposalStatus'
        tags:
          items:
            type: string
          title: Tags
          type: array
        title:
          title: Title
          type: string
        visibility:
          $ref: '#/components/schemas/AgentNoteVisibility'
          default: source
      required:
        - proposal_id
        - source_id
        - origin
        - kind
        - title
        - body
        - status
        - created_at
      title: AgentNoteProposal
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    Evidence:
      additionalProperties: false
      description: >-
        Where the note came from: an id only, never the text of the conversation
        or task.
      properties:
        conversation_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Conversation Id
        task_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: Task Id
      title: Evidence
      type: object
    AgentNoteKind:
      enum:
        - procedure
        - tool_note
        - process_note
        - pitfall
      title: AgentNoteKind
      type: string
    ProposalStatus:
      enum:
        - drafting
        - pending
        - approved
        - rejected
        - failed
      title: ProposalStatus
      type: string
    AgentNoteVisibility:
      enum:
        - source
        - vendor
        - space
      title: AgentNoteVisibility
      type: string
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````