ReflexioDeveloper Docs
Menu
All

Publishing Interactions

Publish complete agent turns, feedback, images, actions, and expert examples.

Publishing Interactions

Publish a completed agent turn after the response and any immediate user feedback are available. The same method works for Hosted Enterprise and Local OSS; only client initialization differs.

Use the same session_id for related turns. Use a stable source for a product surface or traffic cohort, and set agent_version whenever you compare or aggregate agent behavior.

Attach retrieved learnings to the response

Whenever Reflexio profiles or playbooks were injected into an agent response, publish their stable kind and learning_id on that response—even if you cannot tell whether each one changed the answer. This unlocks per-learning relevance and impact analysis for evaluated sessions and gives Reflexio attribution data for future optimization of retrieved learnings. Omit retrieved_learnings only when no Reflexio context was injected.

Asynchronous learning

By default, publish returns after Reflexio durably queues learning. Poll get_learning_status(result.request_id) only when your workflow must observe completion. Use force_extraction=True and wait_for_response=True for deterministic tests and first-run demos, not the normal request path.

Images and Screenshots

Set image_encoding to base64 image data when the visual content itself is evidence. Use interacted_image_url when a URL is enough to identify what the user saw. Include a short text description so the record remains understandable in logs and portal views.

InteractionData(
    role="User",
    content="The save button overlaps the footer on mobile.",
    image_encoding=base64_screenshot,
    interacted_image_url="https://app.example.com/settings",
)

Expert Examples

Use expert content when you have an ideal response that should teach a better procedure.

InteractionData(
    role="Agent",
    content=agent_response,
    expert_content="Verify account ownership before changing the billing email.",
)

Expert content is training evidence, not another conversational turn.

User Actions

Actions such as clicks, purchases, and cancellations can supply outcome evidence even when the user writes nothing.

InteractionData(
    role="User",
    content="",
    user_action=UserActionType.CLICK,
    user_action_description="Clicked Confirm cancellation",
)

Choose the Right Follow-up