A powerful AI-powered chatbot that can process documents, sync with Notion, crawl websites, and provide intelligent responses based on your knowledge base using RAG (Retrieval-Augmented Generation).
- π Document Processing: Upload and process PDF, DOCX, and text files
- π Notion Integration: Sync with Notion workspaces automatically
- π·οΈ Website Crawling: Extract content from websites and sitemaps
- π¬ Intelligent Chat: AI-powered responses using your document knowledge base
- π Vector Search: Advanced semantic search using Qdrant vector database
- β‘ Real-time Processing: Background job processing with Redis queues
- π Secure Authentication: JWT-based user authentication
- π Multi-tenant: Support for multiple users with data isolation
- Node.js with Express.js
- MongoDB for document and user data storage
- Qdrant vector database for semantic search
- Redis for job queues and caching
- Bull for background job processing
- OpenAI/Gemini for AI responses
- JWT for authentication
- React with modern hooks
- Tailwind CSS for styling
- Socket.io for real-time chat
- Axios for API communication
- Node.js (v16 or higher)
- MongoDB
- Redis
- Qdrant vector database
- OpenAI API key or Google Gemini API key
-
Clone the repository
git clone https://github.com/4mJ0k3r/InquireAI.git cd InquireAI/chatbot -
Install dependencies
npm install cd apps/backend && npm install cd ../frontend && npm install
-
Set up environment variables
Copy the example environment file:
cp apps/backend/.env.example apps/backend/.env
Configure your
.envfile with:# Database MONGODB_URI=mongodb://localhost:27017/inquireai REDIS_URL=redis://localhost:6379 QDRANT_URL=http://localhost:6333 # AI Services OPENAI_API_KEY=your_openai_api_key GEMINI_API_KEY=your_gemini_api_key # Authentication JWT_SECRET=your_jwt_secret_key # Server PORT=4000 NODE_ENV=development
-
Start the services
Make sure you have the required services running:
- MongoDB
- Redis
- Qdrant
You can use Docker for easy setup:
# Start Qdrant docker run -p 6333:6333 qdrant/qdrant # Start Redis docker run -p 6379:6379 redis:alpine
-
Run the application
# Start backend (from chatbot directory) npm run dev # Start frontend (in another terminal) cd apps/frontend npm start
- Register a new account or login
- JWT tokens are used for secure API access
- Upload PDF, DOCX, or text files
- Files are automatically processed and embedded into the vector database
- Concurrent uploads are supported with intelligent job queue management
- Connect your Notion workspace
- Automatic syncing every 2 hours
- Manual sync available
- Pages are processed and made searchable
- Enter a website URL to crawl
- Automatic sitemap detection
- Content extraction and processing
- Configurable crawl limits
- Ask questions about your documents
- Real-time streaming responses
- Source citations included
- Context-aware answers using RAG
The application uses a sophisticated job queue system with Redis and Bull:
- Upload Worker: Processes file uploads and text extraction
- Chat Worker: Handles AI chat responses with streaming
- Notion Worker: Syncs Notion workspace content
- Crawler Worker: Processes website crawling jobs
- Google Docs Worker: Handles Google Docs imports
A unique feature that ensures job queue stability during concurrent operations:
- Garbage jobs are inserted at even positions to maintain odd positioning for real jobs
- Prevents race conditions during high-concurrency uploads
- Ensures 100% success rate for concurrent file processing
- Text Extraction: PDF/DOCX β Raw text
- Chunking: Split into semantic chunks
- Embedding: Generate vector embeddings
- Storage: Store in Qdrant with metadata
- Search: Semantic similarity search for chat responses
chatbot/
βββ apps/
β βββ backend/
β β βββ src/
β β β βββ models/ # MongoDB schemas
β β β βββ routes/ # API endpoints
β β β βββ services/ # Business logic
β β β βββ workers/ # Background job processors
β β β βββ middlewares/ # Express middlewares
β β β βββ utils/ # Utility functions
β β βββ uploads/ # File upload directory
β β βββ server.js # Express server
β βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β βββ public/ # Static assets
βββ package.json # Root package.json
βββ README.md # This file
POST /auth/register- Register new userPOST /auth/login- User loginPOST /auth/logout- User logout
POST /docs/upload- Upload filesGET /docs- List user documentsDELETE /docs/:id- Delete documentGET /docs/search- Search documents
POST /sources/notion/connect- Connect NotionPOST /sources/notion/sync- Manual Notion syncPOST /sources/crawl- Crawl websiteGET /sources- List connected sources
POST /chat- Start new chatGET /chat/stream/:chatId- Stream chat responses
- Connect your GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy automatically on push to main branch
# Build and run with Docker Compose
docker-compose up --build- Set up production environment variables
- Build the frontend:
npm run build - Start the backend:
npm start - Configure reverse proxy (nginx/Apache)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenAI for GPT models
- Google for Gemini AI
- Qdrant for vector database
- The open-source community for amazing tools and libraries
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Join our community discussions
Built with β€οΈ for the AI Agent Hackathon