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

# Query vector store

> Interrogate the vector store for information related to a given job_id or namespace.
The job must be completed before querying can be performed.




## OpenAPI

````yaml https://api.askmy.biz/openapi post /query
openapi: 3.0.0
info:
  title: AskMyBiz API
  version: 1.0.0
  license:
    name: Private
    url: https://askmy.biz
  description: >
    API for initiating web crawls, storing content as embeddings, and performing
    vector queries

    for Q&A and structured data extraction.
servers:
  - url: https://api.askmy.biz
security:
  - ApiKeyAuth: []
paths:
  /query:
    post:
      summary: Query vector store
      description: >
        Interrogate the vector store for information related to a given job_id
        or namespace.

        The job must be completed before querying can be performed.
      operationId: queryVectorStore
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequest'
      responses:
        '200':
          description: Query executed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryResponse'
        '400':
          description: Bad request - job not found or not completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    QueryRequest:
      type: object
      properties:
        job_id:
          type: string
          description: >-
            Unique identifier for the crawl job. At least one of job_id or
            namespace must be provided.
          example: vI2wMzZwuf2l1hkYYO_Fb
        namespace:
          type: string
          description: >-
            Namespace identifier, useful to reference a specific crawl using
            your internal identifier. At least one of job_id or namespace must
            be provided.
          example: avamo_fr
        query:
          type: string
          description: The query to execute against the vector store
        schema:
          type: object
          description: >-
            A JSON schema defining the structure of extracted data. Read more
            about it on [OpenAI's Structured Outputs
            documentation](https://platform.openai.com/docs/guides/structured-outputs)
          example:
            type: object
            properties:
              product_categories:
                type: array
                items:
                  type: object
                  properties:
                    product_type:
                      type: string
                    reasoning:
                      type: string
                    source_urls:
                      type: array
                      items:
                        type: string
        prompt:
          type: string
          description: Custom prompt to guide the query processing
        k:
          type: integer
          default: 5
          description: Number of similar vectors to retrieve
    QueryResponse:
      type: object
      properties:
        job_id:
          type: string
        namespace:
          type: string
        query:
          type: string
        answer:
          oneOf:
            - type: object
              additionalProperties: true
              description: >-
                This is a JSON object containing the extracted data based on the
                provided schema.
            - $ref: '#/components/schemas/ValueMetadata'
              type: object
        metadata:
          type: object
          properties:
            processing_time_ms:
              type: integer
    ValueMetadata:
      type: object
      description: Default metadata for extracted values when no schema is provided
      properties:
        value:
          type: string
          description: The extracted value that answers the query
        confidence_score:
          type: number
          minimum: 0
          maximum: 1
          description: >-
            A confidence score between 0 and 1, indicating the confidence of the
            AI in the extracted value
          example: 0.85
        sources:
          type: array
          description: >-
            List of markdown links to the sources that were used to extract the
            value.
          items:
            type: string
            example: '[Source Name](https://example.com)'
        additional_details:
          type: string
          description: The AI reasoning behind the returned value.
          example: >-
            The value 'John Doe' is likely a person's name, and is highly likely
            to be a correct extraction because it appears in multiple pages on
            their website.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````