Lmaghrib-BinYedik is a pioneering project developed during the 2024 ThinkAI GenAI Hackathon under the theme of tourism. Our application integrates extensive information about Moroccan monuments into a single, user-friendly chatbot platform, offering tourists a seamless and enriching travel experience.
- Comprehensive Information: Access in-depth descriptions, historical data, and fascinating narratives about Morocco's iconic monuments.
- Navigation Assistance: Utilize precise directions and interactive maps to navigate through Moroccan cities effortlessly.
- Pricing Details: Stay informed with the latest entry fees for monuments, local food prices, and other essential costs.
- User Support: Receive expert travel tips and real-time assistance to make the most out of your journey in Morocco.
To enhance the accuracy of monument recognition, we evaluated various models before selecting the Google Lens API for its superior performance in handling diverse image data:
| Model | Accuracy | Flexibility | Chosen |
|---|---|---|---|
| YoloV8 Classification | High | Low (limited number of classes) | ❌ |
| Bing Reverse Search | Average | Average (doesn't work too well with new data) | ❌ |
| Google Lens | High | High | ✅ |
Using the Google Lens API, we capture a broad spectrum of images related to each monument. The LLaMA3 LLM then processes this data, efficiently identifying the exact monument name from the image attributes. We selected the 8 billion parameter model of LLaMA3 for its balance of speed and accuracy, crucial for real-time application needs.
With the monument identified, LLaMA3 adopts a dual role:
Interactive Query Handling: Acts as a responsive agent to field questions about the monument, delivering detailed and accessible information. Data Integration and Management: Leveraging LangGraph, we design complex, stateful interaction chains that maintain conversational context, enhancing user interaction continuity.
| Technique | Accuracy | Speed | Relevancy | Chosen |
|---|---|---|---|---|
| Llama3 Knowledge | High | Fast (doesn't need extra steps to get data) | Low | ❌ |
| WebSearch | High | Slow | High | ✅ |
Based on the data retrieved we format it into a suitable format that we can display into the GUI as a markdown with interactive links.
Addressing common tourist challenges, we focused on preventing overpayment scams by integrating a reliable pricing guide based on real-time data from scraped local sources like Marjane catalogs.
| Technique | Accuracy | Speed | Relevancy | Dependant on Dataset | Chosen |
|---|---|---|---|---|---|
| Llama3 Knowledge | Medium | Fast (doesn't need extra steps to get data) | Low | No | ❌ |
| Llama3 Prompt Engineered | High(But can only take a small subset of dataset) | Slow (It uses up token for taking the data as context) | High | Yes | ❌ |
| WebSearch | High | Slow | High | No | ✅ |
| Gemini FineTuned | High | Average | Medium | Yes | ✅ |
| CsvAgent | Medium | Fast | Low (Needs Exact Name ) | Yes | ❌ |
Our implementation of LLaMA3 for Lmaghrib-BinYedik presents distinct advantages over cutting-edge models like GPT-4. while GPT-4 offers broad general knowledge, LLaMA3 has been tailored to excel in domain-specific tasks, such as identifying and providing detailed information on Moroccan monuments. This focus ensures that our model not only provides accurate information but does so with a depth of understanding and contextual relevance that is specifically optimized for the tourism sector in Morocco.
1337.mp4
- Python 3.12.0 or newer
-
Clone the repository:
git clone https://github.com/Tensor-Titans/Lmaghrib-BinYedik.git cd Lmaghrib-BinYedik -
Create and Activate virtual environments:
# Create virtual environment python -m venv env # Activate virtual environment (Windows) .\env\Scripts\activate # Activate virtual environment (MacOS/Linux) source env/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up the environment variables: set the api keys in .env file
client_id=<your-imagebb-api-key> ---> https://api.imgbb.com/ hf_token=<your-huggingface-access-token> ---> https://huggingface.co/settings/tokens serpApiKey=<your-serp-api-key> ---> https://serpapi.com/manage-api-key TAVILY_API_KEY=<your-tavily-api-key> ---> https://app.tavily.com/home LITERAL_API_KEY=<your-literal-api-key> ---> https://cloud.getliteral.ai/ CHAINLIT_AUTH_SECRET=<your-chainlit-secret-key> --->run the command : ( chainlit create-secret ) at the project root directory to generate the auth secret, and paste it in the.env file
-
Start the server:
chainlit run app.py -w
-
Access the application: Open your browser and go to http://localhost:8000/
you can use username=admin , password=admin (for the sake of the demo)
Explore the app, try out all the features, and enjoy discovering all the amazing information about Moroccan monuments, cuisine, and more!
This project is licensed under the MIT License. See the LICENSE file for more details.

