This repository contains Streamlit applications demonstrating AI-powered chatbots and multi-agent systems using both OpenAI and Gemini APIs.
Live Demo: Invoice RAG Chat
A simple chatbot agent built with the OpenAI Agents SDK that can search the internet for current information.
Features:
- Conversational chat interface using Streamlit
- Internet search capability via Tavily API
- Uses GPT-4.1-mini model
- Chat history management with "New Chat" button
Required Environment Variables:
OPENAI_API_KEY- Your OpenAI API keyTAVILY_API_KEY- Your Tavily API key for web search
Run:
streamlit run app/simple_chat.pyA Retrieval-Augmented Generation (RAG) application for querying invoice PDFs using natural language.
Features:
- Upload and index multiple PDF invoices
- Extracts text from PDFs and chunks it for embedding
- Stores embeddings in ChromaDB vector database
- Semantic search to find relevant invoice context
- Chat interface to ask questions about your invoices
- Uses OpenAI's
text-embedding-3-largefor embeddings - Uses GPT-4.1-mini for generating responses
Required Environment Variables:
OPENAI_API_KEY- Your OpenAI API key
Run:
streamlit run app/invoice_rag.pyFeatures:
- Same functionality as the OpenAI version
- Uses Gemini's
text-embedding-004for embeddings - Uses
gemini-2.0-flash-litefor generating responses - Uses Gemini's OpenAI-compatible API endpoint
Required Environment Variables:
GEMINI_API_KEY- Your Google Gemini API key
Run:
streamlit run app/invoice_rag_gemini.pyFeatures:
- Same functionality as the OpenAI version
- Uses OpenRouter's API for model access
- Uses
openai/text-embedding-3-smallfor embeddings - Uses
google/gemini-2.5-flash-litefor generating responses
Required Environment Variables:
OPENROUTER_API_KEY- Your OpenRouter API key
Run:
streamlit run app/invoice_rag_openrouter.pyA multi-agent AI system that orchestrates multiple specialized agents to plan trips. This demonstrates real-world agentic AI patterns used in enterprise automation.
Features:
- Multiple specialized AI agents working together:
- 🧠 Planner Agent - Creates day-by-day itineraries (uses Tavily search for attractions)
- 💰 Budget Agent - Estimates and tracks trip costs (uses Tavily search for prices)
- 🍣 Local Guide Agent - Recommends food and local tips (uses Tavily search for restaurants)
✈️ Travel Agent Orchestrator - Coordinates all agents using.as_tool()pattern- Tavily Search Integration - Each agent searches for real-time, accurate information
- Interactive UI for entering trip details
- Structured output using Pydantic models
- Tabbed results display for organized output
- Uses GPT-4.1-mini model for all agents
Required Environment Variables:
OPENAI_API_KEY- Your OpenAI API keyTAVILY_API_KEY- Your Tavily API key for real-time search
Run:
streamlit run app/trip_planner.pyFeatures:
- Same multi-agent functionality as the OpenAI version
- Uses Gemini's OpenAI-compatible API endpoint
- Uses
gemini-2.0-flashmodel for all agents
Required Environment Variables:
GEMINI_API_KEY- Your Google Gemini API keyTAVILY_API_KEY- Your Tavily API key for real-time search
Run:
streamlit run app/trip_planner_gemini.py-
Clone the repository:
git clone https://github.com/alfredang/TGS-2025059028-openai-agent-wsq-course.git cd TGS-2025059028-openai-agent-wsq-course -
Install dependencies:
pip install streamlit openai python-dotenv pypdf chromadb tavily-python openai-agents
-
Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_api_key GEMINI_API_KEY=your_gemini_api_key OPENROUTER_API_KEY=your_openrouter_api_key TAVILY_API_KEY=your_tavily_api_key -
Run any application using the commands above.