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

# Search for similar proteins using SAE feature vectors

> Submit an amino acid sequence and find similar proteins in the atlas based on SAE feature vector similarity.



## OpenAPI

````yaml openapi/metagenomic-atlas-openapi.json GET /esm/protein/api/v1alpha1/similarity-search
openapi: 3.1.0
info:
  title: ESM Atlas API Reference
  description: Interfaces may change without notice.
  version: 0.1.0
servers:
  - url: https://biohub.ai
security: []
paths:
  /esm/protein/api/v1alpha1/similarity-search:
    get:
      tags:
        - Similarity search
      summary: Search for similar proteins using SAE feature vectors
      description: >-
        Submit an amino acid sequence and find similar proteins in the atlas
        based on SAE feature vector similarity.
      operationId: sae_search_v2_esm_protein_api_v1alpha1_similarity_search_get
      parameters:
        - name: sequence
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 2048
            description: Amino acid sequence
            title: Sequence
          description: Amino acid sequence
        - name: topk_results
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            exclusiveMinimum: 0
            description: Number of similar proteins to return
            default: 10
            title: Topk Results
          description: Number of similar proteins to return
        - name: topk_features
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            exclusiveMinimum: 0
            description: Number of top features to return
            default: 20
            title: Topk Features
          description: Number of top features to return
        - name: min_similarity
          in: query
          required: false
          schema:
            type: number
            maximum: 1
            minimum: 0
            description: >-
              Minimum similarity score; results below this threshold are
              excluded
            default: 0.5
            title: Min Similarity
          description: Minimum similarity score; results below this threshold are excluded
        - name: cluster_pct_characterized_max
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 100
                minimum: 0
              - type: 'null'
            description: >-
              If set, only return hits whose cluster_pct_characterized is <=
              this value. Use 0 to find clusters whose members have no
              characterized Pfam annotations (proxy for uncharacterized /
              novel).
            title: Cluster Pct Characterized Max
          description: >-
            If set, only return hits whose cluster_pct_characterized is <= this
            value. Use 0 to find clusters whose members have no characterized
            Pfam annotations (proxy for uncharacterized / novel).
        - name: include_cluster_info
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, each result includes the representative protein's
              cluster_size and human-readable protein_name, sparing the caller a
              follow-up /clusters/{hash} request per result.
            default: false
            title: Include Cluster Info
          description: >-
            If true, each result includes the representative protein's
            cluster_size and human-readable protein_name, sparing the caller a
            follow-up /clusters/{hash} request per result.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SAESearchResponseV2'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SAESearchResponseV2:
      properties:
        query_sequence:
          type: string
          title: Query Sequence
          description: Normalized query amino acid sequence
        protein_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Protein Hash
          description: >-
            MD5 hash of the query sequence; present only when the protein exists
            in the atlas
        similar_proteins:
          items:
            $ref: '#/components/schemas/SimilarProtein'
          type: array
          title: Similar Proteins
          description: List of similar proteins
        top_features_across_results:
          items:
            $ref: '#/components/schemas/TopFeatureAcrossResultsV2'
          type: array
          title: Top Features Across Results
          description: Top SAE features commonly activated across similar proteins
          default: []
        restricted_count:
          type: integer
          title: Restricted Count
          description: >-
            Number of proteins removed from results that are similar to the deny
            list proteins
          default: 0
      type: object
      required:
        - query_sequence
        - similar_proteins
      title: SAESearchResponseV2
      description: Response schema for V2 SAE search endpoint.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SimilarProtein:
      properties:
        protein_hash:
          type: string
          title: Protein Hash
          description: MD5 hash of the protein sequence
        protein_accession:
          type: string
          title: Protein Accession
          description: Source-prefixed protein accession (e.g., 'uniprotkb:P12345')
        sequence_length:
          type: integer
          title: Sequence Length
          description: Length of the protein sequence
        similarity_score:
          type: number
          title: Similarity Score
          description: Cosine similarity score (0-1, higher is more similar)
        pdb:
          anyOf:
            - type: string
            - type: 'null'
          title: Pdb
          description: PDB structure string if pre-computed
        ptm:
          anyOf:
            - type: number
            - type: 'null'
          title: Ptm
          description: pTM confidence score
        mean_plddt:
          anyOf:
            - type: number
            - type: 'null'
          title: Mean Plddt
          description: Mean pLDDT confidence score
        residues_plddt:
          anyOf:
            - items:
                type: number
              type: array
            - type: 'null'
          title: Residues Plddt
          description: Per-residue pLDDT scores
        cluster_size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cluster Size
          description: >-
            Number of proteins in this representative's cluster. Populated only
            when the request was made with include_cluster_info=true; null
            otherwise.
        protein_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Protein Name
          description: >-
            Human-readable cluster name (representative product_name). Populated
            only when the request was made with include_cluster_info=true.
      type: object
      required:
        - protein_hash
        - protein_accession
        - sequence_length
        - similarity_score
      title: SimilarProtein
      description: A similar protein returned by SAE vector search.
    TopFeatureAcrossResultsV2:
      properties:
        feature_index:
          type: integer
          title: Feature Index
          description: SAE feature index (0-16383)
        occurrence_count:
          type: integer
          title: Occurrence Count
          description: Number of proteins with this feature activated
        min_activation:
          type: number
          title: Min Activation
          description: Minimum activation value for this feature across result proteins
        max_activation:
          type: number
          title: Max Activation
          description: Maximum activation value for this feature across result proteins
        mean_activation:
          type: number
          title: Mean Activation
          description: Mean activation value for this feature across result proteins
      type: object
      required:
        - feature_index
        - occurrence_count
        - min_activation
        - max_activation
        - mean_activation
      title: TopFeatureAcrossResultsV2
      description: >-
        Statistics for a feature commonly activated across similar search
        results.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````