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

> 获取一个知识库

# Get Knowledge



## OpenAPI

````yaml get /v1/knowledge/{knowledge_id}
openapi: 3.1.0
info:
  title: spectra-server
  description: The API for Spectra Backend.
  version: 0.1.0
servers:
  - url: https://api-spectra.duplik.cn
security: []
paths:
  /v1/knowledge/{knowledge_id}:
    get:
      tags:
        - Knowledge
      summary: Get Knowledge
      operationId: get_knowledge_v1_knowledge__knowledge_id__get
      parameters:
        - name: knowledge_id
          in: path
          required: true
          schema:
            type: string
            title: Knowledge Id
        - name: with_settings
          in: query
          required: false
          schema:
            type: boolean
            description: get knowledge with settings
            default: false
            title: With Settings
          description: get knowledge with settings
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/KnowledgeRead'
                  - $ref: '#/components/schemas/KnowledgeWithSettingsRead'
                title: Response Get Knowledge V1 Knowledge  Knowledge Id  Get
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      security:
        - HTTPBearer: []
components:
  schemas:
    KnowledgeRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        name:
          type: string
          maxLength: 128
          title: Name
        description:
          type: string
          maxLength: 512
          title: Description
        icon:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Icon
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        personal:
          anyOf:
            - type: integer
            - type: 'null'
          title: Personal
          description: personal knowledge
          default: false
        knowledge_id:
          type: string
          title: Knowledge Id
        status:
          type: integer
          title: Status
        total_files:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Files
          default: 0
        dataset_id:
          type: string
          title: Dataset Id
        default_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Folder Id
        owned_delete_permission:
          type: boolean
          title: Owned Delete Permission
          default: false
      type: object
      required:
        - created_at
        - updated_at
        - org_id
        - user_id
        - name
        - description
        - knowledge_id
        - status
        - dataset_id
      title: KnowledgeRead
    KnowledgeWithSettingsRead:
      properties:
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
        type:
          anyOf:
            - type: integer
            - type: 'null'
          title: Type
          description: '1: Passage, 2: FAQ'
          default: 1
        name:
          type: string
          maxLength: 128
          title: Name
        description:
          type: string
          maxLength: 512
          title: Description
        advanced_enabled:
          anyOf:
            - type: integer
            - type: 'null'
          title: Advanced Enabled
          default: 2
        score_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Score Threshold
          default: 0.5
        top_k:
          anyOf:
            - type: integer
            - type: 'null'
          title: Top K
          default: 10
        generate_metadata_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Metadata Enabled
          description: 'generate metadata, 0: disabled, 1: enabled'
          default: true
        generate_metadata_prompt:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Generate Metadata Prompt
          description: generate metadata prompt
          default: ''
        overall_summarize_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Overall Summarize Enabled
          description: 'generate overall summary, 0: disabled, 1: enabled'
          default: true
        overall_summarize_prompt:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Overall Summarize Prompt
          description: overall summary prompt
          default: ''
        smart_indexing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Smart Indexing Mode
          description: 'smart indexing mode, 0: disabled, 1: standard, 2: advanced'
          default: 1
        smart_indexing_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Smart Indexing Enabled
          description: 'generate intelligent indexing, 0: disabled, 1: enabled'
          default: true
        smart_indexing_prompt:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Smart Indexing Prompt
          description: intelligent indexing prompt
          default: ''
        retrieval_filter_entity_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Retrieval Filter Entity Enabled
          description: 'retrieval filter by entity, 0: disabled, 1: enabled'
          default: true
        retrieval_filter_period_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Retrieval Filter Period Enabled
          description: 'retrieval filter by period, 0: disabled, 1: enabled'
          default: true
        retrieval_recall_strategy_ids:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Retrieval Recall Strategy Ids
          description: >-
            retrieval recall strategy list, eg: [1, 2]. 1: semantic related
            context, 2: smart indexing context, 3: big context windows
          default: []
        retrieval_context_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retrieval Context Mode
          description: 'retrieval context mode. 1: only content, 2: content & metadata'
          default: 1
        split_media_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Split Media Enabled
          description: 'generate media segments, 0: disabled, 1: enabled'
          default: true
        chunk_size:
          anyOf:
            - type: integer
              maximum: 2048
              minimum: 256
            - type: 'null'
          title: Chunk Size
          description: document chunk size
          default: 512
        chunk_overlap:
          anyOf:
            - type: integer
              maximum: 512
              minimum: 0
            - type: 'null'
          title: Chunk Overlap
          description: document chunk size
          default: 102
        qa_pairs_return_direct:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Qa Pairs Return Direct
          description: 'whether to return similarity search qa pairs directly, 0: no, 1: yes'
          default: false
        qa_pairs_score_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Qa Pairs Score Threshold
          description: similarity search qa pairs score threshold
        generate_qa_pairs_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Qa Pairs Enabled
          description: 'generate qa pairs, 0: disabled, 1: enabled'
          default: true
        generate_qa_pairs_prompt:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Generate Qa Pairs Prompt
          description: generate qa pairs prompt
          default: ''
        refine_user_question_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Refine User Question Enabled
          description: 'refine user question, 0: disabled, 1: enabled'
          default: false
        refine_user_question_prompt:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Refine User Question Prompt
          description: refine user question prompt
          default: ''
        pdf_parsing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Pdf Parsing Mode
          description: 'pdf parsing mode, 1: page, 2: section'
          default: 1
        pdf_parsing_element_types:
          anyOf:
            - items:
                type: integer
              type: array
            - type: 'null'
          title: Pdf Parsing Element Types
          description: 'pdf parsing element list, eg: [1, 2]. 1: table, 2: image, 3: formula'
          default:
            - 1
            - 2
        audio_parsing_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Audio Parsing Mode
          description: 'audio parsing mode, 1: transcript, 2: speaker diarization'
          default: 1
        audio_chunk_mode:
          anyOf:
            - type: integer
            - type: 'null'
          title: Audio Chunk Mode
          description: 'audio chunk mode, 1: standard, 2: smart'
          default: 1
        llm:
          anyOf:
            - type: object
            - type: 'null'
          title: Llm
          default: {}
        status:
          type: integer
          title: Status
        dataset_id:
          type: string
          title: Dataset Id
        filter_attributes:
          items:
            $ref: '#/components/schemas/FilterAttribute'
          type: array
          title: Filter Attributes
          default: []
        retrieval_segment_expansion:
          anyOf:
            - $ref: '#/components/schemas/RetrievalDocumentExpansion'
            - type: 'null'
        retrieval_chunk_expansion:
          anyOf:
            - $ref: '#/components/schemas/RetrievalDocumentExpansion'
            - type: 'null'
        retrieval_filters:
          anyOf:
            - $ref: '#/components/schemas/RetrievalFilters'
            - type: 'null'
        document_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Document Count
          default: 0
        org_id:
          type: string
          title: Org Id
        user_id:
          type: string
          title: User Id
        icon:
          anyOf:
            - type: string
              maxLength: 512
            - type: 'null'
          title: Icon
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        personal:
          anyOf:
            - type: integer
            - type: 'null'
          title: Personal
          description: personal knowledge
          default: false
        knowledge_id:
          type: string
          title: Knowledge Id
        total_files:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Files
          default: 0
        default_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Folder Id
        owned_delete_permission:
          type: boolean
          title: Owned Delete Permission
          default: false
      type: object
      required:
        - created_at
        - updated_at
        - name
        - description
        - status
        - dataset_id
        - org_id
        - user_id
        - knowledge_id
      title: KnowledgeWithSettingsRead
    ErrorResponse:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
        - code
        - message
      title: ErrorResponse
    FilterAttribute:
      properties:
        name:
          type: string
          maxLength: 64
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Description
          default: ''
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          default: match_value
      type: object
      required:
        - name
      title: FilterAttribute
    RetrievalDocumentExpansion:
      properties:
        pre_count:
          type: integer
          title: Pre Count
          default: 0
        next_count:
          type: integer
          title: Next Count
          default: 0
      type: object
      title: RetrievalDocumentExpansion
    RetrievalFilters:
      properties:
        document_scopes:
          anyOf:
            - $ref: '#/components/schemas/RetrievalFilterConfig'
            - type: 'null'
        external_user_ids:
          anyOf:
            - $ref: '#/components/schemas/RetrievalFilterConfig'
            - type: 'null'
      type: object
      required:
        - document_scopes
        - external_user_ids
      title: RetrievalFilters
    RetrievalFilterConfig:
      properties:
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
      type: object
      title: RetrievalFilterConfig
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````