> ## 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.

# Embed an agent introduction

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

## Introduction

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

<Info>
  Before embedding an agent, you need to create the agent and set it up.\
  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](/features/build/contexts))
  * Using the [Contexts API](/deploy/api/contexts-api) and [ContextFiles API](/deploy/api/context-files-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](/deploy/sdk3/sdk3-agent-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**](/deploy/sdk3/sdk3-frontend) script to integrate.

In the case that your agent uses the **authenticated access** (default mode), there is an additional [**Back-end authentication**](/deploy/sdk3/sdk3-backend) script to integrate, which is in charge of getting an **authentication token** from the Mindset AI 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 **anonymous access**, there is no need for any back-end script, but you will have to whitelist URLs in your Agent Management Studio.
