A production-grade AI chatbot using GPT-4 and LangChain for automated customer support, featuring semantic retrieval with FAISS.
- Real-time chat interface with markdown support
- Semantic search using FAISS for contextually relevant answers
- Integration with MongoDB for chat history and analytics
- Sentiment analysis and response tracking
- Scalable microservices architecture
- Frontend: React + TypeScript
- Backend: Node.js/Express + TypeScript
- AI Service: Python + LangChain + FAISS
- Database: MongoDB
- APIs: OpenAI GPT-4
- Node.js 16+
- Python 3.8+
- MongoDB
- OpenAI API key
- Clone the repository
- Copy environment files:
cp python-service/.env.example python-service/.env cp backend/.env.example backend/.env
- Update the environment files with your credentials
- Install dependencies:
- Frontend:
cd frontend && npm install - Backend:
cd backend && npm install - Python Service:
cd python-service && python -m venv venv && source venv/bin/activate && pip install -r requirements.txt
- Frontend:
Run all services in development mode:
./dev.shOr run services individually:
cd frontend
npm run devcd backend
npm run devcd python-service
source venv/bin/activate
python chatbot_service.py├── frontend/ # React frontend
├── backend/ # Node.js API gateway
└── python-service/ # Python AI service with LangChain
- POST
/api/chat- Request:
{ "query": string, "sessionId": string } - Response:
{ "response": string }
- Request:
- GET
/api/analytics/common-intents- Response:
[{ "_id": string, "count": number }]
- Response: