ReflexioDeveloper Docs
Menu
All

Operations

Methods for rerun/manual generation and playbook aggregation.

Rerun and Manual Generation Operations

Profile and playbook generation can be triggered in different modes:

ModeMethodInteractionsOutput StatusBlockingUse Case
Rerunrerun_*_generationALL interactionsPENDINGOptionalTest prompt changes, full regeneration
Manualmanual_*_generationWindow-sized (from config)CURRENTFire-and-forget onlyForce regeneration, fill gaps

Key Differences:

  • Rerun: Uses ALL interactions, outputs PENDING status (requires upgrade workflow), supports wait_for_response
  • Manual: Uses window_size from config, outputs CURRENT status directly, always fire-and-forget

rerun_profile_generation

Regenerate user profiles from ALL existing interactions. Creates profiles with PENDING status.

response = client.rerun_profile_generation(
    user_id="user_123",
    wait_for_response=True
)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/rerun_profile_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

Prop

Type


manual_profile_generation

Manually trigger profile generation with window-sized interactions (fire-and-forget). Creates profiles with CURRENT status directly (no upgrade needed).

client.manual_profile_generation(user_id="user_123")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_profile_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

Prop

Type

Returns: None (fire-and-forget operation)

Prerequisites:

  • window_size must be configured in your config
  • Extractors must have allow_manual_trigger=True to be included

Example:

# Force regeneration for a user (CURRENT status, fire-and-forget)
client.manual_profile_generation(user_id="user_123")

# Regenerate for all users with specific source
client.manual_profile_generation(source="chat")

# Legacy clients may still send extractor_names, but they no longer select extractors.
client.manual_profile_generation(user_id="user_123")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_profile_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_profile_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "source": "chat"
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_profile_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

rerun_playbook_generation

Regenerate playbook entries from ALL interactions for a specific agent version. Creates entries with PENDING status.

response = client.rerun_playbook_generation(
    agent_version="v2.1.0",
    wait_for_response=True
)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/rerun_playbook_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

Prop

Type


manual_playbook_generation

Manually trigger playbook generation with window-sized interactions (fire-and-forget). Creates entries with CURRENT status directly (no upgrade needed).

client.manual_playbook_generation(agent_version="v2.1.0")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_playbook_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

Prop

Type

Returns: None (fire-and-forget operation)

Prerequisites:

  • window_size must be configured in your config
  • Playbook configs must have allow_manual_trigger=True to be included

Example:

# Force regeneration for an agent version (CURRENT status, fire-and-forget)
client.manual_playbook_generation(agent_version="v2.1.0")

# Regenerate with specific source filter
client.manual_playbook_generation(
    agent_version="v2.1.0",
    source="chat"
)

# Manual playbook generation runs the configured playbook extractor for the agent version.
client.manual_playbook_generation(agent_version="v2.1.0")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_playbook_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_playbook_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0",
  "source": "chat"
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/manual_playbook_generation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

upgrade_profiles

Promote PENDING profiles to CURRENT, archive old CURRENT profiles, and delete old ARCHIVED profiles. Used after rerun_profile_generation to apply the new generation results.

response = client.upgrade_profiles(user_id="user_123")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/upgrade_all_profiles" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

Prop

Type


upgrade_user_playbooks

Promote PENDING user playbooks to CURRENT, archive old CURRENT, and delete old ARCHIVED. Used after rerun_playbook_generation to apply the new generation results.

response = client.upgrade_user_playbooks(agent_version="v2.1.0")
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/upgrade_all_user_playbooks" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

Prop

Type


run_playbook_aggregation

Aggregate user playbooks into consolidated insights using clustering.

response = client.run_playbook_aggregation(
    agent_version="v2.1.0"
)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/run_playbook_aggregation" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "agent_version": "v2.1.0"
}
JSON

Prop

Type


clear_user_data

Delete all rows scoped to a single user_id — the user's interactions, user playbooks, profiles, and requests. Does not touch agent playbooks, which are intentionally shared cross-project. Useful for isolating per-task data on a shared backend (e.g. paired-protocol harnesses) without a full clear-all.

response = client.clear_user_data(user_id="user_123")
print(response.deleted_counts)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/clear_user_data" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "user_id": "user_123"
}
JSON

Prop

Type


Learning-Stall State

When a configured LLM provider returns an auth or billing error, Reflexio records a "learning stall" and pauses background extraction. These two methods let a client read and acknowledge that state.

get_stall_state

Read the current learning-stall state from the server.

state = client.get_stall_state()
if state.stalled:
    print(state.reason, state.error_message)
curl -X GET "${REFLEXIO_URL:-https://www.reflexio.ai}/stall_state" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY"

mark_stall_notified

Idempotently mark the current stall as notified (sets notified_in_cc=True).

result = client.mark_stall_notified()
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/stall_state/notified" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY"

Returns: MarkNotifiedResponse with the new notified_in_cc value.