Overview
AdMesh lets AI platforms do two things in the same conversation:- show sponsored recommendations under assistant answers
- let users start an in-session conversation with a brand agent
- frontend SDK for recommendation rendering and delegation lifecycle
- host-managed consent UI
- host-managed delegated runtime after activation
Integration Model
AdMesh owns:- recommendation selection
- sponsored recommendation payloads
- click and exposure tracking
- delegation eligibility
- delegation activation
- operator session lifecycle endpoints
- chat UI
- consent UX
- host-local delegated session state
- its own backend runtime
- model orchestration after delegation starts
Core Flow
1. Wrap chat with AdMeshProvider
2. Render AdMeshRecommendations under assistant turns
3. User clicks Talk to Agent
The SDK:
- requests consent from the host
- calls AdMesh delegation activation
- returns a normalized delegation payload to the host
4. Host activates its delegated runtime
The host receives:delegation_session_idbrand_namebrand_idmcp_endpointrequired_consent_typesallowed_data_typesconsent_requirementssupported_actions
5. User messages are routed through the brand agent
While the delegated session is active:- the host backend routes the next turns through the brand runtime
- the host model can attach the brand MCP endpoint as a tool
- the host continues to own the final user experience
6. Stop the session
When the user stops talking to the brand:- the host calls
stopDelegationSession(...)fromadmesh-ui-sdk - the host clears its own local delegated state
Consent Handling
AdMesh does not force a browser-native consent prompt. The recommended model is:- SDK provides the delegation payload
- host renders its own consent dialog
- host decides how long consent is remembered
- once per brand per chat session
session_goaldelegate_reasoneligibility_reasonallowed_data_typesrequired_consent_typesconsent_requirements
Mid-Conversation Data Collection
For actions like checkout, lead capture, or booking, the right loop is:- user asks for a high-intent action
- LLM calls the brand tool/runtime
- brand responds with a structured data request
- host renders a form inside the conversation
- user fills fields and confirms consent
- host submits structured data back to the delegated runtime
- brand flow continues
- do not rely on free-text collection for sensitive fields when a form is possible
- let the host UI collect email, phone, address, and consent explicitly
Recommended Host Callbacks
Use these host-side hooks withAdMeshRecommendations:
Architecture Boundary
This boundary is important:- the AI platform should use
admesh-ui-sdkfor AdMesh/operator calls - the AI platform may call its own backend for host-local delegation state
- AdMesh API calls: through the SDK
- host-local runtime calls: through the platform’s own backend
UX Recommendations
- Do not show recommendations on turns that were generated during an active delegated brand session.
- Once the delegated session is stopped, resume recommendations only for new post-stop user queries.
- Show clear provenance when a response came from a delegated brand agent.
- Use a branded consent dialog instead of
window.confirm.
Next Steps
- Use React to install the SDK
- Use Tail & Product Format to render recommendation units
- Use Platform Overview to choose your integration model