https://github.com/anurag6569201/lyzr-founder
A self-serve platform to build, train, and deploy plug-and-play AI customer support widgets. Powered by Lyzr, Django, and React.
https://github.com/anurag6569201/lyzr-founder
ai ai-agent azure celery chat-widget chatbot customer-support django django-rest-framework full-stack javascript llm lyzr natural-language-processing python rag react sass websockets
Last synced: about 2 months ago
JSON representation
A self-serve platform to build, train, and deploy plug-and-play AI customer support widgets. Powered by Lyzr, Django, and React.
- Host: GitHub
- URL: https://github.com/anurag6569201/lyzr-founder
- Owner: anurag6569201
- Created: 2025-07-27T03:28:48.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-03T08:32:48.000Z (2 months ago)
- Last Synced: 2025-08-03T09:09:40.383Z (2 months ago)
- Topics: ai, ai-agent, azure, celery, chat-widget, chatbot, customer-support, django, django-rest-framework, full-stack, javascript, llm, lyzr, natural-language-processing, python, rag, react, sass, websockets
- Language: JavaScript
- Homepage: https://lyzr-founder.vercel.app
- Size: 3.18 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LyzrFoundry - Plug-and-Play AI Chatbot Platform

[](https://www.python.org/)
[](https://www.djangoproject.com/)
[](https://reactjs.org/)
[](https://docs.celeryq.dev/en/stable/)
[](https://channels.readthedocs.io/en/latest/)**LyzrFoundry** is a powerful, self-serve platform for building, training, and deploying AI-powered customer support chatbots. Inspired by services like Chatbase, it provides a seamless "plug-and-play" experience, allowing users to go from signup to a live chat widget on their website in minutes.
The platform is built with a robust backend using Django and a modern, responsive frontend using React, providing a complete solution for creating and managing intelligent Lyzr agents.
### 🚀 Deployment & Demo
**[Watch Demo on YouTube](https://youtu.be/f2Vd8sH0UeE?si=Qbej6OW1niTDsIKq)**
[](https://youtu.be/f2Vd8sH0UeE?si=Qbej6OW1niTDsIKq)**[Live Frontend on Vercel](https://lyzr-founder.vercel.app)**
[](https://lyzr-founder.vercel.app)**[Live Backend on Azure](https://lyzr-ai.azurewebsites.net)**
[](https://lyzr-ai.azurewebsites.net)## Features
| Feature Area | Status & Key Capabilities |
| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Agent Lifecycle Management**| ✅ **Complete**: Create, configure, test, and deploy AI agents. Full control over persona, goals, instructions, and LLM parameters. |
| **Knowledge Base Training** | ✅ **Complete**: Asynchronously train agents via document uploads (`.pdf`, `.docx`, `.txt`) or website URL scraping. |
| **Live Chat & Deployment** | ✅ **Complete**: Real-time chat playground for testing. A single `` tag for embedding a customizable, conflict-free widget on any website. |
| **Intelligent Ticketing** | ✅ **Complete**: Proactive "Live Conversations" inbox. Manual & automatic ticket creation. AI-powered summarization of chats into ticket titles. |
| **Team Collaboration** | ✅ **Complete**: Invite members via email. Role-based access (Admin/Member). Assign tickets to specific teams and individuals. |
| **Billing & Subscriptions** | ✅ **Complete**: Razorpay integration for subscriptions. Multi-tiered plans (Free, Pro). Automated enforcement of plan limits (agents, messages, etc.). |
| **Analytics & Insights** | ✅ **Complete**: Dashboard with KPIs like total conversations, chat volume trends, and recent ticket activity. |
| **Authentication** | ✅ **Complete**: Secure JWT-based authentication with email/password and OTP verification for signups. |## Key Features in Detail
- **Self-Serve User Flow**: A complete onboarding process from user registration (with OTP) and login to agent creation.
- **Advanced Agent Tuning**: A dedicated UI to configure every aspect of the AI agent, including:
- **Identity**: Name, description, and persona.
- **Behavior**: Goals, step-by-step instructions, and few-shot examples.
- **Model Configuration**: Choice of LLMs (GPT-4o Mini, GPT-4 Turbo, Gemini), temperature, and other advanced settings.
- **Knowledge Base Management**:
- Easily train agents by uploading documents (`.pdf`, `.docx`, `.txt`) or scraping website content via URLs.
- View the status of knowledge sources as they are indexed asynchronously by Celery.
- **"Live Conversations" Inbox**: Monitor all ongoing chats that have not yet become tickets, allowing support agents to proactively intervene and escalate if needed.
- **Intelligent Ticketing System**:
- Users can trigger tickets via keywords (`agent`, `help`) or dedicated UI buttons.
- Agents can manually create tickets from the "Live Conversations" inbox.
- **AI-Powered Summarization**: Uses a dedicated Lyzr agent to automatically summarize chat transcripts into concise ticket titles.
- View full conversation history directly within the ticket detail view—no context switching required.
- Add internal notes, change status (New, Open, Solved, etc.), and set priority.
- **Full Team Collaboration Suite**:
- Create teams and invite new members via email.
- Manage member roles (Admin, Member).
- Assign tickets to specific teams and individuals for clear ownership.
- **Subscription & Plan Enforcement**:
- Tiered pricing plans (Free, Pro) managed in the database.
- Full integration with Razorpay for handling subscriptions.
- **Automated Limit Enforcement**: The backend actively prevents users from creating more resources (agents, team members, etc.) or sending messages beyond their current plan's limits.## Architecture & Flow Diagrams
### 1. High-Level System Architecture
### 2. Self-Serve User Flow
### 3. Agent Training & Chat Flow (Async)

## Tech Stack
| Category | Technology |
| :------------ | :-------------------------------------------------------------------------------------------------------------------------------------- |
| **Frontend** | [React](https://react.dev/), [Vite](https://vitejs.dev/), [Tailwind CSS](https://tailwindcss.com/), [shadcn/ui](https://ui.shadcn.com/), [@tanstack/react-query](https://tanstack.com/query/latest) |
| **Backend** | [Python](https://www.python.org/), [Django](https://www.djangoproject.com/), [Django REST Framework](https://www.django-rest-framework.org/), [Django Channels](https://channels.readthedocs.io/), [Celery](https://docs.celeryq.dev/en/stable/) |
| **Database** | [Azure Database for PostgreSQL](https://azure.microsoft.com/en-us/products/postgresql/) |
| **Cache/Broker**| [Azure Cache for Redis](https://azure.microsoft.com/en-us/products/redis-cache/) |
| **Storage** | [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) |
| **Deployment**| [Daphne](https://github.com/django/daphne), [Whitenoise](http://whitenoise.evans.io/en/stable/) |## Getting Started
Follow these instructions to set up and run the project on your local machine.
### Prerequisites
- Python 3.12+
- Node.js 18+ and npm
- PostgreSQL
- Redis
- An active Lyzr AI account with credentials.### Backend Setup
1. **Clone the repository:**
```bash
git clone https://github.com/anurag6569201/lyzr-founder.git
cd lyzr-founder/lyzr-backend
```2. **Create and activate a virtual environment:**
```bash
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```3. **Install Python dependencies:**
```bash
pip install -r requirements.txt
```4. **Set up environment variables:**
Create a `.env` file in the `lyzr-backend` directory.
```env
# Django
SECRET_KEY=your-strong-secret-key
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost# Database
DATABASE_URL=postgres://user:password@host:port/dbname
DB_SSL_REQUIRE=False # Usually False for local dev# Celery and Channels Broker URL using Redis
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
CHANNEL_LAYER_REDIS_URL=redis://localhost:6379/1# Azure Storage (Optional for local dev, but required for file uploads)
AZURE_ACCOUNT_NAME=your-azure-storage-account-name
AZURE_ACCOUNT_KEY=your-azure-storage-account-key
AZURE_CONTAINER=lyzr-db# Lyzr API Credentials
LYZR_API_KEY=your-lyzr-api-key
LYZR_AGENT_API_BASE_URL=https://agent-prod.studio.lyzr.ai
LYZR_RAG_API_BASE_URL=https://rag-prod.studio.lyzr.ai
LYZR_LLM_CREDENTIAL_ID=your-lyzr-llm-credential-id
LYZR_EMBEDDING_CREDENTIAL_ID=your-lyzr-embedding-credential-id
LYZR_VECTOR_DB_CREDENTIAL_ID=your-lyzr-vector-db-credential-id
LYZR_SUMMARIZER_AGENT_ID=your-dedicated-summarizer-agent-id
LYZR_LLM_PROVIDER_ID="OpenAI"# Razorpay Credentials
RAZORPAY_KEY_ID=your-razorpay-key-id
RAZORPAY_KEY_SECRET=your-razorpay-key-secret
RAZORPAY_WEBHOOK_SECRET=your-razorpay-webhook-secret
```5. **Run database migrations:**
```bash
python manage.py migrate
```6. **Run the backend services (requires 3 separate terminals):**
- **Terminal 1: Django Server (Daphne)**
```bash
daphne -p 8000 lyzr_backend.asgi:application
```
- **Terminal 2: Celery Worker**
```bash
celery -A lyzr_backend.celery worker -l info
```
- **Terminal 3: Celery Beat (Scheduler)**
```bash
celery -A lyzr_backend.celery beat -l info
```The backend API will be available at `http://127.0.0.1:8000`.
### Frontend Setup
1. **Navigate to the frontend directory:**
```bash
# From the root project directory
cd frontend
```2. **Install JavaScript dependencies:**
```bash
npm install
```3. **Set up environment variables:**
Create a `.env.local` file in the `frontend` directory.
```env
VITE_REACT_APP_API_BASE_URL=http://127.0.0.1:8000/api/v1
VITE_APP_WS_URL=127.0.0.1:8000
```4. **Run the React development server (in a new terminal):**
```bash
npm run dev
```
The frontend application will be available at `http://localhost:5173` (or another port if 5173 is in use).### Production Deployment
For a production environment (like Azure Web Apps), you would use a startup script to manage the processes.
**`startup.sh`**
```bash
#!/bin/bash
set -eecho "Applying database migrations..."
python manage.py migrate --noinputecho "Cleaning up old Celery Beat schedule..."
rm -f celerybeat-scheduleecho "Starting Celery worker in the background..."
celery -A lyzr_backend.celery worker -l info --pool=threads &echo "Starting Celery Beat scheduler in the background..."
celery -A lyzr_backend.celery beat -l info &echo "Starting Daphne server (in foreground)..."
exec daphne -b 0.0.0.0 -p 8000 lyzr_backend.asgi:application
```## API Usage
A Postman collection is available in the repository:
[`postman_api/v2/LyzrFoundry_v2.postman_environment.json`](postman_api/v2/LyzrFoundry_v2.postman_environment.json)Import this collection into Postman to explore and test all available API endpoints.
### Key API Endpoints
- `/api/v1/auth/` - User registration, OTP, and login.
- `/api/v1/agents/` - Manage agents, including a status check at `/api/v1/agents/{id}/status/`.
- `/api/v1/agents/{agent_pk}/knowledge-sources/` - Manage knowledge sources for an agent.
- `/api/v1/tickets/` - List, create, and manage support tickets.
- `/api/v1/conversations/` - List and retrieve details of non-ticketed chats.
- `/api/v1/teams/` - List, create, and manage teams and members.
- `/api/v1/invitations/` - View and respond to team invitations.
- `/api/v1/billing/` - View plans and manage subscriptions.