This project implements an Arabic chatbot using the Mistral-7B language model. It consists of a FastAPI backend server that handles chat interactions and a Next.js frontend for the user interface.
- Arabic language responses using Mistral-7B model
- FastAPI backend with efficient model loading
- Next.js frontend with modern UI
- Real-time chat interactions
- Install Python dependencies:
cd python-backend
pip install -r requirements.txt- Download the Mistral-7B model:
curl -L https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF/resolve/main/mistral-7b-instruct-v0.2.Q4_K_M.gguf -o models/mistral-7b-instruct-v0.2.Q4_K_M.gguf- Run the server:
uvicorn server:app --host 0.0.0.0 --port 8000- Install Node.js dependencies:
npm install- Run the development server:
npm run devGET /: Health check endpointGET /health: Model status check endpointPOST /chat: Chat endpoint for sending messages and receiving responses
.
โโโ python-backend/
โ โโโ models/ # Directory for model files
โ โโโ server.py # FastAPI server implementation
โโโ src/ # Next.js frontend source code
โโโ public/ # Static assets
โโโ README.md # Project documentation
The Mistral-7B model file is large and not included in the repository. Please download it separately using the curl command provided in the setup instructions.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
-
โ Updated Scope for Seirah Chatbot ๐ฏ Purpose The chatbot will: โข Help users with CV creation using Seirah โข Resolve common Seirah.com platform issues
-
๐ Examples of User Data Privacy Concerns These define what your chatbot should not store, log, or expose: Concern | Example โ Storing sensitive data | CV content, phone numbers, emails unless needed temporarily โ Exposing private info in responses | Revealing another user's CV if mistakenly queried โ Data minimization | Only use/return what's necessary per question โ GDPR/CCPA compliance | Optional: include opt-in logs, data deletion support
โ Recommendation: Add clear instructions: "This chatbot does not store or retain any of your private CV data."
-
๐ Example Platform Integrations to Consider Use Case Integration Save generated CV Connect chatbot to Seirah's CV API or Firebase Upload/edit info Let chatbot update user profile or experience Export formats Chatbot offers PDF, DOCX export links Analytics Log usage to PostHog or internal metrics platform Live fallback If chatbot can't help, escalate to human (Zendesk, Intercom, etc.)
-
โ Next Step
-
Generate an enhanced seirah.txt mock file based on real Seirah user data and issues
-
Enable Arabic/English response selection automatically based on input
-
Set up the LangChain backend with history and language support
-
Add conversation memory (multi-turn) 5โข Support Arabic/English auto-response 6โข Return simplified output (only the reply text)
-
Test code: From the backend: curl -X POST http://localhost:8000/chat
-H "Content-Type: application/json"
-d '{"message": "ููู ุฃูุดุฆ ุณูุฑุฉ ุฐุงุชูุฉุ"}'
From the frontend: ููู ุฃูุดุฆ ุณูุฑุฉ ุฐุงุชูุฉุ"