Skip to content

la-sepia/sepia-store

Repository files navigation

Sepia Store

What is Sepia?

Sepia is a plugin for MedusaJS, an open-source e-commerce framework that provides a flexible and scalable backend for building online stores. Sepia integrates with the Vercel AI SDK to add a chatbot to the MedusaJS Next.js store. This chatbot can assist with personal shopping, find order statuses, and display cart information. While Sepia is just a proof of concept (PoC), it showcases the potential of using the Vercel AI SDK to create innovative products with open-source e-commerce solutions for various businesses.

Sepia leverages the following features from the Vercel AI SDK:

  • From the AI SDK Core: Generating text, tool callings, embeddings generation
  • From the AI SDK SRC: Streaming React components

The bot dynamically creates an embedding database from the products in the MedusaJS store, allowing it to recommend the right products based on client requirements using RAG. Additionally, it uses the MedusaJS API to check the status of the cart and orders. Although it’s a PoC, Sepia demonstrates the numerous possibilities that can be explored with these technologies.

The project is divided into two plugins:

  1. Backend Plugin
    Medusa Plugin Sepia:
    This plugin is for the MedusaJS backend. It is responsible for adding each product from the store to the vector database and keeping it updated.

  2. Frontend Plugin
    Medusa UI Sepia:
    This plugin is for the MedusaJS frontend. It adds a chat feature to the store, allowing users to interact with the API.

Demo

You can see a demo in https://sepia.sgomez.me/

Shopping assistant

Shopping assistant

The bot can help you to find the right product, color and size. Just ask for it!

Click in the next image to see a demo:

Shopping assistant

Cart status

The bot can show you the cart status.

Click in the next image to see a demo:

Cart status

Check order

The bot can help you to see the status of a previous order. You need to specify the order id and the email. For the demo web you can use the email [email protected] and the orders 1, 2 or 3.

Click in the next image to see a demo:

Check an order status

Installation

Install dependencies

pnpm install

Configure the projects

Remember to copy and fill the templates with the OPENAI token (in both projects):

Backend

cp apps/backend/.env.template apps/backend/.env

Frontend

cp apps/frontend/.env.template apps/frontend/.env.local

Run docker services

docker compose up -d

Create database

docker compose exec -ti pgsql createdb -U postgres medusa-9ugN

Load example database

pnpm run --filter medusa-plugin-sepia build
pnpm run --filter backend seed

Run applications

Front and back

pnpm run dev

Open sites

Who we are