---
title: "更新空间"
method: PUT
path: "/tenants/{id}"
tags: ["空间管理"]
---

# 更新空间

`PUT /tenants/{id}`

更新空间信息

## Path parameters

- `id` integer, required

## Request body

- GithubComTencentWeKnoraInternalTypesTenant
  - `business` string — Business
  - `chat_history_config` GithubComTencentWeKnoraInternalTypesChatHistoryConfig
    - `embedding_model_id` string — EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages. Once messages have been indexed, the model cannot be changed (requires re-indexing).
    - `enabled` boolean — Enabled controls whether chat history indexing is active
    - `knowledge_base_id` string — KnowledgeBaseID is the auto-managed hidden knowledge base for chat history. This is set internally when the feature is first enabled; users should not set this directly.
  - `context_config` GithubComTencentWeKnoraInternalTypesContextConfig
    - `compression_strategy` 'sliding_window' | 'smart'
    - `max_tokens` integer — Maximum tokens allowed in LLM context
    - `recent_message_count` integer — For sliding_window: number of messages to keep For smart: number of recent messages to keep uncompressed
    - `summarize_threshold` integer — Summarize threshold: number of messages before summarization
  - `created_at` string — Creation time
  - `credentials` GithubComTencentWeKnoraInternalTypesCredentialsConfig
    - `weknoracloud` GithubComTencentWeKnoraInternalTypesWeKnoraCloudCredentials
      - `app_id` string
      - `app_secret` string
  - `default_storage_backend_id` string — DefaultStorageBackendID is the workspace default concrete storage instance.
  - `deleted_at` GormDeletedAt
    - `time` string
    - `valid` boolean — Valid is true if Time is not NULL
  - `description` string — Description
  - `id` integer — ID
  - `memory_config` GithubComTencentWeKnoraInternalTypesMemoryConfig
    - `embedding_model_id` string — EmbeddingModelID is the single model used to score memory against a question. It is pinned per workspace: knowledge bases each have their own embedding model, and grabbing whichever one happens to be listed first would mix incomparable vector spaces. Blank means semantic recall is off and matching stays lexical.
    - `enabled` boolean — Enabled defaults to false. Memory retains user statements across sessions, so a workspace admin has to turn it on deliberately.
    - `extract_delay_seconds` integer — ExtractDelaySeconds is how long a finished turn waits before distillation runs. Waiting lets one model call cover the several messages a user usually sends in a row. 0 means the default.
    - `extract_instructions` string — ExtractInstructions are workspace-specific rules appended to the distillation prompt, for policies the product cannot guess ("never record customer names", "always note the environment a question is about").
    - `extract_min_interval_seconds` integer — ExtractMinIntervalSeconds is the floor between two distillation runs for the same person, and exists purely to bound cost. It never drops a turn: a turn arriving inside the interval is queued and picked up by the next run. 0 means the default.
    - `extract_model_id` string — ExtractModelID is the model used by the background extraction task. Empty means "use the model the conversation itself used", which is what the settings UI promises, so the extraction task must never fail merely because this is blank.
    - `interest_threshold` integer — InterestThreshold is how many separate conversations must touch a topic before it becomes a stored interest. 0 means the default. Setting it to 1 records every topic on first sight, which is usually too noisy.
    - `max_items` integer — MaxItems caps active items per subject. 0 means DefaultMemoryMaxItems.
    - `retrieval_conditioning` boolean — RetrievalConditioning lets memory shape retrieval — query rewriting and per-document ranking — rather than only being appended to the answer prompt. This is where memory earns its keep in a knowledge-base product.
    - `vector_recall` boolean — VectorRecall adds semantic similarity to memory recall. Nil means on when an embedding model is reachable. Lexical matching alone cannot find a memory the user has re-worded, which is most of them: "回答直接给结论" and "别铺垫那么多" share no tokens. The cost is one embedding call per turn, bounded and degraded to lexical on failure, so the feature never becomes a reason a chat is slow.
    - `write_mode` string — WriteMode is MemoryWriteExplicitOnly or MemoryWriteAuto.
  - `name` string — Name
  - `parser_engine_config` GithubComTencentWeKnoraInternalTypesParserEngineConfig
    - `chat_parser_engine_rules` GithubComTencentWeKnoraInternalTypesParserEngineRule[] — ChatParserEngineRules selects parser engines for session-scoped chat documents. Knowledge bases keep their own rules in ChunkingConfig.
      - `engine` string
      - `file_types` string[]
      - `xlsx_first_row_as_header` boolean — XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables. nil preserves the parser default; an explicit false disables the mode.
    - `mineru_api_key` string — MinerU 云 API Key
    - `mineru_cloud_enable_formula` boolean
    - `mineru_cloud_enable_ocr` boolean
    - `mineru_cloud_enable_table` boolean
    - `mineru_cloud_language` string
    - `mineru_cloud_model` string — MinerU 云 API 解析参数
    - `mineru_enable_formula` boolean
    - `mineru_enable_ocr` boolean — MinerUEnableOCR is retained for compatibility with configurations saved before parse_method supported auto/ocr/txt.
    - `mineru_enable_table` boolean
    - `mineru_endpoint` string — MinerU 自建服务端点
    - `mineru_language` string
    - `mineru_model` string — MinerU 自建解析参数
    - `mineru_parse_method` string
    - `mineru_vlm_server_url` string — vLLM 服务器地址 (vlm-http-client / hybrid-http-client)
    - `odl_hybrid` string — OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.
    - `odl_hybrid_fallback` boolean
    - `odl_hybrid_mode` string — auto, full
    - `odl_hybrid_url` string — e.g. http://odl-hybrid:5002
    - `odl_markdown_with_html` boolean
    - `paddleocr_vl_cloud_model` string — e.g. PaddleOCR-VL-1.6
    - `paddleocr_vl_cloud_token` string — PaddleOCR-VL AI Studio cloud API.
    - `paddleocr_vl_cloud_use_chart_recognition` boolean
    - `paddleocr_vl_cloud_use_seal_recognition` boolean
    - `paddleocr_vl_endpoint` string — PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).
    - `paddleocr_vl_use_chart_recognition` boolean
    - `paddleocr_vl_use_seal_recognition` boolean
  - `retrieval_config` GithubComTencentWeKnoraInternalTypesRetrievalConfig
    - `embedding_top_k` integer — EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)
    - `keyword_threshold` number — KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)
    - `rerank_model_id` string — RerankModelID is the ID of the rerank model to use (required for search)
    - `rerank_threshold` number — RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)
    - `rerank_top_k` integer — RerankTopK is the maximum number of results after reranking (default: 10)
    - `rrf_k` integer — RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values flatten the curve, reducing the bias towards top-1 results. Default: 60. Sensible range: 30..100 depending on corpus size.
    - `rrf_keyword_weight` number — RRFKeywordWeight is the keyword counterpart. Default: 0.3.
    - `rrf_vector_weight` number — RRFVectorWeight is the weight applied to the vector retriever inside RRF. RRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math works for any positive weights. Default: 0.7.
    - `vector_threshold` number — VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)
  - `retriever_engines` GithubComTencentWeKnoraInternalTypesRetrieverEngines
    - `engines` GithubComTencentWeKnoraInternalTypesRetrieverEngineParams[]
      - `retriever_engine_type` 'postgres' | 'elasticsearch' | 'infinity' | 'elasticfaiss' | 'qdrant' | 'milvus' | 'weaviate' | 'doris' | 'sqlite' | 'tencent_vectordb' | 'opensearch'
      - `retriever_type` 'keywords' | 'vector' | 'websearch'
  - `status` string — Status
  - `storage_engine_config` GithubComTencentWeKnoraInternalTypesStorageEngineConfig
    - `cos` GithubComTencentWeKnoraInternalTypesCOSEngineConfig
      - `app_id` string
      - `bucket_name` string
      - `path_prefix` string
      - `region` string
      - `secret_id` string
      - `secret_key` string
      - `temp_bucket_name` string
      - `temp_region` string
    - `default_provider` string — "local", "minio", "cos", "tos", "s3", "oss", "ks3", "obs"
    - `ks3` GithubComTencentWeKnoraInternalTypesKS3EngineConfig
      - `access_key` string
      - `bucket_name` string
      - `endpoint` string
      - `path_prefix` string
      - `region` string
      - `secret_key` string
    - `local` GithubComTencentWeKnoraInternalTypesLocalEngineConfig
      - `path_prefix` string
    - `minio` GithubComTencentWeKnoraInternalTypesMinIOEngineConfig
      - `access_key_id` string
      - `bucket_name` string
      - `endpoint` string
      - `mode` string — "docker" or "remote"
      - `path_prefix` string
      - `secret_access_key` string
      - `use_ssl` boolean
    - `obs` GithubComTencentWeKnoraInternalTypesOBSEngineConfig
      - `access_key` string
      - `bucket_name` string
      - `endpoint` string
      - `path_prefix` string
      - `region` string
      - `secret_key` string
      - `use_ssl` boolean
    - `oss` GithubComTencentWeKnoraInternalTypesOSSEngineConfig
      - `access_key` string
      - `bucket_name` string
      - `endpoint` string
      - `path_prefix` string
      - `region` string
      - `secret_key` string
      - `temp_bucket_name` string
      - `temp_region` string
      - `use_temp_bucket` boolean
    - `s3` GithubComTencentWeKnoraInternalTypesS3EngineConfig
      - `access_key` string
      - `bucket_name` string
      - `endpoint` string
      - `force_path_style` boolean
      - `path_prefix` string
      - `region` string
      - `secret_key` string
      - `use_ssl` boolean
    - `tos` GithubComTencentWeKnoraInternalTypesTOSEngineConfig
      - `access_key` string
      - `bucket_name` string
      - `endpoint` string
      - `path_prefix` string
      - `region` string
      - `secret_key` string
      - `temp_bucket_name` string
      - `temp_region` string
  - `storage_quota` integer — Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.
  - `storage_used` integer — Storage used (Bytes)
  - `updated_at` string — Last updated time
  - `web_search_config` GithubComTencentWeKnoraInternalTypesWebSearchConfig
    - `api_key` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
    - `blacklist` string[] — 黑名单规则列表
    - `compression_method` string — 压缩方法：none, summary, extract, rag
    - `document_fragments` integer — 文档片段数量（用于RAG压缩）
    - `embedding_dimension` integer — 嵌入维度（用于RAG压缩）
    - `embedding_model_id` string — RAG压缩相关配置
    - `include_date` boolean — 是否包含日期
    - `max_results` integer — 最大搜索结果数
    - `provider` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
    - `proxy_url` string — Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.
    - `rerank_model_id` string — 重排模型ID（用于RAG压缩）

## Response `200`

更新后的空间

- object

## Other responses

- `400` — 请求参数错误

## Changes

> 62 revisions in range; 11 could not be searched.

- **2026-07-14** `1c6aac86ddd1` — 2 info
  - api tag `空间管理` added
  - api tag `租户管理` removed
- **2025-12-16** `edf61e68559d` — 2 info
  - api tag `租户管理` added
  - api tag `空间管理` removed

[Change history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/tenants/:id/put.md)

---

[API](https://skmtc.dev/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.dev/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/revisions/a5ce73ad8921/schema)
