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

# Search files

> Search the project's File knowledge and return ranked, cited results.

**Operation ID:** `http.files.search`

```http theme={null}
POST /v1/orgs/{org}/projects/{project}/files/search
```


## OpenAPI

````yaml openapi.json POST /v1/orgs/{org}/projects/{project}/files/search
openapi: 3.1.0
info:
  title: Penumbra API
  version: v1
  description: >-
    HTTP reference for Files, search, extraction, reviews, Graph, Shapes and
    sharing.
servers:
  - url: https://api.pnbr.io
    description: Penumbra API
security: []
paths:
  /v1/orgs/{org}/projects/{project}/files/search:
    post:
      tags:
        - Search and citations
      summary: Search files
      description: >-
        Search the project's File knowledge and return ranked, cited results.


        Product guidance: [Search](/concepts/search), [Passage and
        citation](/concepts/passage), [Context](/concepts/context).
      operationId: http.files.search
      parameters:
        - name: org
          in: path
          required: true
          schema:
            type: string
        - name: project
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/http_files_search_request'
      responses:
        2XX:
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http_files_search_response'
      security:
        - bearerAuth: []
components:
  schemas:
    http_files_search_request:
      type: object
      properties:
        query:
          type: string
          maxLength: 8192
        mode:
          default: hybrid
          type: string
          enum:
            - hybrid
            - semantic
            - lexical
        sources:
          default:
            - chunks
          minItems: 1
          maxItems: 2
          type: array
          items:
            type: string
            enum:
              - chunks
              - moments
        group_by:
          default: match
          type: string
          enum:
            - match
            - file
        filters:
          default: {}
          type: object
          properties:
            file_ids:
              default: []
              maxItems: 500
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            collection_ids:
              default: []
              maxItems: 100
              type: array
              items:
                type: string
                format: uuid
                pattern: >-
                  ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
            tags:
              default: []
              maxItems: 100
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 128
            media_types:
              default: []
              maxItems: 100
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 255
                pattern: >-
                  ^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+(?:\s*;.*)?$
          additionalProperties: false
        limit:
          default: 10
          type: integer
          minimum: 1
          maximum: 50
        neighbors:
          default: 0
          type: integer
          minimum: 0
          maximum: 2
        rerank:
          default: auto
          type: string
          enum:
            - auto
            - 'off'
            - required
      required:
        - query
      additionalProperties: false
    http_files_search_response:
      type: object
      properties:
        data:
          type: object
          properties:
            query:
              type: string
            mode_requested:
              type: string
              enum:
                - hybrid
                - semantic
                - lexical
            mode_used:
              type: string
              enum:
                - hybrid
                - semantic
                - lexical
            sources:
              type: array
              items:
                type: string
                enum:
                  - chunks
                  - moments
            group_by:
              type: string
              enum:
                - match
                - file
            ranking:
              type: object
              properties:
                profile:
                  type: string
                base_order:
                  type: string
              required:
                - profile
                - base_order
              additionalProperties: {}
            results:
              type: array
              items:
                type: object
                properties:
                  rank:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  file:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                    required:
                      - id
                      - name
                    additionalProperties: {}
                  version:
                    type: object
                    properties:
                      id:
                        type: string
                      number:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - id
                      - number
                    additionalProperties: {}
                  match:
                    type: object
                    properties:
                      kind:
                        type: string
                      text:
                        type: string
                    required:
                      - kind
                      - text
                    additionalProperties: {}
                  scores:
                    type: object
                    properties:
                      base_rank:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                    required:
                      - base_rank
                    additionalProperties: {}
                  neighbors:
                    type: array
                    items:
                      type: object
                      properties:
                        chunk_id:
                          type: string
                        chunk_index:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        text:
                          type: string
                        location:
                          type: object
                          properties:
                            page:
                              anyOf:
                                - type: integer
                                  minimum: -9007199254740991
                                  maximum: 9007199254740991
                                - type: 'null'
                            section:
                              anyOf:
                                - type: string
                                - type: 'null'
                            start_offset:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            end_offset:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            offset_unit:
                              type: string
                          required:
                            - page
                            - section
                            - start_offset
                            - end_offset
                            - offset_unit
                          additionalProperties: {}
                      required:
                        - chunk_id
                        - chunk_index
                        - text
                        - location
                      additionalProperties: {}
                required:
                  - rank
                  - file
                  - version
                  - match
                  - scores
                  - neighbors
                additionalProperties: {}
            groups:
              type: array
              items:
                type: object
                properties:
                  file:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                    required:
                      - id
                      - name
                    additionalProperties: {}
                  best_rank:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  matches:
                    type: array
                    items:
                      type: object
                      properties:
                        rank:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        file:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                          required:
                            - id
                            - name
                          additionalProperties: {}
                        version:
                          type: object
                          properties:
                            id:
                              type: string
                            number:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - id
                            - number
                          additionalProperties: {}
                        match:
                          type: object
                          properties:
                            kind:
                              type: string
                            text:
                              type: string
                          required:
                            - kind
                            - text
                          additionalProperties: {}
                        scores:
                          type: object
                          properties:
                            base_rank:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - base_rank
                          additionalProperties: {}
                        neighbors:
                          type: array
                          items:
                            type: object
                            properties:
                              chunk_id:
                                type: string
                              chunk_index:
                                type: integer
                                minimum: -9007199254740991
                                maximum: 9007199254740991
                              text:
                                type: string
                              location:
                                type: object
                                properties:
                                  page:
                                    anyOf:
                                      - type: integer
                                        minimum: -9007199254740991
                                        maximum: 9007199254740991
                                      - type: 'null'
                                  section:
                                    anyOf:
                                      - type: string
                                      - type: 'null'
                                  start_offset:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  end_offset:
                                    type: integer
                                    minimum: -9007199254740991
                                    maximum: 9007199254740991
                                  offset_unit:
                                    type: string
                                required:
                                  - page
                                  - section
                                  - start_offset
                                  - end_offset
                                  - offset_unit
                                additionalProperties: {}
                            required:
                              - chunk_id
                              - chunk_index
                              - text
                              - location
                            additionalProperties: {}
                      required:
                        - rank
                        - file
                        - version
                        - match
                        - scores
                        - neighbors
                      additionalProperties: {}
                required:
                  - file
                  - best_rank
                  - matches
                additionalProperties: {}
            candidate_count:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            timing_ms:
              type: object
              properties:
                total:
                  type: number
              required:
                - total
              additionalProperties: {}
            warnings:
              type: array
              items:
                type: object
                properties:
                  code:
                    type: string
                  detail:
                    type: string
                required:
                  - code
                  - detail
                additionalProperties: {}
          required:
            - query
            - mode_requested
            - mode_used
            - sources
            - group_by
            - ranking
            - results
            - groups
            - candidate_count
            - timing_ms
            - warnings
          additionalProperties: {}
      required:
        - data
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.