This project is a proof-of-concept (POC) for building an intelligent backend AI agent that performs vendor selection and personalized communication drafting for customer service tasks (e.g., booking a cab, finding a plumber, etc.). It's powered by a combination of FastAPI for API services and Streamlit for a simple and interactive frontend.
Customer tasks like hotel booking or urgent repairs are handled by backend agents, who in turn coordinate with vendors. This AI agent helps:
- 🧠 Select the most suitable vendor based on task requirements.
- ✉️ Draft a personalized message to the vendor in their preferred communication style.
- Python 3.9+
- FastAPI – backend API for vendor selection and message generation
- Streamlit – frontend interface to simulate task entry and vendor interaction
- Uvicorn – ASGI server for FastAPI
- Docker & Docker Compose – for containerized deployment
- Google's Generative LLM (Gemini) – for task interpretation and message generation
git clone https://github.com/your-username/vendor-ai-agent.git
cd vendor-ai-agentCreate a .env file in the root directory and add the following
OPENAI_API_KEY=your_openai_api_key- Build and Run the Containers
docker-compose up --buildThis will:
- Build the FastAPI backend container
- Build the Streamlit frontend container
- Load the environment variables from .env
- Access the Application
FastAPI (API docs): http://0.0.0.0:8000
Streamlit (UI): http://0.0.0.0:8501
python -m venv venv
source venv/bin/activateInstall the required packages
pip install -r requirements.txtStart the FastAPI server
uvicorn backend.app.main:app --reloadIn a new terminal, navigate to the project directory and run:
streamlit run frontend.app.frontend.py{
"vendor_id": "V001",
"name": "Rapid Plumbers",
"category_expertise": ["repairs", "plumbing"],
"response_time_hours": 1,
"preferred_communication_style": "casual",
"past_reliability_score": 4.8,
"constraints": ["Only serves downtown area", "Requires 2hr lead time for non-urgent tasks"]
}{
"task_id": "T101",
"task_description": "I need a plumber urgently for a leaking tap in the kitchen.",
"category": "plumbing",
"urgency": "high",
"special_requirements": "Need someone who can bring spare parts for standard faucet types."
}