Reflexio Docs
API ReferenceClient Methods

Playbook Management

Methods for searching, retrieving, adding, and deleting user playbooks and agent playbooks.

Playbook Management

search_user_playbooks

Search for user playbooks using semantic/text search and advanced filtering.

response = client.search_user_playbooks(
    query="user satisfaction",
    agent_version="v2.1.0",
    top_k=10
)

Prop

Type


search_agent_playbooks

Search for agent playbooks using semantic/text search and advanced filtering.

response = client.search_agent_playbooks(
    query="concise responses",
    agent_version="v2.1.0",
    playbook_status_filter="approved"
)

Prop

Type


get_user_playbooks

Retrieve user playbook entries extracted from interactions.

response = client.get_user_playbooks(
    limit=100,
    playbook_name="quality_playbook"
)

Prop

Type


add_user_playbook

Add user playbook entries directly to storage.

response = client.add_user_playbook(
    user_playbooks=[
        {
            "agent_version": "v2.1.0",
            "request_id": "req_123",
            "playbook_name": "quality_playbook",
            "content": "User expressed satisfaction with response"
        }
    ]
)

Prop

Type

At least one of content or trigger must be provided.


add_agent_playbooks

Add agent playbook entries directly to storage.

response = client.add_agent_playbooks(
    agent_playbooks=[
        {
            "agent_version": "v2.1.0",
            "playbook_name": "quality_playbook",
            "content": "Agent should provide more concise responses",
            "playbook_status": "approved",
            "playbook_metadata": "{}"
        }
    ]
)

Prop

Type


get_agent_playbooks

Retrieve agent playbook entries.

response = client.get_agent_playbooks(
    playbook_name="quality_playbook",
    limit=10
)

Prop

Type


Update Methods

update_user_playbook

Update editable fields of a user playbook in place. Pass only the fields you want to change.

response = client.update_user_playbook(
    user_playbook_id=42,
    content="Refined playbook content",
)

Prop

Type

Returns: UpdateUserPlaybookResponse with success and message.


update_agent_playbook

Update editable fields of an agent playbook in place. Pass only the fields you want to change.

response = client.update_agent_playbook(
    agent_playbook_id=17,
    content="Updated guidance",
    playbook_name="quality_playbook",
)

Prop

Type

Returns: UpdateAgentPlaybookResponse with success and message.


update_agent_playbook_status

Dedicated endpoint for the approval workflow (approve / pending / reject). Use this instead of update_agent_playbook when the only change is the playbook_status — the server enforces tighter validation and writes a smaller change log.

from reflexio import PlaybookStatus

response = client.update_agent_playbook_status(
    agent_playbook_id=17,
    playbook_status=PlaybookStatus.APPROVED,
)

Prop

Type

Returns: UpdatePlaybookStatusResponse with success and message.


delete_agent_playbook

Delete an agent playbook by ID.

response = client.delete_agent_playbook(
    agent_playbook_id=123,
    wait_for_response=True
)

delete_user_playbook

Delete a user playbook by ID.

response = client.delete_user_playbook(
    user_playbook_id=456,
    wait_for_response=True
)

Bulk Delete Operations

delete_agent_playbooks_by_ids

Delete multiple agent playbooks by their IDs.

response = client.delete_agent_playbooks_by_ids(agent_playbook_ids=[1, 2, 3])

Returns: BulkDeleteResponse with success, deleted_count, and message


delete_user_playbooks_by_ids

Delete multiple user playbooks by their IDs.

response = client.delete_user_playbooks_by_ids(user_playbook_ids=[1, 2, 3])

Returns: BulkDeleteResponse with success, deleted_count, and message


delete_all_playbooks

Delete all playbooks (both user and agent). Cascading variant — wipes both stores.

response = client.delete_all_playbooks()

Returns: BulkDeleteResponse with success, deleted_count, and message


delete_all_user_playbooks

Delete all user playbooks (user only, not agent).

response = client.delete_all_user_playbooks()

Returns: BulkDeleteResponse with success, deleted_count, and message


delete_all_agent_playbooks

Delete all agent playbooks (agent only, not user).

response = client.delete_all_agent_playbooks()

Returns: BulkDeleteResponse with success, deleted_count, and message