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

# Get Paragraph Context

> Returns the target paragraph along with N paragraphs before and after it (ordered by sort_id).
Useful for AI agents doing RAG that need surrounding context for better understanding.
The `window` query parameter controls how many paragraphs before/after to include (default: 2, max: 10).

Use `?include=entities` to include typed entity mentions in the response.



## OpenAPI

````yaml GET /paragraphs/{ref}/context
openapi: 3.1.0
info:
  title: Urantia Papers API
  version: 1.0.0
  description: >-
    A developer and AI-agent friendly API for the Urantia Papers. Provides
    full-text search, structured content access, and audio URLs for all 17,000+
    paragraphs across 197 papers.
servers:
  - url: https://api.urantia.dev
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
paths:
  /paragraphs/{ref}/context:
    get:
      tags:
        - Paragraphs
      summary: Get a paragraph with surrounding context
      description: >-
        Returns the target paragraph along with N paragraphs before and after it
        (ordered by sort_id).

        Useful for AI agents doing RAG that need surrounding context for better
        understanding.

        The `window` query parameter controls how many paragraphs before/after
        to include (default: 2, max: 10).


        Use `?include=entities` to include typed entity mentions in the
        response.
      operationId: getParagraphContext
      parameters:
        - schema:
            type: string
          required: true
          name: ref
          in: path
        - schema:
            type: integer
            minimum: 1
            maximum: 10
            default: 2
          required: false
          name: window
          in: query
        - schema:
            type: string
          required: false
          name: include
          in: query
        - schema:
            type: string
            enum:
              - default
              - rag
            default: default
          required: false
          name: format
          in: query
        - schema:
            type: string
            enum:
              - eng
              - es
              - fr
              - pt
              - de
              - ko
            default: eng
          required: false
          name: lang
          in: query
      responses:
        '200':
          description: Paragraph with context
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      target:
                        type: object
                        properties:
                          id:
                            type: string
                          standardReferenceId:
                            type: string
                          sortId:
                            type: string
                          paperId:
                            type: string
                          sectionId:
                            type: string
                            nullable: true
                          partId:
                            type: string
                          paperTitle:
                            type: string
                          sectionTitle:
                            type: string
                            nullable: true
                          paragraphId:
                            type: string
                          text:
                            type: string
                          htmlText:
                            type: string
                          language:
                            type: string
                          labels:
                            type: array
                            nullable: true
                            items:
                              type: string
                          audio:
                            type: object
                            nullable: true
                            additionalProperties:
                              type: object
                              additionalProperties:
                                type: object
                                properties:
                                  format:
                                    type: string
                                  url:
                                    type: string
                                  duration:
                                    type: number
                                  bitrate:
                                    type: number
                                  fileSize:
                                    type: number
                                required:
                                  - format
                                  - url
                          entities:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                name:
                                  type: string
                                type:
                                  type: string
                                  enum:
                                    - being
                                    - place
                                    - order
                                    - race
                                    - religion
                                    - concept
                              required:
                                - id
                                - name
                                - type
                          bibleParallels:
                            type: array
                            items:
                              type: object
                              properties:
                                chunkId:
                                  type: string
                                reference:
                                  type: string
                                bookCode:
                                  type: string
                                chapter:
                                  type: integer
                                verseStart:
                                  type: integer
                                verseEnd:
                                  type: integer
                                text:
                                  type: string
                                similarity:
                                  type: number
                                rank:
                                  type: integer
                                source:
                                  type: string
                                embeddingModel:
                                  type: string
                              required:
                                - chunkId
                                - reference
                                - bookCode
                                - chapter
                                - verseStart
                                - verseEnd
                                - text
                                - similarity
                                - rank
                                - source
                                - embeddingModel
                          urantiaParallels:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                standardReferenceId:
                                  type: string
                                paperId:
                                  type: string
                                paperTitle:
                                  type: string
                                sectionTitle:
                                  type: string
                                  nullable: true
                                text:
                                  type: string
                                similarity:
                                  type: number
                                rank:
                                  type: integer
                                source:
                                  type: string
                                embeddingModel:
                                  type: string
                              required:
                                - id
                                - standardReferenceId
                                - paperId
                                - paperTitle
                                - sectionTitle
                                - text
                                - similarity
                                - rank
                                - source
                                - embeddingModel
                        required:
                          - id
                          - standardReferenceId
                          - sortId
                          - paperId
                          - sectionId
                          - partId
                          - paperTitle
                          - sectionTitle
                          - paragraphId
                          - text
                          - htmlText
                          - labels
                          - audio
                      before:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            standardReferenceId:
                              type: string
                            sortId:
                              type: string
                            paperId:
                              type: string
                            sectionId:
                              type: string
                              nullable: true
                            partId:
                              type: string
                            paperTitle:
                              type: string
                            sectionTitle:
                              type: string
                              nullable: true
                            paragraphId:
                              type: string
                            text:
                              type: string
                            htmlText:
                              type: string
                            language:
                              type: string
                            labels:
                              type: array
                              nullable: true
                              items:
                                type: string
                            audio:
                              type: object
                              nullable: true
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: object
                                  properties:
                                    format:
                                      type: string
                                    url:
                                      type: string
                                    duration:
                                      type: number
                                    bitrate:
                                      type: number
                                    fileSize:
                                      type: number
                                  required:
                                    - format
                                    - url
                            entities:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                      - being
                                      - place
                                      - order
                                      - race
                                      - religion
                                      - concept
                                required:
                                  - id
                                  - name
                                  - type
                            bibleParallels:
                              type: array
                              items:
                                type: object
                                properties:
                                  chunkId:
                                    type: string
                                  reference:
                                    type: string
                                  bookCode:
                                    type: string
                                  chapter:
                                    type: integer
                                  verseStart:
                                    type: integer
                                  verseEnd:
                                    type: integer
                                  text:
                                    type: string
                                  similarity:
                                    type: number
                                  rank:
                                    type: integer
                                  source:
                                    type: string
                                  embeddingModel:
                                    type: string
                                required:
                                  - chunkId
                                  - reference
                                  - bookCode
                                  - chapter
                                  - verseStart
                                  - verseEnd
                                  - text
                                  - similarity
                                  - rank
                                  - source
                                  - embeddingModel
                            urantiaParallels:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  standardReferenceId:
                                    type: string
                                  paperId:
                                    type: string
                                  paperTitle:
                                    type: string
                                  sectionTitle:
                                    type: string
                                    nullable: true
                                  text:
                                    type: string
                                  similarity:
                                    type: number
                                  rank:
                                    type: integer
                                  source:
                                    type: string
                                  embeddingModel:
                                    type: string
                                required:
                                  - id
                                  - standardReferenceId
                                  - paperId
                                  - paperTitle
                                  - sectionTitle
                                  - text
                                  - similarity
                                  - rank
                                  - source
                                  - embeddingModel
                          required:
                            - id
                            - standardReferenceId
                            - sortId
                            - paperId
                            - sectionId
                            - partId
                            - paperTitle
                            - sectionTitle
                            - paragraphId
                            - text
                            - htmlText
                            - labels
                            - audio
                      after:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            standardReferenceId:
                              type: string
                            sortId:
                              type: string
                            paperId:
                              type: string
                            sectionId:
                              type: string
                              nullable: true
                            partId:
                              type: string
                            paperTitle:
                              type: string
                            sectionTitle:
                              type: string
                              nullable: true
                            paragraphId:
                              type: string
                            text:
                              type: string
                            htmlText:
                              type: string
                            language:
                              type: string
                            labels:
                              type: array
                              nullable: true
                              items:
                                type: string
                            audio:
                              type: object
                              nullable: true
                              additionalProperties:
                                type: object
                                additionalProperties:
                                  type: object
                                  properties:
                                    format:
                                      type: string
                                    url:
                                      type: string
                                    duration:
                                      type: number
                                    bitrate:
                                      type: number
                                    fileSize:
                                      type: number
                                  required:
                                    - format
                                    - url
                            entities:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    type: string
                                    enum:
                                      - being
                                      - place
                                      - order
                                      - race
                                      - religion
                                      - concept
                                required:
                                  - id
                                  - name
                                  - type
                            bibleParallels:
                              type: array
                              items:
                                type: object
                                properties:
                                  chunkId:
                                    type: string
                                  reference:
                                    type: string
                                  bookCode:
                                    type: string
                                  chapter:
                                    type: integer
                                  verseStart:
                                    type: integer
                                  verseEnd:
                                    type: integer
                                  text:
                                    type: string
                                  similarity:
                                    type: number
                                  rank:
                                    type: integer
                                  source:
                                    type: string
                                  embeddingModel:
                                    type: string
                                required:
                                  - chunkId
                                  - reference
                                  - bookCode
                                  - chapter
                                  - verseStart
                                  - verseEnd
                                  - text
                                  - similarity
                                  - rank
                                  - source
                                  - embeddingModel
                            urantiaParallels:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  standardReferenceId:
                                    type: string
                                  paperId:
                                    type: string
                                  paperTitle:
                                    type: string
                                  sectionTitle:
                                    type: string
                                    nullable: true
                                  text:
                                    type: string
                                  similarity:
                                    type: number
                                  rank:
                                    type: integer
                                  source:
                                    type: string
                                  embeddingModel:
                                    type: string
                                required:
                                  - id
                                  - standardReferenceId
                                  - paperId
                                  - paperTitle
                                  - sectionTitle
                                  - text
                                  - similarity
                                  - rank
                                  - source
                                  - embeddingModel
                          required:
                            - id
                            - standardReferenceId
                            - sortId
                            - paperId
                            - sectionId
                            - partId
                            - paperTitle
                            - sectionTitle
                            - paragraphId
                            - text
                            - htmlText
                            - labels
                            - audio
                    required:
                      - target
                      - before
                      - after
                required:
                  - data
        '400':
          description: Invalid reference format
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                  detail:
                    type: string
                required:
                  - type
                  - title
                  - status
                  - detail
        '404':
          description: Paragraph not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                  detail:
                    type: string
                required:
                  - type
                  - title
                  - status
                  - detail
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  title:
                    type: string
                  status:
                    type: integer
                  detail:
                    type: string
                required:
                  - type
                  - title
                  - status
                  - detail

````