---
title: "Examples Index"
description: "This page provides an overview of various example implementations demonstrating how Embedchain can be deployed and utilized in different application contexts. These examples showcase common use cas..."
last_updated: "2026-05-07T04:45:15.185405+00:00"
canonical_url: "https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/technical/section-1/examples-index"
---

<details>
<summary>Relevant source files</summary>

The following files were used as context for generating this wiki page:

- [embedchain/examples/full_stack/frontend/src/pages/index.js](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/frontend/src/pages/index.js)
- [embedchain/examples/api_server/docker-compose.yml](https://github.com/blade47/mem0/blob/main/embedchain/examples/api_server/docker-compose.yml)
- [embedchain/examples/discord_bot/docker-compose.yml](https://github.com/blade47/mem0/blob/main/embedchain/examples/discord_bot/docker-compose.yml)
- [embedchain/examples/full_stack/docker-compose.yml](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/docker-compose.yml)
- [embedchain/examples/full_stack/frontend/package.json](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/frontend/package.json)
</details>

This page provides an overview of various example implementations demonstrating how Embedchain can be deployed and utilized in different application contexts. These examples showcase common use cases such as a full-stack web application, a standalone API server, and an integration with a Discord bot. Each example leverages Docker Compose for simplified setup and deployment, illustrating practical ways to integrate Embedchain's capabilities.

The examples are designed to provide a starting point for developers looking to build applications powered by Embedchain, a data platform for Large Language Models (LLMs) focused on loading, indexing, retrieving, and syncing unstructured data datasets.

## Full-Stack Web Application Example

The `full_stack` example demonstrates a complete web application, referred to as the "Embedchain Playground," which provides a user interface for interacting with Embedchain functionalities. It consists of a frontend built with Next.js and a backend service.

### Architecture

The full-stack example is orchestrated using Docker Compose, defining two primary services: `backend` and `frontend`. The `frontend` service depends on the `backend` service, ensuring the backend is available before the frontend starts.


Sources: [embedchain/examples/full_stack/docker-compose.yml:1-17](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/docker-compose.yml#L1-L17)

### Frontend Service

The frontend service, named `embedchain-frontend`, is a Next.js application that serves as the user interface for the Embedchain Playground. It runs on port `3000`.

#### Key Components and Functionality

The `index.js` file defines the main page of the Embedchain Playground. It includes several React components and manages the state related to the presence of an OpenAI API key.

*   **`Sidebar`**: A navigation component.
*   **`Wrapper`**: A layout component for page content.
*   **`SetOpenAIKey`**: A component for users to input and set their OpenAI API key.
*   **`CreateBot`**: A component for creating an Embedchain bot.
*   **`DeleteBot`**: A component for deleting an existing bot.
*   **`PurgeChats`**: A component for clearing chat history.

The application checks for the presence of an OpenAI key upon loading via an API call to `/api/check_key`. The availability of `CreateBot`, `DeleteBot`, and `PurgeChats` components is conditional on `isKeyPresent` being true.


Sources: [embedchain/examples/full_stack/frontend/src/pages/index.js:1-38](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/frontend/src/pages/index.js#L1-L38)

#### Frontend Dependencies

The `package.json` file lists the dependencies required for the Next.js frontend application.

<Tabs items={["Dependencies"]}>
<Tab value="Dependencies">

| Dependency             | Version | Description                               |
| :--------------------- | :------ | :---------------------------------------- |
| `next`                 | 13.4.9  | React framework for production            |
| `react`                | 18.2.0  | JavaScript library for building UIs       |
| `react-dom`            | 18.2.0  | Entry point for DOM rendering             |
| `autoprefixer`         | 10.4.14 | PostCSS plugin to parse CSS and add vendor prefixes |
| `eslint`               | 8.44.0  | Pluggable JavaScript linter               |
| `eslint-config-next`   | 13.4.9  | ESLint configuration for Next.js          |
| `flowbite`             | 1.7.0   | UI component library                      |
| `postcss`              | 8.4.25  | Tool for transforming CSS with JavaScript |
| `tailwindcss`          | 3.3.2   | Utility-first CSS framework               |
| `@svgr/webpack` (dev)  | 8.0.1   | Webpack loader for SVG files              |

</Tab>
</Tabs>
Sources: [embedchain/examples/full_stack/frontend/package.json:1-24](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/frontend/package.json#L1-L24)

### Backend Service

The backend service, named `embedchain-backend`, is responsible for handling the core Embedchain logic and API requests from the frontend. It runs on port `8000`.

| Configuration | Value                               | Description                                   |
| :------------ | :---------------------------------- | :-------------------------------------------- |
| `container_name` | `embedchain-backend`                | Name of the Docker container                  |
| `restart`     | `unless-stopped`                    | Restart policy for the container              |
| `build`       | `context: backend`, `dockerfile: Dockerfile` | Specifies the build context and Dockerfile    |
| `image`       | `embedchain/backend`                | Optional image name for the built container   |
| `ports`       | `"8000:8000"`                       | Maps host port 8000 to container port 8000    |

Sources: [embedchain/examples/full_stack/docker-compose.yml:4-10](https://github.com/blade47/mem0/blob/main/embedchain/examples/full_stack/docker-compose.yml#L4-L10)

## API Server Example

The `api_server` example provides a standalone Embedchain API server, designed for direct integration with other applications or services.

### Architecture

This example defines a single `backend` service that exposes the Embedchain API.


Sources: [embedchain/examples/api_server/docker-compose.yml:1-12](https://github.com/blade47/mem0/blob/main/embedchain/examples/api_server/docker-compose.yml#L1-L12)

### Backend Service Configuration

The `backend` service for the API server is configured to run on port `5000` and uses an `env_file` for environment variables. It also mounts the current directory as a volume for development or persistent storage.

| Configuration | Value                               | Description                                   |
| :------------ | :---------------------------------- | :-------------------------------------------- |
| `container_name` | `embedchain_api`                    | Name of the Docker container                  |
| `restart`     | `unless-stopped`                    | Restart policy for the container              |
| `build`       | `context: .`, `dockerfile: Dockerfile` | Specifies the build context and Dockerfile    |
| `env_file`    | `- variables.env`                   | Loads environment variables from `variables.env` |
| `ports`       | `"5000:5000"`                       | Maps host port 5000 to container port 5000    |
| `volumes`     | `- .:/usr/src/api`                  | Mounts the current directory into the container |

Sources: [embedchain/examples/api_server/docker-compose.yml:4-12](https://github.com/blade47/mem0/blob/main/embedchain/examples/api_server/docker-compose.yml#L4-L12)

## Discord Bot Example

The `discord_bot` example demonstrates how Embedchain can be integrated into a Discord bot, allowing users to interact with Embedchain's LLM capabilities directly within Discord.

### Architecture

Similar to the API server, this example defines a single `backend` service, which in this case hosts the Discord bot logic and integrates with Embedchain.


Sources: [embedchain/examples/discord_bot/docker-compose.yml:1-10](https://github.com/blade47/mem0/blob/main/embedchain/examples/discord_bot/docker-compose.yml#L1-L10)

### Backend Service Configuration

The `backend` service for the Discord bot is configured to build from the current context and load environment variables from `variables.env`, which would typically contain Discord bot tokens and other necessary credentials.

| Configuration | Value                               | Description                                   |
| :------------ | :---------------------------------- | :-------------------------------------------- |
| `container_name` | `embedchain_discord_bot`            | Name of the Docker container                  |
| `restart`     | `unless-stopped`                    | Restart policy for the container              |
| `build`       | `context: .`, `dockerfile: Dockerfile` | Specifies the build context and Dockerfile    |
| `env_file`    | `- variables.env`                   | Loads environment variables from `variables.env` |

Sources: [embedchain/examples/discord_bot/docker-compose.yml:4-10](https://github.com/blade47/mem0/blob/main/embedchain/examples/discord_bot/docker-compose.yml#L4-L10)

## Deployment with Docker Compose

All examples utilize `docker-compose.yml` files for defining and running multi-container Docker applications. This simplifies the setup process, allowing users to quickly get an Embedchain-powered application running.

<Steps>
<Step>
### Navigate to the example directory
Change your current directory to the specific example you wish to run (e.g., `embedchain/examples/full_stack`).
</Step>
<Step>
### Prepare environment variables
Ensure that a `variables.env` file (if specified in `docker-compose.yml`) is present and correctly configured with necessary API keys or tokens (e.g., OpenAI API key, Discord bot token).
</Step>
<Step>
### Build and run services
Execute the `docker-compose up` command to build the Docker images and start the defined services.
```bash
docker-compose up --build
```
</Step>
<Step>
### Access the application
Depending on the example, access the application via the specified port (e.g., `http://localhost:3000` for the full-stack frontend, `http://localhost:5000` for the API server).
</Step>
</Steps>

## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/llms.txt) for all pages in this wiki.
