> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Build with Embeddings

> Use Avra's learned representations as features in your own models.

export const SimpleDiscovery = () => {
  const {useState} = React;
  const [discoveryStep, setDiscoveryStep] = useState(0);
  const [showTooltip, setShowTooltip] = useState(false);
  const steps = [{
    x: 50,
    y: 50,
    confidence: 0,
    status: "Unknown company registered",
    data: "Only CNPJ available",
    prediction: null
  }, {
    x: 55,
    y: 45,
    confidence: 20,
    status: "First transaction data",
    data: "Payment history: 1 month",
    prediction: null
  }, {
    x: 62,
    y: 38,
    confidence: 45,
    status: "Network relationships detected",
    data: "Supplier connections mapped",
    prediction: "Positive signals emerging"
  }, {
    x: 70,
    y: 30,
    confidence: 70,
    status: "Growth patterns identified",
    data: "Revenue trajectory visible",
    prediction: "Likely high-value customer"
  }, {
    x: 78,
    y: 22,
    confidence: 90,
    status: "Behavioral profile complete",
    data: "Full pattern analysis",
    prediction: "High-value cluster match"
  }];
  const clusters = [{
    name: "High Value",
    x: 75,
    y: 18,
    color: "#10b981",
    size: 14
  }, {
    name: "Growth",
    x: 18,
    y: 32,
    color: "#3b82f6",
    size: 12
  }, {
    name: "Stable",
    x: 42,
    y: 62,
    color: "#8b5cf6",
    size: 10
  }, {
    name: "Risk",
    x: 12,
    y: 78,
    color: "#ef4444",
    size: 8
  }];
  const currentStep = steps[discoveryStep];
  const maxSteps = steps.length - 1;
  return <div className="border rounded-lg p-6">
      <div className="mb-6">
        <p className="text-gray-600 dark:text-gray-400">
          See how model confidence improves as we collect more data points
          during customer onboarding
        </p>
      </div>

      {}
      <div className="mb-6">
        <div className="relative bg-gradient-to-br from-slate-50 to-blue-50 dark:from-slate-900 dark:to-blue-900 rounded-xl p-8 border" style={{
    height: "400px"
  }}>
          {}
          {[{
    name: "TechCorp",
    x: 70,
    y: 20,
    cluster: "high-value"
  }, {
    name: "FinTech Rio",
    x: 75,
    y: 15,
    cluster: "high-value"
  }, {
    name: "EcoLogistics",
    x: 20,
    y: 30,
    cluster: "growth"
  }, {
    name: "GreenEnergy",
    x: 15,
    y: 35,
    cluster: "growth"
  }, {
    name: "FamilyStore",
    x: 40,
    y: 60,
    cluster: "stable"
  }, {
    name: "LocalServices",
    x: 45,
    y: 65,
    cluster: "stable"
  }, {
    name: "StruggleCorp",
    x: 15,
    y: 75,
    cluster: "risk"
  }, {
    name: "DebtCo",
    x: 10,
    y: 80,
    cluster: "risk"
  }].map((company, index) => {
    const cluster = clusters.find(c => c.name.toLowerCase().includes(company.cluster.split("-")[0]));
    return <div key={index} className="absolute w-2 h-2 rounded-full opacity-70 transform -translate-x-1 -translate-y-1" style={{
      left: `${company.x}%`,
      top: `${company.y}%`,
      backgroundColor: cluster.color,
      border: "1px solid rgba(255,255,255,0.3)"
    }} title={company.name} />;
  })}

          {}
          {clusters.map((cluster, index) => <div key={index}>
              {}
              <div className="absolute rounded-full border-2 border-dashed opacity-40 transform -translate-x-1/2 -translate-y-1/2" style={{
    left: `${cluster.x}%`,
    top: `${cluster.y}%`,
    width: `${cluster.size}%`,
    height: `${cluster.size}%`,
    backgroundColor: cluster.color + "15",
    borderColor: cluster.color
  }} />

              {}
              <div className="absolute text-sm font-semibold transform -translate-x-1/2" style={{
    left: `${cluster.x}%`,
    top: `${cluster.y - cluster.size / 2 - 6}%`,
    color: cluster.color
  }}>
                {cluster.name}
              </div>
            </div>)}

          {}
          <div className="absolute transition-all duration-1000 ease-out transform -translate-x-3 -translate-y-3" style={{
    left: `${currentStep.x}%`,
    top: `${currentStep.y}%`
  }} onMouseEnter={() => setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)}>
            <div className={`w-6 h-6 rounded-full border-4 transition-all duration-1000 flex items-center justify-center cursor-pointer ${currentStep.confidence > 70 ? "border-green-500 bg-green-100 dark:bg-green-900" : currentStep.confidence > 40 ? "border-yellow-500 bg-yellow-100 dark:bg-yellow-900" : "border-gray-400 bg-gray-100 dark:bg-gray-800"}`} style={{
    boxShadow: currentStep.confidence > 50 ? "0 0 20px rgba(16, 185, 129, 0.6)" : currentStep.confidence > 20 ? "0 0 10px rgba(234, 179, 8, 0.4)" : "0 0 5px rgba(156, 163, 175, 0.3)"
  }}>
              <div className={`w-2 h-2 rounded-full transition-all duration-1000 ${currentStep.confidence > 70 ? "bg-green-600" : currentStep.confidence > 40 ? "bg-yellow-600" : "bg-gray-500"}`} />
            </div>

            {}
            {showTooltip && <div className="absolute bottom-8 left-1/2 transform -translate-x-1/2 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 text-xs rounded-lg px-3 py-2 whitespace-nowrap z-10 shadow-lg">
                <div className="font-medium">NewCompany LTDA</div>
                <div className="text-gray-300 dark:text-gray-600">
                  CNPJ: 12.345.678/0001-99
                </div>
                <div className="text-gray-300 dark:text-gray-600">
                  Confidence: {currentStep.confidence}%
                </div>
                {}
                <div className="absolute top-full left-1/2 transform -translate-x-1/2 border-4 border-transparent border-t-gray-900 dark:border-t-gray-100"></div>
              </div>}
          </div>

          {}
          {discoveryStep > 0 && <svg className="absolute inset-0 w-full h-full pointer-events-none" viewBox="0 0 100 100" preserveAspectRatio="none">
              <path d={`M ${steps[0].x} ${steps[0].y} ${steps.slice(1, discoveryStep + 1).map(step => `L ${step.x} ${step.y}`).join(" ")}`} stroke="#6366f1" strokeWidth="0.8" strokeDasharray="2,2" fill="none" opacity="0.7" />
            </svg>}

          {}
          <div className="absolute bottom-2 right-2 text-xs text-gray-500 dark:text-gray-400">
            Business Sophistication →
          </div>
          <div className="absolute left-1 top-1/2 text-xs text-gray-500 dark:text-gray-400 transform -rotate-90 -translate-y-1/2 ml-[-2rem]">
            Financial Strength →
          </div>
        </div>
      </div>

      {}
      <div className="mb-6 p-4 bg-white dark:bg-gray-800 rounded-xl border">
        <div className="flex items-center justify-between mb-3">
          <h5 className="font-semibold text-gray-900 dark:text-gray-100">
            Data Collection Progress
          </h5>
          <div className="text-right">
            <div className="text-xl font-bold text-gray-900 dark:text-gray-100">
              {currentStep.confidence}%
            </div>
            <div className="text-sm text-gray-600 dark:text-gray-400">
              model confidence
            </div>
          </div>
        </div>

        <input type="range" min="0" max={maxSteps} value={discoveryStep} onChange={e => setDiscoveryStep(parseInt(e.target.value))} className="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700" />

        <div className="flex justify-between text-xs text-gray-500 dark:text-gray-400 mt-2">
          <span>New Customer</span>
          <span>Collecting Data</span>
          <span>Rich Behavioral Profile</span>
        </div>
      </div>

      {}
      <div className="mb-6 p-4 bg-white dark:bg-gray-800 rounded-xl border">
        <h5 className="font-semibold text-gray-900 dark:text-gray-100 mb-4">
          Customer Onboarding Data Collection - CNPJ: 12.345.678/0001-99
        </h5>

        <div className="space-y-3 max-h-64 overflow-y-auto">
          {steps.map((step, index) => <div key={index} className={`flex items-start gap-3 p-3 rounded-lg transition-all ${index <= discoveryStep ? "bg-blue-50 dark:bg-blue-900 border border-blue-200 dark:border-blue-700" : "bg-gray-50 dark:bg-gray-700 opacity-50"}`}>
              <div className="flex-shrink-0 mt-0.5">
                <div className={`w-3 h-3 rounded-full ${index <= discoveryStep ? "bg-blue-500" : "bg-gray-300"}`} />
              </div>
              <div className="flex-1 min-w-0">
                <div className={`text-sm font-medium ${index <= discoveryStep ? "text-blue-900 dark:text-blue-100" : "text-gray-500 dark:text-gray-400"}`}>
                  {step.status}
                </div>
                <div className={`text-xs mt-1 ${index <= discoveryStep ? "text-blue-700 dark:text-blue-300" : "text-gray-400 dark:text-gray-500"}`}>
                  {step.data}
                </div>
                {step.prediction && index <= discoveryStep && <div className="text-xs mt-1 text-green-600 dark:text-green-400 font-medium">
                    → {step.prediction}
                  </div>}
              </div>
              {index <= discoveryStep && <div className="text-xs text-gray-500 dark:text-gray-400 flex-shrink-0">
                  {step.confidence}%
                </div>}
            </div>)}
        </div>
      </div>

      <div className="p-4 bg-gradient-to-r from-indigo-50 to-purple-50 dark:from-indigo-950 dark:to-purple-950 rounded-xl border">
        <h5 className="font-semibold text-gray-900 dark:text-gray-100 mb-2">
          How This Works
        </h5>
        <p className="text-sm text-gray-700 dark:text-gray-300">
          As we collect more data points during customer onboarding - payment
          history, supplier relationships, transaction patterns - our model's
          confidence in predicting business outcomes increases. Even with
          limited initial data, we can make intelligent predictions by
          understanding how similar companies behave in our 1024-dimensional
          behavioral space.
        </p>
      </div>

      <div className="mt-3 text-center text-xs text-gray-500 dark:text-gray-400">
        Drag the slider to see how model confidence improves as we collect more
        customer data points
      </div>
    </div>;
};

## What are embeddings?

**1024-dimensional vectors** that encode everything the Graph Foundation Model and your Relational Foundation Model understand about an entity: network position, relationships, behavioral patterns, risk profile, trajectory.

Compressed intelligence you can plug into any ML model.

<Info>
  The same embeddings power Avra's credit, fraud, and growth solutions. When you use embeddings directly, you get the same intelligence with full control over your model architecture.
</Info>

## Why Use Our Embeddings?

| Your Approach              | Time     | Coverage          | Signal Quality                                 |
| -------------------------- | -------- | ----------------- | ---------------------------------------------- |
| Manual feature engineering | Months   | Your data only    | Limited to what you can imagine                |
| Traditional data providers | Days     | Partial coverage  | Static, lagging indicators                     |
| **Avra Embeddings**        | **Days** | **Full coverage** | **Multi-hop relationships, temporal patterns** |

Our Graph Neural Network captures patterns you can't manually engineer: second-degree counterparty risk, regional clusters, ownership network anomalies, behavioral trajectory.

## See It In Action

<SimpleDiscovery />

<Columns>
  <Column>
    <Callout type="success" title="Thin-file ready">
      Pre-training means even new or sparse entities arrive with meaningful representations.
    </Callout>
  </Column>

  <Column>
    <Callout type="default" title="Cross-functional">
      Risk, growth, fraud, and analytics teams share a common signal without rebuilding pipelines.
    </Callout>
  </Column>

  <Column>
    <Callout type="tip" title="Private">
      Your data never leaves your workspace. Your RFM produces a customer-specific embedding space.
    </Callout>
  </Column>
</Columns>

## What You Receive

| Asset              | Details                                                                                              |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| **Embedding API**  | Deterministic endpoint returning 1024-d vectors; slice client-side to 512 / 256 / 128 / 64 / 32 / 16 |
| **Metadata**       | Model snapshot, version, and quality flags for provenance tracking                                   |
| **Explainability** | Optional attribution payloads highlighting top factors                                               |
| **Support**        | Dashboard insights, webhook notifications, solution engineering                                      |

## Delivery Patterns

<Tabs>
  <Tab title="Real-time API">
    Low-latency retrieval for onboarding, underwriting, and interactive analytics. See the [technical guide](/solutions/embeddings/technical-implementation) for request schema.
  </Tab>

  <Tab title="Batch Jobs">
    Submit large portfolios for asynchronous processing. See [Batch Inference](/data-operations/batch-inference) for setup.
  </Tab>

  <Tab title="Feature Stores">
    Persist embeddings in your warehouse or feature store to power ML pipelines and experimentation.
  </Tab>
</Tabs>

## When to Use Embeddings

* You need predictive signal for entities with little proprietary history
* You want to centralize intelligence for multiple initiatives without duplicating work
* You're building models that must remain explainable across teams

## Get Started

1. **Review integration options** in the [Technical Guide](/solutions/embeddings/technical-implementation)
2. **Explore use cases** in [Applications](/solutions/embeddings/embedding-applications)
3. **Configure monitoring** using [Model Lifecycle](/data-operations/model-lifecycle)
