Reflexio Docs
API ReferenceClient Methods

Configuration

Methods for getting and setting system configuration.

Configuration Management

get_config

Get the current system configuration.

config = client.get_config()

Returns: Config — every nested type is linked in the accordion below.

Example:

config = client.get_config()
print(config.profile_extractor_config.extraction_definition_prompt)
print(config.user_playbook_extractor_config.extraction_definition_prompt)

set_config

Set the system configuration. Accepts a full Config object or a partial dict — the server fills in defaults.

response = client.set_config(config)

Prop

Type

Returns: dict with success and message keys.

The parameter type is the same Config model returned by get_config. See the Config Schema for every field, including the nested ProfileExtractorConfig, UserPlaybookExtractorConfig, PlaybookAggregatorConfig, DeduplicationConfig, AgentSuccessConfig, APIKeyConfig, and LLMConfig shapes.

Example — using a preset:

response = client.set_config({
    "extraction_preset": "long_form",  # auto-sets window_size=25, stride_size=10
    "user_playbook_extractor_config": {
        "extraction_definition_prompt": "Extract playbook entries about response quality",
    },
})

Example — full configuration:

config = client.get_config()

# Configure profile extraction
config.profile_extractor_config = {
    "extraction_definition_prompt": "Extract user preferences and interests",
    "context_prompt": "Analyzing customer conversations",
}

# Add playbook configuration with aggregation and deduplication
config.user_playbook_extractor_config = {
    "extraction_definition_prompt": "Extract playbook entries about response quality",
    "aggregation_config": {
        "min_cluster_size": 3,
        "clustering_similarity": 0.6,
    },
    "deduplication_config": {
        "search_threshold": 0.4,
        "search_top_k": 5,
    },
}

response = client.set_config(config)
print(f"Config updated: {response['success']}")

update_config

Apply a partial (PATCH-style) update to the org config. Unlike set_config, this does not round-trip the payload through Config(**...) client-side, so partial updates succeed without re-sending required fields like storage_config. The server fetches the existing config and shallow-merges atomically — there is no client-side read-modify-write race.

Nested objects (e.g. storage_config, llm_config) are replaced wholesale; deep merging is intentionally not supported. Raises TypeError if the argument is not a dict.

response = client.update_config({"shadow_mode_enabled": True})

Prop

Type

Returns: dict with success and msg keys.


invalidate_cache

Explicitly evict the server-side per-org Reflexio cache entry. Useful when the running config has been mutated through a channel the server can't observe (sibling-replica writes, direct DB updates, hand-edited config files). Most cases are handled automatically; this is the manual escape hatch.

Cross-org invalidation is not supported — the endpoint only ever invalidates the caller's own org.

response = client.invalidate_cache()

Prop

Type

Returns: dict {"invalidated": bool, "org_id": str}. The invalidated flag is False when nothing was cached for the org (still a successful no-op).


Identity & Storage Routing

Two read-only endpoints expose information about the org and storage backing the current API key. Both are commonly used by managed Reflexio Enterprise users to verify which org and storage their API key resolves to.

whoami

Return the server's view of the caller's org and storage routing. The response is masked — it never contains raw credentials, so it is safe to print or include in bug reports.

identity = client.whoami()
print(identity.org_id, identity.storage_type, identity.storage_label)

The reflexio status whoami CLI command wraps this method and prints a formatted summary.


get_my_config

Return the raw storage credentials for the caller's org. Used by reflexio config pull / config storage to let users move per-org server-side config to a fresh machine.

my_config = client.get_my_config()
if my_config.success:
    print(my_config.storage_type)
    # my_config.storage_config is a dict containing raw credentials

Unlike whoami, this response does contain raw credentials. Do not log or print the full response. Treat it like any other secret material.