---
title: "Update Context Search Config"
method: PUT
path: "/api/v1/contexts/{context_id}/search-config"
tags: ["context-search-config"]
---

# Update Context Search Config

`PUT /api/v1/contexts/{context_id}/search-config`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/contexts/{context_id}/search-config`
- Auth: none declared

Update context search configuration.

Updates hybrid search weights, fetch factor, and/or reranker settings.
Validates that weights sum to 1.0 and model matches provider.

Context owners and editors may change every field except
``content_chunks_enabled`` and ``llm_selector_enabled``: changing either
(on or off) takes the context owner or a workspace owner/admin, since
turning it on sends memory content to the embedding and rerank providers
(#2015) or to the deployment's judge model at recall time (#2144). Sending
the stored value is not a change and is allowed.

Args:
    context_id: Context UUID
    update_data: Configuration update request
    current_user: Current authenticated user
    db: Database session

Returns:
    Updated ContextSearchConfigResponse

Raises:
    HTTPException: 400 if validation fails, 403 if the caller may not
        change content_chunks_enabled, 404 if context not found, 500 on error
    ValidationError: 422 when turning content_chunks_enabled on with the
        LanceDB vector store, which has no content chunk vectors (#2072)
    FeatureNotAvailableError: 403 ``FEAT-001`` when turning it on on a plan
        without ``content_chunks`` (only where CONTENT_CHUNKS_REQUIRE_PLAN
        is on, #2103)
    QuotaExceededError: 429 ``QUOTA-001`` when turning it on with the
        workspace at the plan's ``max_content_chunk_contexts`` (likewise).
        The same 403 / 429 for ``llm_selector_enabled`` against
        ``llm_selector`` / ``max_llm_selector_contexts``, only where
        LLM_SELECTOR_REQUIRE_PLAN is on (#2144)

## Path parameters

- `context_id` string, uuid, required

## Headers

- `authorization` string, nullable

## Request body

- ContextSearchConfigUpdate: Request schema for updating context search configuration. Issue #160: Renamed from ProjectSearchConfigUpdate to ContextSearchConfigUpdate
  - `semantic_weight` number, required: Semantic search weight
  - `bm25_weight` number, required: BM25 keyword search weight
  - `fetch_factor` integer, required: Candidate retrieval multiplier
  - `use_rerank` boolean, required: Enable/disable reranking
  - `reranker_provider` string, required: Reranker provider: 'voyage', 'cohere', or 'self_hosted'
  - `reranker_model` string, required: Provider-specific model name
  - `reinforce_enabled` boolean: Enable the bounded adoption+feedback recall re-rank
  - `reinforce_max_boost` number: Bound on the reinforce adjustment (factor stays in [1-b, 1+b])
  - `reinforce_require_host_arbitration` boolean: Forge-resistant mode — only host-arbitrated feedback (provenance='host') moves ranking; an untrusted agent's self-feedback is ignored
  - `routing_mode` string: Query-intent router: off | log_only (stamp telemetry, zero ranking change) | active (routed lane used only when search_mode is omitted)
  - `content_chunks_enabled` boolean: Embed long content (>= 1500 chars) as chunk vectors so dense retrieval sees the body, not only the summary. Turning it on also queues the context's existing long memories for chunking (drained in the background; see content_chunks_backfill_pending); turning it off deletes the chunks. When on, memory content (not only summaries) is sent to the embedding and rerank providers. Changing it takes the context owner or a workspace owner/admin (403 for an editor); sending the stored value is a no-op. Needs the Qdrant vector store: turning it on with LanceDB is refused (422)
  - `llm_selector_enabled` boolean: Recall LLM selector opt-in: an MCP recall may send this context's summaries and attached content to the deployment's judge model, which keeps the results that answer the query and cuts their content to verbatim passages. Changing it takes the context owner or a workspace owner/admin (403 for an editor); sending the stored value is a no-op. Where the deployment gates it by plan (LLM_SELECTOR_REQUIRE_PLAN), turning it on needs the llm_selector feature (403 FEAT-001) and a free slot under max_llm_selector_contexts (429 QUOTA-001)

## Response `200`

Successful Response

- ContextSearchConfigResponse: Response schema for context search configuration. Issue #130: Context-scoped Search & Reranker Settings Issue #146: Added immutable embedding configuration fields Issue #160: Renamed from Project to Context
  - `context_id` unknown, required
  - `semantic_weight` unknown, required
  - `bm25_weight` unknown, required
  - `fetch_factor` unknown, required
  - `use_rerank` unknown, required
  - `reranker_provider` unknown, required
  - `reranker_model` unknown, required
  - `embedding_model` unknown, required
  - `embedding_dimensions` unknown, required
  - `reinforce_enabled` unknown
  - `reinforce_max_boost` unknown
  - `reinforce_require_host_arbitration` unknown
  - `routing_mode` unknown
  - `content_chunks_enabled` unknown
  - `content_chunks_can_change` unknown
  - `content_chunks_supported` unknown
  - `embedding_provider` unknown
  - `content_chunks_backfill_pending` unknown
  - `content_chunks_effective` unknown
  - `content_chunks_limit` unknown
  - `content_chunks_in_use` unknown
  - `content_chunks_disabled_reason` unknown
  - `llm_selector_enabled` unknown
  - `llm_selector_effective` unknown
  - `llm_selector_limit` unknown
  - `llm_selector_in_use` unknown
  - `llm_selector_disabled_reason` unknown
  - `llm_selector_can_change` unknown
  - `created_at` unknown, required
  - `updated_at` unknown, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
