A custom chatbot built with NestJS, MongoDB, PostgreSQL with pgvector extension for vector similarity search. This project implements a sophisticated chatbot system with authentication, monitoring, and vector-based search capabilities.
- Vector similarity search using pgvector
- Authentication and authorization
- MongoDB for document storage
- PostgreSQL for vector storage
- Monitoring with Prometheus and Grafana
-
- Swagger API documentation
- Internationalization support
- CSV data processing
- Redis caching
- Security features (XSS protection, JWT)
- Node.js (>= v16)
- MongoDB
- PostgreSQL (with pgvector extension)
- Ollama (for text embeddings)
- Redis
- Docker and Docker Compose (optional)
- Clone the repository
- Copy
.env.exampleto.envand update the following variables:
# Application
PORT=
NODE_ENV=
# PostgreSQL
POSTGRES_HOST=
POSTGRES_PORT=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DATABASE=
DB_SCHEMA=
# MongoDB
MONGODB_URI=your_mongodb_connection_string
# Redis
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
# JWT
JWT_SECRET=
JWT_EXPIRATION=
- Install dependencies:
yarn install- Start the development server:
yarn start:dev- Access the API documentation at
http://localhost:3000/api
yarn start- Start the applicationyarn start:dev- Start the application in development mode with hot-reloadyarn start:debug- Start the application in debug modeyarn start:prod- Start the application in production modeyarn build- Build the applicationyarn test- Run testsyarn test:watch- Run tests in watch modeyarn test:coverage- Run tests with coverage reportyarn lint- Run ESLintyarn format- Format code with Prettieryarn seed:up- Run database seedsyarn create:admin- Create a super admin user
src/
├── common/ # Shared modules and utilities
├── config/ # Configuration files
├── helper/ # Helper functions and utilities
├── modules/ # Feature modules
│ ├── auth/ # Authentication module
│ ├── chatbot/ # Chatbot core functionality
│ └── ... # Other feature modules
├── main.ts # Application entry point
└── app.module.ts # Root module
The application includes Prometheus metrics and Grafana dashboards:
- Prometheus configuration:
prometheus.yml - Grafana dashboard:
grafana-dashboard.json
Additional documentation can be found in:
LANGGRAPH_FLOW.md- LangGraph implementation detailsPROBLEM_STATEMENT.md- Project requirementsPROJECT_PLAN.md- Project planning and architectureSETUP.md- Detailed setup instructions
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License.
