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

# Embedding an Agent

> Global overview on how to embed an Agent into your website

## Introduction

Mindset provides Embed SDK to embed the AI agents Component into your web application or portal. This documentation provides the technical instructions and important points in order achieve that.

<Info>
  Before embedding an agent, you need to create the agent and set it up.<br />
  There are 2 ways to create an agent:

  * Through the App administration portal: (see [Creating Agents from the portal](/guides-templates/guides/agents/howto-create-agents))
  * Using the [Agents API](/sdk-api/api/agents-api)
</Info>

<Info>
  You may then probably need to create `Contexts` and upload source files (PDF, Video, Doc, ...) called `Context Files`.
  There are 2 ways to do that:

  * Through the App administration portal: (see [Knowledge contexts](/guides-templates/guides/knowledge/knowledge))
  * Using the [Contexts API](/sdk-api/api/contexts-api) and [ContextFiles API](/sdk-api/api/contexts-api)
</Info>

<Info>
  Finally, you may have to give your agent access to the created `Contexts`, given your own users and tenants roles and permissions system.

  * Read more about [Agent and Knowledge Context Provisioning](/sdk-api/sdk/agent-and-knowledge-context-provisioning)
</Info>

## Embedding the AI Agent

Regardless of whether your agent uses [authenticated or anonymous access](/amp/Deployment), there is one [**Front-end** ](/sdk-api/sdk/front-end) script to integrate.

In the case that your agent uses the **authenticated access** (default mode), there is an additional [**Back-end authentication** ](/sdk-api/sdk/back-end) script to integrate, which is in charge of getting an **authentication token** from the Mindset system.

<img className="block dark:hidden" src="https://mintcdn.com/mindsetai/iZnhB5XoN5gxbjex/images/embedding-agent-overview.png?fit=max&auto=format&n=iZnhB5XoN5gxbjex&q=85&s=7916a2cb8dd4a8f8b06dd3d3633ba55c" width="1713" height="425" data-path="images/embedding-agent-overview.png" />

<img className="hidden dark:block" src="https://mintcdn.com/mindsetai/iZnhB5XoN5gxbjex/images/embedding-agent-overview.png?fit=max&auto=format&n=iZnhB5XoN5gxbjex&q=85&s=7916a2cb8dd4a8f8b06dd3d3633ba55c" style={{ borderRadius: '10px' }} width="1713" height="425" data-path="images/embedding-agent-overview.png" />

In the case that your agent uses the **anonymous access**, there is no need for any back-end script, but you will have to whitelist URLs in your Agent Management Studio.
