Skip to main content

Agent Integration Patterns

9.1 The Trust Decision Workflow

When an AI agent needs to recommend a merchant, the OTR query is one step in a broader decision workflow:
User: "Recommend a pair of running shoes"
  |
AI agent searches for candidate merchants (search engine / UCP / product catalog)
  |
Query OTR trust score for each candidate
  |
Composite score = f(product relevance, price, trust score, user preferences)
  |
Rank by composite score and present recommendations to the user
The OTR trust score is not the sole ranking factor, but it is a critical signal for AI agents evaluating merchant reliability.

9.2 Integration Patterns

Pattern 1: Real-Time Queries

Call the OTR API in real time for each recommendation:
async function recommendProducts(query) {
  const candidates = await searchProducts(query);

  // Query trust scores for all candidates in parallel
  const trustScores = await Promise.all(
    candidates.map(c =>
      fetch(`https://orbexa.io/api/otr/verify/${c.domain}`).then(r => r.json())
    )
  );

  // Composite ranking
  return candidates.map((c, i) => ({
    ...c,
    trustScore: trustScores[i].trust_score,
    badge: trustScores[i].badge
  })).sort((a, b) => {
    // Trust score weighted at 30%, price match at 70%
    const scoreA = a.priceMatch * 0.7 + (a.trustScore / 100) * 0.3;
    const scoreB = b.priceMatch * 0.7 + (b.trustScore / 100) * 0.3;
    return scoreB - scoreA;
  });
}

Pattern 2: Cached Queries

Trust scores do not change frequently, making them well-suited for caching:
const trustCache = new Map();
const CACHE_TTL = 4 * 60 * 60 * 1000; // 4 hours

async function getTrustScore(domain) {
  const cached = trustCache.get(domain);
  if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
    return cached.data;
  }

  const data = await fetch(`https://orbexa.io/api/otr/verify/${domain}`).then(r => r.json());
  trustCache.set(domain, { data, timestamp: Date.now() });
  return data;
}

Pattern 3: MCP Tool Invocation

Through the MCP protocol, AI applications can invoke the OTR query tool directly (see Chapter 7).
ScenarioTrust Score WeightRationale
High-value items (over $500)40-50%Higher risk demands stronger trust signals
Mid-range items (5050-500)20-30%Balance between price and trust
Low-value items (under $50)10-20%Users are more price-sensitive
First recommendation of an unknown merchant50%+No purchase history — trust is the primary basis

9.4 Presenting Trust Information to Users

AI agents can display trust information alongside their recommendations:
Recommendation: ExampleStore - Nike Air Max 90
Price: $129.99
Trust Level: GOLD (85)
- Corporate identity verified
- HTTPS + DNSSEC enabled
- 30-day return policy
Transparently presenting trust information increases user confidence in the agent’s recommendations.
Next chapter: How to Improve Your Trust Score — A dimension-by-dimension guide to raising your OTR score