MyChat is a powerful tool that allows users to build custom AI chatbots trained on their own data (websites, PDFs, text). It provides a seamless experience for managing knowledge bases, training models, and embedding chat widgets into external websites.
Build your own AI chatbot in minutes β no coding required!
- Chat Spaces: Create and manage distinct chat environments (limited to 1 on Free Plan).
- Knowledge Base Management:
- Multi-format Support: Upload PDF, DOCX, HTML, TXT, and Markdown files.
- URL Scraping: Recursively scrapes websites (up to 10 pages) to build a knowledge base.
- Manual Entry: Direct text input with character limits and preview.
- Widget Control:
- Status Management: Toggle between Testing (badge visible), Live, and Maintenance (chat disabled) modes.
- Embeddable Widget: A lightweight, customizable chat widget.
- AI Personalization:
- Response Tone: Configure the AI's personality (Professional, Friendly, Enthusiastic, etc.).
- Knowledgebase Connectors: Connect external knowledge bases (Premium feature).
- RAG Pipeline:
- Automated content chunking and embedding generation using Qwen 2.5 (via OpenRouter).
- Vector search using cosine similarity (SQLite-compatible implementation).
- Context-aware responses using Gemini 2.5 Flash (via OpenRouter).
- Modern Dashboard: Built with Next.js and Shadcn UI for a premium look and feel.
- Real-time Feedback: Toast notifications, processing status indicators, and "thinking" animations.
- Markdown Support: Rich text rendering in chat responses (code blocks, tables, lists).
- Dark/Light Mode: Fully supported theme switching.
- Chat Spaces: Max 1.
- Links: Max 10 URLs per space.
- Documents: Max 5 files per space (PDF, DOCX, etc.).
- Data Usage: Max 5 MB processed text per space.
- Framework: Next.js 15 (App Router)
- Styling: Tailwind CSS, Tailwind Typography
- Components: Shadcn UI (Radix Primitives)
- Icons: Lucide React
- State/Feedback: React Hot Toast
- Runtime: Node.js
- Framework: Express.js
- Database: SQLite (with Sequelize ORM)
- AI/ML:
- OpenAI SDK (configured for OpenRouter)
- Cheerio (Web Scraping)
- PDF Parse
- Node.js (v18+)
- npm
git clone <repository-url>
cd mychatYou can run the entire stack using Docker Compose. This is the easiest way to get started.
Development Mode (with Hot Reload)
docker-compose up --build- Frontend:
http://localhost:3000 - Backend:
http://localhost:6002 - Changes to source files will automatically trigger updates.
Production Mode To run in production mode, you would typically build optimized images. For now, the provided Dockerfiles are configured for development.
If you prefer to run without Docker:
Navigate to the backend directory and install dependencies:
cd backend
npm installCreate a .env file in backend/ with the following variables:
PORT=6002
JWT_SECRET=your_super_secret_jwt_key
OPENROUTER_API_KEY=your_openrouter_api_keyStart the backend server:
npm run devThe backend will run on http://localhost:6002.
Navigate to the frontend directory and install dependencies:
cd ../frontend
npm installStart the frontend development server:
npm run devThe frontend will run on http://localhost:3000.
The project uses Postgres for simplicity and portability. The database file is located at backend/dev.db.
- Users: Authentication and account details.
- ChatSpaces: Configuration for chatbots (name, prompt, limits).
- Documents: Source files/URLs and their processing status.
- DocumentChunks: Vector embeddings and text chunks for RAG.
- Conversations: Chat session history.
- Messages: Individual chat messages.
We currently use Sequelize's sync({ alter: true }) for automatic schema updates during development.
For production-grade changes or manual fixes, SQL migration files can be placed in backend/migrations/ and applied via sqlite3.
- Sign Up: Create an account on the frontend.
- Create Space: Create your first Chat Space.
- Train: Add a URL (e.g., your documentation site) or paste text. Click "Process & Train".
- Test: Use the "Preview Chat" tab to test the bot's responses.
- Embed: Go to "Settings", copy the script tag, and paste it into your website's HTML.
We've included a demo.html file in the root directory to help you test the widget integration locally.
-
Ensure Backend is Running: The backend must be running on
http://localhost:6002to serve the widget script. -
Get Your Space ID:
- Go to your Chat Space dashboard.
- Navigate to Settings -> Embed.
- Copy the
data-chat-spaceID from the code snippet.
-
Update Demo File:
- Open
demo.htmlin a text editor. - Replace the
data-chat-spacevalue in the<script>tag with your actual Space ID.
- Open
-
Run the Demo: Due to CORS restrictions, you cannot simply open the file in your browser. You must serve it locally.
Using Python (Pre-installed on macOS/Linux):
# Run this in the project root python3 -m http.server 8000Then open
http://localhost:8000/demo.htmlUsing Node.js:
npx serve .Then open the URL provided (usually
http://localhost:3000/demo.html)
We welcome contributions from the community! Here's how you can help:
- Fork the repository and clone it locally.
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request with a clear description of your changes.
- Follow the existing code style and conventions.
- Write clear, descriptive commit messages.
- Add tests for new features where applicable.
- Update documentation as needed.
While MyChat is fully open-source and free to self-host, we offer commercial options for teams and businesses that need additional support:
- Managed Infrastructure β We handle deployment, scaling, and maintenance so you can focus on your business.
- Automatic Updates β Always run the latest version with security patches and new features.
- High Availability β Enterprise-grade uptime with redundant infrastructure.
- Custom Integrations β Connect MyChat with your existing tools (CRM, helpdesk, analytics).
- Advanced Analytics β Deep insights into chatbot performance and user interactions.
- Priority Support β Direct access to our engineering team for faster issue resolution.
- SLA Guarantees β Tailored service level agreements for business-critical deployments.
For cloud hosting, enterprise features, or custom development inquiries:
π§ Email: [email protected]
This project is licensed under the MIT License - see the LICENSE file for details.
