Home

Awesome

AnythingLLM Embedded Chat Widget

This is a submodule of AnythingLLM - the all-in-one AI Application

Please report any issues or feature requests to the main repo

[!WARNING] The core AnythingLLM team publishes a pre-built version of the script that is bundled with the main application. You can find it in the main repo here. You should only be working in this repo if you are wanting to build your own custom embed widget for AnythingLLM

This folder of AnythingLLM contains the source code for how the embedded version of AnythingLLM works to provide a public facing interface of your workspace.

The AnythingLLM Embedded chat widget allows you to expose a workspace and its embedded knowledge base as a chat bubble via a <script> or <iframe> element that you can embed in a website or HTML.

Security

by using the AnythingLLM embedded chat widget you are responsible for securing and configuration of the embed as to not allow excessive chat model abuse of your instance

Developer Setup

While in development mode (yarn dev) the script will rebuild on any changes to files in the src directory. Ensure that the required keys for the development embed are accurate and set.

yarn build will compile and minify your build of the script. You can then host and link your built script wherever you like.

Integrations & Embed Types

<script> tag HTML embed

The primary way of embedding a workspace as a chat widget is via a simple <script>

<!--
An example of a script tag embed
REQUIRED data attributes:
  data-embed-id // The unique id of your embed with its default settings
  data-base-api-url // The URL of your anythingLLM instance backend
-->
<script
  data-embed-id="5fc05aaf-2f2c-4c84-87a3-367a4692c1ee"
  data-base-api-url="http://localhost:3001/api/embed"
  src="http://localhost:3000/embed/anythingllm-chat-widget.min.js"
></script>

<script> Customization Options

LLM Overrides

Style Overrides

Behavior Overrides

<iframe> tag HTML embed

work in progress

<iframe> Customization Options

work in progress