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

# Get a document's chunks and their entity edges

> One document at chunk granularity: chunks in order, plus their chunk -> entity mention
edges. The graph endpoint rolls these up to one weighted document -> entity edge; this
is the drill-down the viewer fetches when a document node is expanded.




## OpenAPI

````yaml /openapi.yaml get /context/documents/{id}/chunks
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:
  /context/documents/{id}/chunks:
    get:
      summary: Get a document's chunks and their entity edges
      description: >
        One document at chunk granularity: chunks in order, plus their chunk ->
        entity mention

        edges. The graph endpoint rolls these up to one weighted document ->
        entity edge; this

        is the drill-down the viewer fetches when a document node is expanded.
      operationId: getDocumentChunks
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The chunks and edges.
          content:
            application/json:
              schema:
                type: object
                properties:
                  chunks:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        chunkIndex:
                          type: integer
                        content:
                          type: string
                        headingPath:
                          type: string
                          nullable: true
                          example: Runbook > Restarts
                        page:
                          type: integer
                          nullable: true
                          description: 1-based PDF page, when the chunk came from a PDF.
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        from:
                          type: string
                          description: Chunk id.
                        to:
                          type: string
                          description: Entity id.
                        relation:
                          type: string
                          example: mention

````