Operations
Methods for rerun/manual generation and playbook aggregation.
Rerun and Manual Generation Operations
Profile and playbook generation can be triggered in different modes:
| Mode | Method | Interactions | Output Status | Blocking | Use Case |
|---|---|---|---|---|---|
| Rerun | rerun_*_generation | ALL interactions | PENDING | Optional | Test prompt changes, full regeneration |
| Manual | manual_*_generation | Window-sized (from config) | CURRENT | Fire-and-forget only | Force regeneration, fill gaps |
Key Differences:
- Rerun: Uses ALL interactions, outputs PENDING status (requires upgrade workflow), supports
wait_for_response - Manual: Uses
window_sizefrom 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
)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")Prop
Type
Returns: None (fire-and-forget operation)
Prerequisites:
window_sizemust be configured in your config- Extractors must have
allow_manual_trigger=Trueto 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")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
)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")Prop
Type
Returns: None (fire-and-forget operation)
Prerequisites:
window_sizemust be configured in your config- Playbook configs must have
allow_manual_trigger=Trueto 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"
)
# Legacy clients may still send playbook_name, but it no longer selects a playbook config.
client.manual_playbook_generation(agent_version="v2.1.0")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")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")Prop
Type
run_playbook_aggregation
Aggregate user playbooks into consolidated insights using clustering.
response = client.run_playbook_aggregation(
agent_version="v2.1.0"
)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)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)mark_stall_notified
Idempotently mark the current stall as notified (sets notified_in_cc=True).
result = client.mark_stall_notified()Returns: MarkNotifiedResponse with the new notified_in_cc value.