System Architecture
Core Features
Data Management
Frontend Components
Backend Systems
The following files were used as context for generating this wiki page:
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.
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.
The full-stack example is orchestrated using Docker Compose, defining two primary services: and . The service depends on the service, ensuring the backend is available before the frontend starts.
backendfrontendfrontendbackendThe 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.
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.
The package.json file lists the dependencies required for the Next.js frontend application.
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.
The api_server example provides a standalone Embedchain API server, designed for direct integration with other applications or services.
This example defines a single backend service that exposes the Embedchain API.
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.
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.
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.
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.
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.
Change your current directory to the specific example you wish to run (e.g., embedchain/examples/full_stack).
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).
Execute the docker-compose up command to build the Docker images and start the defined services.
docker-compose up --buildDepending 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).