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

# Get adjacent chunks for neighbor expansion (Phase 5)

> Return the adjacent chunks (±window) from the same document as chunk_id.

Used for neighbor expansion in Phase 5 semantic retrieval: when a retrieved
chunk has ``is_partial=True`` in its payload (set at index time), the
assembler calls this endpoint to fetch surrounding context and enrich the
evidence list.

Requires the Qdrant collection to store ``position``, ``document_id`` and
``is_partial`` fields in each chunk payload.



## OpenAPI

````yaml /api-reference/knowledge-api.json get /v1/knowledge/chunks/{chunk_id}/neighbors
openapi: 3.1.0
info:
  title: Strattum Knowledge API
  description: >-
    REST API that serves semantic document search — embeddings via the
    configured LLM provider, indexed in Qdrant, with metadata stored in
    PostgreSQL. (PRD-004, Workstream 1.4)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/knowledge/chunks/{chunk_id}/neighbors:
    get:
      tags:
        - knowledge
      summary: Get adjacent chunks for neighbor expansion (Phase 5)
      description: >-
        Return the adjacent chunks (±window) from the same document as chunk_id.


        Used for neighbor expansion in Phase 5 semantic retrieval: when a
        retrieved

        chunk has ``is_partial=True`` in its payload (set at index time), the

        assembler calls this endpoint to fetch surrounding context and enrich
        the

        evidence list.


        Requires the Qdrant collection to store ``position``, ``document_id``
        and

        ``is_partial`` fields in each chunk payload.
      operationId: get_chunk_neighbors_v1_knowledge_chunks__chunk_id__neighbors_get
      parameters:
        - name: chunk_id
          in: path
          required: true
          schema:
            type: string
            title: Chunk Id
        - name: window
          in: query
          required: false
          schema:
            type: integer
            maximum: 3
            minimum: 1
            description: Number of adjacent chunks on each side
            default: 1
            title: Window
          description: Number of adjacent chunks on each side
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Get Chunk Neighbors V1 Knowledge Chunks  Chunk Id 
                  Neighbors Get
        '404':
          description: Chunk not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Qdrant is unavailable
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````