Skip to content

Repository files navigation

Buy me a bag- GenAI e-ecommerce agent

Router Agent, E-commerce Assistant

Demo

Demo

Architecture

Alt Text

Contributors

Frontend

Backend

Dataset preparation, Indexing and Vector Search

Tech Stack

Client: React

Server Side: LangGraph 🦜🕸️, Flask

Vectorstore: VertexAI Vector Search

Database: Firestore

LLM: Gemini 1.5 Flash

Runtime: Cloud Run

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

SENDGRID_API_KEY GOOGLE_APPLICATION_CREDENTIALS PROJECT_ID LOCAL

Run Locally

Clone the project

  git clone https://github.com/emarco177/find-me-a-bag.git

Go to the project directory

  cd find-me-a-bag

Install dependencies

  poetry install

Start the Flask server

  flask run app.py --debug

NOTE: When running locally make sure GOOGLE_APPLICATION_CREDENTIALS is set to a service account with permissions to use VertexAI

Deployment to cloud run

CI/CD via Cloud build is available in cloudbuild.yaml

Please replace $PROJECT_ID with your actual Google Cloud project ID.

To deploy manually:

  1. Make sure you enable GCP APIs:
gcloud services enable cloudbuild.googleapis.com
gcloud services enable run.googleapis.com
gcloud services enable secretmanager.googleapis.com
gcloud services enable artifactregistry.googleapis.com
gcloud services enable vertexai.googleapis.com
  1. Create a service account langgraph-agent-sa with the following roles:
gcloud iam service-accounts create vertex-ai-consumer \
    --display-name="LangGraph Agent SA"

gcloud projects add-iam-policy-binding PROJECT_ID \
    --member="serviceAccount:langgraph-agent-sa@P$PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/run.invoker"

gcloud projects add-iam-policy-binding PROJECT_ID \
    --member="serviceAccount:langgraph-agent-sa@$PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/serviceusage.serviceUsageConsumer"

gcloud projects add-iam-policy-binding PROJECT_ID \
    --member="serviceAccount:langgraph-agent-sa@$PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/ml.admin"

gcloud projects add-iam-policy-binding PROJECT_ID \
    --member="serviceAccount:langgraph-agent-sa@$PROJECT_ID.iam.gserviceaccount.com" \
    --role="roles/vertexai.admin"
  1. Create the secrets: SENDGRID_API_KEY

and for each secret grant the SA langgraph-agent-sa@$PROJECT_ID.iam.gserviceaccount.com Secret Manager Secret Accessor role to th secrets

  1. Build Image
docker build . -t me-west1-docker.pkg.dev/$PROJECT_ID/app/find-me-a-bag:latest
  1. Push to Artifact Registry
docker push me-west1-docker.pkg.dev/$PROJECT_ID/app/find-me-a-bag:latest
  1. Deploy to cloud run
    --image=me-west1-docker.pkg.dev/$PROJECT_ID/app/find-me-a-bag:latest \
    --region=me-west1 \
    --service-account=langgraph-agent-sa@$PROJECT_ID.iam.gserviceaccount.com \
    --allow-unauthenticated \
    --set-secrets="SENDGRID_API_KEY=projects/PROJECT_ID/secrets/SENDGRID_API_KEY/versions/latest"

🚀 About Me

Eden Marco, Customer Engineer @ Google Cloud, Tel Aviv🇮🇱

linkedin

twitter

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages