An ecommerce Agent demonstrating different concepts and features of LangGraph
Deploy it to cloud run
- Run the deploy.sh script
- Do a post request to /invoke
curl -X POST "[CLOUD_RUN_URL]/invoke" -H "Content-Type: application/json" -d '{
"messages": ["Recommend me some blue clothing from your catalog for men"],
"config": {"configurable": {"thread_id": "1"}}
}'- Add telemetry for Agent calls
- Create modules to simply imports (nvillaluenga)
- Scripts to deploy web server (cloud run)
- Create basic chat interface (decide framework)
- Define set of tools
- Enable access to Mercado Pago API
This project recommends using uv for managing dependencies.
What is uv?
- uv is a simple and efficient dependency manager for Python projects.
- It focuses on a minimal, declarative approach to defining and installing dependencies.
- uv uses a
uv.tomlfile to specify project dependencies, similar torequirements.txtbut with enhanced features.
How to use uv:
-
Installation:
- macOS and Linux:
$ curl -LsSf https://astral.sh/uv/install.sh | sh - Windows:
$ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
- macOS and Linux:
-
Sync the project
uv sync
-
Activate the virtual environment
. .venv/bin/activate
Now you are ready to go!
You can track LLM calls using LangFuse web service or you can deploy it on your own GCP environment.
The easiest option is to create a LangFuse account and use their freemium plan. It's very easy to set up
After setting up your account you should complete the following environmental variables:
LANGFUSE_SECRET_KEY="<add your project's secret key>"
LANGFUSE_PUBLIC_KEY="<add your project's public key>"
LANGFUSE_HOST=https://us.cloud.langfuse.com- Google Cloud account
- gcloud CLI installed
- Terraform installed
- Enable the following APIs:
- Serverless VPC Access API
- Service Networking API
- Cloud Run Admin API
- Cloud Deployment Manager V2 API
- Artifact Registry API
- Cloud Identity-Aware Proxy API
- Cloud Build API
- Cloud Logging API
-
Set your own variables on
terraform.tfvars- Replace the value surrounded by
< >
- Replace the value surrounded by
-
Terraform init and apply
terraform init terraform apply -
Migrate Terraform state to GCS
terraform init -migrate-state- Then generate
backend.tfand have Terraform state managed by a GCS bucket
- Then generate
-
Access to Langfuse
- Check your Cloud Run URL on Google Cloud Console (default:
https://langfuse-<your-project-number>.<your-region>.run.app) - Create a project and generate secret & public keys
- Check your Cloud Run URL on Google Cloud Console (default:
LANGFUSE_SECRET_KEY="<add your project's secret key>"
LANGFUSE_PUBLIC_KEY="<add your project's public key>"
LANGFUSE_HOST="https://langfuse-<your-project-number>.<your-region>.run.app"