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

# Get context

> Retrieve the knowledge and rubric content that failures reference



## OpenAPI

````yaml GET /api/dataframer/context/
openapi: 3.0.0
info:
  title: DataFramer API
  version: 0.1.0
  description: ''
  termsOfService: https://www.aimon.ai/docs/privacy-policy.pdf
  contact:
    name: DataFramer Support
    email: info@dataframer.ai
  license:
    name: Proprietary
  x-logo:
    url: https://dataframer.ai/logo.png
    altText: DataFramer AI
  x-stainless:
    package-name: aimon-dataframer
    namespace:
      - aimon
      - dataframer
servers:
  - url: https://df-api.dataframer.ai
    description: Production server
security:
  - BearerAuth: []
externalDocs:
  description: Complete API Guide
  url: https://docs.dataframer.ai/dataframer
paths:
  /api/dataframer/context/:
    get:
      summary: Get context
      description: >-
        Retrieve the grounding context failures reference: knowledge distilled
        from your expert reviews, and the content of the rubrics your failures
        were graded against.
      operationId: api_dataframer_context_retrieve
      parameters:
        - name: project_id
          in: query
          required: false
          description: >-
            Narrow the rubrics to one connected observability platform's
            failures. It narrows only the rubrics — knowledge stays
            workspace-wide by design, so a project with no rubrics of its own
            returns knowledge and an empty rubrics list
          schema:
            type: string
            format: uuid
        - name: rubric_id
          in: query
          required: false
          description: >-
            Serve only this rubric, with every example included and no size
            budget. Ignores `project_id`, and the response carries `rubrics`
            alone — no `knowledge` key, since naming a rubric says what is
            wanted
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Workspace knowledge and rubric content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponse'
        '400':
          description: Bad request - validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                bad_uuid:
                  value:
                    error: 'Invalid rubric_id format: "abc" is not a valid UUID'
        '401':
          description: Unauthorized
        '404':
          description: Rubric not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                not_found:
                  value:
                    error: Rubric not found
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from dataframer import Dataframer

            client = Dataframer(
                api_key=os.environ.get("DATAFRAMER_API_KEY"),  # This is the default and can be omitted
            )
            context = client.dataframer.context.retrieve()
            print(context.knowledge)
        - lang: cURL
          source: |-
            curl https://df-api.dataframer.ai/api/dataframer/context/ \
                -H "Authorization: Bearer $DATAFRAMER_API_KEY"
components:
  schemas:
    ContextResponse:
      type: object
      properties:
        knowledge:
          allOf:
            - $ref: '#/components/schemas/ContextKnowledge'
          description: >-
            Knowledge distilled from your expert reviews. Always the whole
            workspace, never narrowed by `project_id`: policy, terminology and
            domain facts are meant to carry across projects. Absent entirely
            when `rubric_id` is given
        rubric_count:
          type: integer
          description: >-
            Rubrics your failures were graded against. When it exceeds the
            length of `rubrics`, that list is a trimmed view
        rubrics:
          type: array
          items:
            $ref: '#/components/schemas/ContextRubric'
          description: Those rubrics by name, each at its current version
    ContextKnowledge:
      type: object
      description: Distilled knowledge for the whole workspace, never scoped to one project
      properties:
        facts:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/KnowledgeFact'
          description: >-
            Facts, newest first, and a sample rather than the whole set —
            compare against `total`
        total:
          type: integer
          description: >-
            Facts that exist, before the newest-first trim — the true total
            behind the `facts` sample
    ContextRubric:
      type: object
      description: One rubric's current content
      properties:
        id:
          type: string
          format: uuid
          description: Referenced by `rubrics[].id` on failures
        name:
          type: string
          description: Name of the rubric
        project:
          allOf:
            - $ref: '#/components/schemas/FailureProject'
          description: The project the rubric belongs to
        version:
          type: integer
          description: Version number served
        description:
          type: string
          description: Description of the rubric
        instructions:
          type: string
          description: The team's grading guidance
        dimensions:
          type: array
          items:
            $ref: '#/components/schemas/ContextRubricDimension'
          description: Scoring axes of the rubric
        examples_omitted:
          type: integer
          description: >-
            Examples left out of this response. Re-request this rubric with the
            `rubric_id` query parameter to get all of them
    KnowledgeFact:
      type: object
      description: One claim about your domain, distilled by an LLM from an expert review
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          example: policy_rule
          description: What sort of claim this is
        text:
          type: string
          description: The claim itself
        grounding:
          type: string
          description: Excerpts from the source trace that support the claim
        tags:
          type: array
          items:
            type: string
          description: Tags on the fact
        confidence:
          type: number
          minimum: 0
          maximum: 1
          description: Confidence in the claim
        created_at:
          type: string
          format: date-time
          description: When the fact was distilled
        source:
          type: object
          nullable: true
          description: The trace the fact came from (null if it no longer resolves)
          properties:
            source_id:
              type: string
              description: The trace's ID in your observability platform
            source_url:
              type: string
              format: uri
              nullable: true
              description: Deep link to the trace (null if no link can be built)
    FailureProject:
      type: object
      description: The project a failure's traces come from
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          description: Name of the project in DataFramer
        platform:
          type: string
          enum:
            - langfuse
            - langsmith
          description: Observability platform the traces are pulled from
    ContextRubricDimension:
      type: object
      description: One scoring axis of a rubric
      properties:
        name:
          type: string
          description: Name of the dimension
        scoring_model:
          type: string
          enum:
            - pass_fail
            - scale_1_5
            - single_select
            - checklist
          description: How the dimension is scored
        required:
          type: boolean
          description: Whether reviewers must grade this dimension
        levels:
          type: array
          description: The choosable verdicts for this dimension
          items:
            type: object
            properties:
              label:
                type: string
                description: Label shown to reviewers
              description:
                type: string
                nullable: true
                description: Guidance for the level (null if none)
              value:
                type: number
                nullable: true
                description: Numeric value for scale levels (null for other scoring models)
        positive_examples:
          type: array
          items:
            $ref: '#/components/schemas/RubricExample'
          description: Examples of a pass (pass/fail and scale dimensions)
        negative_examples:
          type: array
          items:
            $ref: '#/components/schemas/RubricExample'
          description: Examples of a fail (pass/fail and scale dimensions)
        examples:
          type: array
          items:
            $ref: '#/components/schemas/RubricExample'
          description: >-
            Neutral calibration examples (checklist and single-select
            dimensions)
    RubricExample:
      type: object
      description: One calibration example from a reviewed trace
      properties:
        query:
          type: string
          description: The example trace's input
        answer:
          type: string
          description: The example trace's output
        source_id:
          type: string
          nullable: true
          description: >-
            The trace's ID in your observability platform (null if it no longer
            resolves)
        source_url:
          type: string
          format: uri
          nullable: true
          description: Deep link to the trace (null if no link can be built)
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'API Key authentication. Format: "Bearer YOUR_API_KEY"'

````

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