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

# Evaluate an answer

> Evaluate the correctness and completeness of a response from an assistant or a RAG system. The correctness and completeness are evaluated based on the precision and recall of the generated answer with respect to the ground truth answer facts. Alignment is the harmonic mean of correctness and completeness.

For guidance and examples, see [Evaluate answers](https://docs.pinecone.io/guides/assistant/evaluate-answers).

<RequestExample>
  ```bash curl theme={null}
  PINECONE_API_KEY="YOUR_API_KEY"

  curl https://prod-1-data.ke.pinecone.io/assistant/evaluation/metrics/alignment \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-Api-Version: 2025-10" \
    -d '{
      "question": "What are the capital cities of France, England and Spain?",
      "answer": "Paris is the capital city of France and Barcelona of Spain",
      "ground_truth_answer": "Paris is the capital city of France, London of England and Madrid of Spain"
  }'
  ```
</RequestExample>


## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2025-10/assistant_evaluation_2025-10.oas.yaml POST /evaluation/metrics/alignment
openapi: 3.0.3
info:
  title: Evaluation API
  description: Provides endpoints for evaluating RAG systems using various metrics.
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 2025-10
servers:
  - url: https://prod-1-data.ke.pinecone.io/assistant
    description: Evaluation US Production API endpoints
  - url: https://prod-eu-data.ke.pinecone.io/assistant
    description: Evaluation EU Production API endpoints
security:
  - ApiKeyAuth: []
tags:
  - name: Metrics
    description: Operations related to evaluation metrics calculation
externalDocs:
  description: More Pinecone.io API docs
  url: https://docs.pinecone.io/introduction
paths:
  /evaluation/metrics/alignment:
    post:
      tags:
        - Metrics
      summary: Evaluate an answer
      description: >-
        Evaluate the correctness and completeness of a response from an
        assistant or a RAG system. The correctness and completeness are
        evaluated based on the precision and recall of the generated answer with
        respect to the ground truth answer facts. Alignment is the harmonic mean
        of correctness and completeness.


        For guidance and examples, see [Evaluate
        answers](https://docs.pinecone.io/guides/assistant/evaluate-answers).
      operationId: metrics_alignment
      parameters:
        - in: header
          name: X-Pinecone-Api-Version
          description: Required date-based version header
          required: true
          schema:
            default: 2025-10
            type: string
          style: simple
      requestBody:
        description: The request body for the alignment evaluation.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlignmentRequest'
        required: true
      responses:
        '200':
          description: The evaluation metrics and reasoning for the generated answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlignmentResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
components:
  schemas:
    AlignmentRequest:
      title: AlignmentRequest
      description: The request for the alignment evaluation.
      type: object
      properties:
        question:
          example: What is the capital city of Spain?
          title: Question
          description: The question for which the answer was generated.
          type: string
        answer:
          example: Barcelona.
          title: Answer
          description: The generated answer.
          type: string
        ground_truth_answer:
          example: Madrid.
          title: Ground Truth Answer
          description: The ground truth answer to the question.
          type: string
      required:
        - question
        - answer
        - ground_truth_answer
      additionalProperties: false
    AlignmentResponse:
      title: AlignmentResponse
      description: The response for the alignment evaluation.
      type: object
      properties:
        metrics:
          $ref: '#/components/schemas/Metrics'
        reasoning:
          $ref: '#/components/schemas/Reasoning'
        usage:
          $ref: '#/components/schemas/TokenCounts'
      required:
        - metrics
        - reasoning
        - usage
      additionalProperties: false
    BasicErrorResponse:
      title: BasicErrorResponse
      description: A basic error response that contains a message.
      type: object
      properties:
        message:
          title: Message
          type: string
      required:
        - message
    Metrics:
      title: Metrics
      description: The metrics returned for the alignment evaluation.
      type: object
      properties:
        correctness:
          title: Correctness
          description: The precision of the generated answer.
          type: number
        completeness:
          title: Completeness
          description: The recall of the generated answer.
          type: number
        alignment:
          title: Alignment
          description: The harmonic mean of correctness and completeness.
          type: number
      required:
        - correctness
        - completeness
        - alignment
      additionalProperties: false
    Reasoning:
      title: Reasoning
      description: The reasoning behind the alignment evaluation.
      type: object
      properties:
        evaluated_facts:
          title: Evaluated Facts
          description: The facts that were evaluated.
          type: array
          items:
            $ref: '#/components/schemas/EvaluatedFact'
      required:
        - evaluated_facts
      additionalProperties: false
    TokenCounts:
      title: TokenCounts
      description: Token counts for the input prompt and completion.
      type: object
      properties:
        prompt_tokens:
          title: Prompt Tokens
          type: integer
        completion_tokens:
          title: Completion Tokens
          type: integer
        total_tokens:
          title: Total Tokens
          type: integer
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
    EvaluatedFact:
      title: EvaluatedFact
      description: A fact that was evaluated.
      type: object
      properties:
        fact:
          $ref: '#/components/schemas/Fact'
        entailment:
          $ref: '#/components/schemas/Entailment'
      required:
        - fact
        - entailment
      additionalProperties: false
    Fact:
      title: Fact
      description: A fact
      type: object
      properties:
        content:
          title: Content
          description: The content of the fact.
          type: string
      required:
        - content
      additionalProperties: false
    Entailment:
      title: Entailment
      description: The entailment of a fact.
      x-enum:
        - entailed
        - contradicted
        - neutral
      type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: >-
        An API Key is required to call Pinecone APIs. Get yours from the
        [console](https://app.pinecone.io/).

````