This project is a modern customer support agent built for e-commerce platforms. It combines conversational AI, structured data access, and a clean web UI so businesses can deliver fast, personalized support across order inquiries, product search, ticket management, and refunds.
Why this project?
Every modern support experience needs more than canned responses. This project demonstrates how to layer:
- an LLM-powered chat agent,
- a relational database for customer/order/product state,
- a fast API backend,
- and an interactive frontend.
That combination makes support conversations context-aware, actionable, and extensible.
Tech Stack
- Backend:
FastAPI(Python) - Frontend:
Streamlit - AI:
Groq API - Database:
PostgreSQL - ORM:
SQLAlchemy - Validation:
Pydantic - HTTP Client:
httpx - Environment config:
python-dotenv - Containerization:
Docker+Docker Compose - Server:
uvicorn
What the app does
The support agent is designed to handle common e-commerce workflows, including:
- order status lookups
- order detail retrieval
- customer profile access
- product discovery by name, category, and price
- support ticket creation and updates
- refund request processing
- conversational memory across a session
Project structure
The repository is organized for clarity and separation of concerns:
frontend/app.py— Streamlit web interface for agent chatsrc/main.py— FastAPI application entry pointsrc/routes.py— API endpoints for chat and support actionssrc/agent.py— AI orchestration and prompt logic with Groq integrationsrc/database.py— database connection and session managementsrc/models.py— SQLAlchemy models for customers, orders, products, ticketssrc/tools.py— helper query tools for business logicsrc/memory.py— session memory for chat context persistencesrc/seed_data.py— seed data setup to bootstrap demo datascripts/setup_db.sh— database schema creation and seeding scriptdocker-compose.yml— local PostgreSQL and dependency orchestration
Key design decisions
FastAPI for API-first design
FastAPI gives the project an asynchronous, high-performance backend with automatic schema docs and fast development productivity.
Streamlit for rapid UI
A conversational interface is exposed through Streamlit, which makes building web-driven demos extremely fast without a separate frontend framework.
PostgreSQL + SQLAlchemy for real data
A relational database is a natural fit for orders, customers, products, and tickets. SQLAlchemy provides a Pythonic ORM layer, while PostgreSQL ensures reliable transactional behavior.
Groq for AI reasoning
Groq serves as the LLM backend to generate responses, interpret user intent, and enrich the agent with context from the database.
How it works
- The user types a question in the Streamlit UI.
- The frontend sends the request to the FastAPI backend.
- The backend loads customer/order/product context from PostgreSQL.
- The AI agent in
src/agent.pyconstructs a prompt and calls Groq. - The response is returned to the user and optionally stored in memory.
Sample request and response
Example request / response

Running the project locally
Prerequisites
- Python 3.8+
- Docker and Docker Compose
- Groq API key
Setup steps
- Clone the repo
- Create a
.envfile withGROQ_API_KEYandDATABASE_URL - Start the database with
docker-compose up -d - Install dependencies with
pip install -r requirements.txt - Run
./scripts/setup_db.sh - Start the backend with
uvicorn --app-dir src main:app --reload --host 0.0.0.0 --port 8000 - Start the frontend with
PYTHONPATH=. streamlit run frontend/app.py
Why this is a great project for a tech blog
- It shows how AI can be integrated into real business workflows,
- it demonstrates a clean production-ready stack,
- it combines chat, memory, and structured data access,
- and it is easy to deploy locally using Docker.
Possible next steps
- add user authentication and role-based access
- support multi-tenant customer portals
- enhance the AI with retrieval-augmented generation
- add analytics dashboards for support throughput
- build a dedicated React/Next.js frontend
Final thoughts
This support agent is a strong example of how modern Python development can bring AI into practical customer service applications. It balances the speed of FastAPI, the simplicity of Streamlit, the reliability of PostgreSQL, and the intelligence of Groq.
If you want, I can also help turn this into a ready-to-publish Medium post with sections, headings, and SEO-friendly hooks.