An intelligent AI-powered customer service chatbot for Safar Travel, specializing in Iranian domestic travel services.
- Multilingual Support: Communicates in both English and Persian (فارسی)
- Ticket Management: Book, cancel, and retrieve ticket information
- Travel Assistance: Get travel suggestions and recommendations for Iranian destinations
- Company Policies: Access to refund policies, baggage allowances, and booking procedures
- Real-time Search: Web search capabilities for up-to-date travel information
- Knowledge Base: RAG system with company-specific information
- Frontend: Chainlit for interactive chat interface
- AI Model: OpenAI GPT-4o-mini (configurable)
- Knowledge Base: ChromaDB with sentence transformers
- Search: Tavily API for real-time web search
- Language Processing: Multilingual sentence transformers for Persian/English
-
Clone the repository
git clone <repository-url> cd Safar
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_api_key_here OPENAI_MODEL=gpt-4o-mini OPENAI_BASE_URL=https://api.openai.com/v1 TAVILY_API_KEY=your_tavily_api_key_here
-
Run the application
python run.py
-
Access the application Open your browser and go to
http://localhost:8000
The AI agent can help you with:
- Booking tickets: "Book a flight from Tehran to Shiraz for tomorrow"
- Cancelling tickets: "Cancel ticket ST-1001"
- Getting ticket info: "Show me details for ticket ST-1001"
- Travel suggestions: "Suggest places to visit in Isfahan"
- Company policies: "What is your refund policy?"
Both English and Persian queries are supported.
Safar/
├── chainlit_app.py # Main Chainlit application
├── run.py # Application launcher
├── src/
│ ├── manager.py # Agent orchestration and LLM calls
│ └── tools.py # Tool implementations (RAG, API, Search)
├── data/ # Knowledge base documents
├── prompts.py # System prompts and few-shot examples
├── requirements.txt # Python dependencies
└── .env # Environment configuration
This project is for educational and demonstration purposes.

