# Embedding an Agent

> You're reading the Mindset v3 documentation. v3 is no longer sold; this is reference for existing customers. Mindset 4 docs are at /docs.

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.\
> &#xA;There are 2 ways to create an agent:
>
> - Through the App administration portal: (see [Creating Agents from the portal](https://docs4.mindset.ai/v3/build-optimize/guides/agents/howto-create-agents))
> - Using the [Agents API](https://docs4.mindset.ai/v3/deploy/api/agents-api)

> **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](https://docs4.mindset.ai/v3/build-optimize/guides/knowledge/structuring-knowledge-contexts))
> - Using the [Contexts API](https://docs4.mindset.ai/v3/deploy/api/contexts-api) and [ContextFiles API](https://docs4.mindset.ai/v3/deploy/api/contexts-api)

> **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](https://docs4.mindset.ai/v3/deploy/sdk2/agent-and-knowledge-context-provisioning)

## Embedding the AI Agent

Regardless of whether your agent uses [authenticated or anonymous access](https://docs4.mindset.ai/v3/features/deploy/Deployment), there is one [**Front-end** ](https://docs4.mindset.ai/v3/deploy/sdk2/front-end) script to integrate.

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

![Embedding an Agent](https://docs4.mindset.ai/v3/assets/images/embedding-agent-overview.png)

![Embedding an Agent](https://docs4.mindset.ai/v3/assets/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.
