Skip to content

An intelligent AI-powered customer service chatbot for Safar Travel, specializing in Iranian domestic travel services.

License

Notifications You must be signed in to change notification settings

mahanzavari/Safar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Safar Travel AI Customer Service Agent

An intelligent AI-powered customer service chatbot for Safar Travel, specializing in Iranian domestic travel services.

Features

  • 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

Technologies Used

  • 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

Screenshots

Main Chat Interface

Main Interface

Settings Panel

Settings Panel

Setup

  1. Clone the repository

    git clone <repository-url>
    cd Safar
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables Create a .env file 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
  5. Run the application

    python run.py
  6. Access the application Open your browser and go to http://localhost:8000

Usage

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.

Project Structure

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

License

This project is for educational and demonstration purposes.

About

An intelligent AI-powered customer service chatbot for Safar Travel, specializing in Iranian domestic travel services.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages