This repository shows how to build AI agents to automate customer support and order management in e-commerce applications using the PydanticAI library.
It showcases two example agents for a fashion e-commerce store:
- A support agent that assists customers by answering their questions using Retrieval-Augmented Generation (RAG).
- An order management agent that processes complex operations like updates, returns and cancellations.
For a detailed explanation of the code and concepts, check out this blog post.
- Python 3.9 or higher
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file by copying the provided.env.example
file and set the required environment variable:OPENAI_API_KEY
: Your OpenAI API key.
Run the RAG support agent:
python rag.py
Run the order management agent:
python orders.py