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

# Ask

> Ask a natural language question about a project and get an AI-generated answer with source citations.

Ask answers "what does this project say about X?" by searching across all project content (blocks, features, files), then generating a concise answer grounded in the retrieved context.

Ask is **synchronous** and returns results immediately (not an async job).

## How It Works

1. Your question is used to run a hybrid search (semantic + keyword) across the project
2. The top results are assembled into a context window
3. An LLM generates a 2-4 sentence answer citing the source material
4. Up to 5 source references are returned with relevance scores

## Example Questions

| Question                                                | What it finds                                       |
| ------------------------------------------------------- | --------------------------------------------------- |
| "What fire rating is required for the stairwell doors?" | Spec blocks, general notes referencing fire ratings |
| "How many parking spaces are shown?"                    | Site plan blocks with parking counts                |
| "What concrete mix is specified for the foundation?"    | Specification sheets, structural notes              |

## Sources

Each source in the response includes:

| Field         | Description                                             |
| ------------- | ------------------------------------------------------- |
| `source_type` | Type of content matched (`block`, `feature`, or `file`) |
| `source_id`   | ID of the matched entity                                |
| `label`       | Human-readable label (e.g. sheet number, file name)     |
| `score`       | Relevance score (higher is better)                      |


## OpenAPI

````yaml POST /projects/{project_id}/ask
openapi: 3.1.0
info:
  title: Bedrock API
  version: 1.0.0
  description: >-
    REST API for construction document management and computer vision
    intelligence.
  contact:
    name: Bedrock Support
    url: https://bedrock.cv
    email: support@bedrock.cv
servers:
  - url: https://api.bedrock.cv
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /projects/{project_id}/ask:
    post:
      tags:
        - Search
      summary: Ask a question about a project
      description: >-
        Ask a natural language question about a project. Uses hybrid search to
        find relevant context, then generates an answer with source citations.
      operationId: askProject
      parameters:
        - $ref: '#/components/parameters/ApiVersionHeader'
        - name: project_id
          in: path
          required: true
          schema:
            type: string
          description: Project ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AskRequest'
      responses:
        '200':
          description: Generated answer with sources.
          content:
            application/json:
              schema:
                type: object
                properties:
                  answer:
                    type: string
                    description: Generated answer to the question
                  sources:
                    type: array
                    items:
                      type: object
                      properties:
                        source_type:
                          type: string
                          enum:
                            - block
                            - feature
                            - file
                        source_id:
                          type: string
                        label:
                          type: string
                          description: >-
                            Human-readable label for the source (e.g. sheet
                            number, file name)
                        score:
                          type: number
                          description: Relevance score (higher is better)
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    ApiVersionHeader:
      name: X-API-Version
      in: header
      required: false
      schema:
        type: string
        default: '2026-01-01'
      description: API version
  schemas:
    AskRequest:
      type: object
      properties:
        question:
          type: string
      required:
        - question
    ApiError:
      type: object
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
        request_id:
          type: string
        instance:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - type
        - title
        - status
        - detail
      example:
        type: https://docs.bedrock.cv/errors/bad-request
        title: Bad Request
        status: 400
        detail: One or more request fields are invalid.
        instance: /projects
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: https://docs.bedrock.cv/errors/bad-request
            title: Bad Request
            status: 400
            detail: One or more request fields are invalid.
            code: VALIDATION_ERROR
            request_id: req_01JABCD123
            errors:
              project_id:
                - Required field
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: https://docs.bedrock.cv/errors/authentication
            title: Unauthorized
            status: 401
            detail: Invalid or missing API key.
            code: UNAUTHORIZED
            request_id: req_01JABCD123
    RateLimited:
      description: Rate limited
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          example:
            type: https://docs.bedrock.cv/errors/rate-limit
            title: Rate limited
            status: 429
            detail: Rate limit exceeded. Try again in 60 seconds.
            code: RATE_LIMITED
            request_id: req_01JABCD123
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key prefixed with `sk_`. Example: `Authorization: Bearer sk_xxx`'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````