An end-to-end AI-powered support system built with FastAPI, MLflow, FAISS, and Next.js.
The chatbot handles customer queries, retrieves answers from a knowledge base, tracks conversation context, and connects to human support when needed.
ai-customer-assistant.mp4
- Conversational AI: Handles customer queries via
/v1/conversations. - Knowledge Base (
FAISS): Stores documents and provides context-aware responses. - Intent Recognition: MLflow-hosted Logistic Regression model to classify intents.
- Entity Extraction:
spaCy-based NERfor extracting order IDs, dates, products, etc. - Redis Session Store: Keeps conversation context for personalized follow-ups.
- Frontend (
Next.js+MUI): Responsive chat UI for interaction. - Dockerized Microservices: Orchestrator, Intent Service, Response Service, KB Service, MLflow, and Redis.
- Frontend (
Next.js) → CallsorchestratorAPI. - Orchestrator (
FastAPI) → Routes queries to intent-service, response-service, and kb-service. - Intent Service → Uses
MLflow modelfor intent classification. - Response Service → Generates AI responses (OpenAI API).
- KB Service → Manages
FAISS vector DBand document embeddings. - Redis → Stores session context.
- Backend:
FastAPI,Redis,MLflow,FAISS,spaCy - Frontend:
Next.js,Material UI - AI Models:
Sentence Transformers,Logistic Regression (MLflow),OpenAI GPT - Deployment:
Docker Compose
- User sends a message from the frontend.
- Orchestrator routes request → intent detection, KB retrieval, LLM response.
- Response returned with context persistence in Redis.
Docker&Docker Composeinstalled- OpenAI API key (
OPENAI_API_KEY)
cd infra# Redis
REDIS_HOST=redis
REDIS_PORT=6379
# MLflow
MLFLOW_TRACKING_URI=http://mlflow:5000
MLFLOW_MODEL_NAME=customer_intent_classifier
MLFLOW_MODEL_STAGE=Production
# OpenAI
OPENAI_API_KEY=sk-proj-***
# KB Service
DATA_DIR=/app/data
INDEX_FILE=/app/data/faiss.index
DOCS_FILE=/app/data/docs.pkldocker-compose up -d --build mlflowruns on http://localhost:5000/
docker-compose run --rm trainerdocker-compose up -d --build frontendRuns on http://localhost:3000
{
"docs": [
"Refunds for orders can take 5-7 business days.",
"Premium users get priority responses within 2 hours."
]
}- Integration with external databases (orders, accounts).
- Authentication & RBAC.
- Analytics dashboard for query trends.