A sophisticated B2B sales demo platform featuring AI-powered chatbot, Lakera Guard integration, RAG capabilities, and ToolHive integration.
- Skinnable B2B Landing Page with customizable branding
- AI Chatbot with ReAct agent architecture and smart autocomplete
- Lakera Guard Integration with blocking/watching modes for content moderation
- Demo Prompt Corpus with autocomplete functionality (right arrow key trigger)
- RAG System supporting file uploads and AI-generated seed packs
- ToolHive Integration via MCP tools
- Admin Console for complete configuration management
- Export/Import JSON skins for easy sharing
- Frontend: Vite + React + TypeScript + Tailwind CSS
- Backend: FastAPI + SQLite + ChromaDB
- LLM: OpenAI (chat + embeddings)
- Vector DB: ChromaDB for RAG
- Security: Lakera Guard for content moderation
- Python 3.8+
- Node.js 16+
- OpenAI API key
- Lakera API key (optional)
git clone <repository-url>
cd lakeraclientdemov2The easiest way to get started is using the start_all.py script, which handles most of the setup for you:
# 1. First, create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 2. Then run the startup script
python start_all.pyThe script will:
- Install all Python dependencies from
requirements.txt - Install all Node.js dependencies from
package.json - Start the backend server on port 8000
- Start the frontend server on port 3000
- Open your browser to the demo page
Note: You still need to create and activate the virtual environment first, but the script handles all the dependency installation and service startup for you.
If you prefer to set up the components manually or need more control:
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start backend server
python start_backend.py# Install dependencies
npm install
# Start development server
npm run devTerminal 1 - Backend:
python start_backend.pyTerminal 2 - Frontend:
npm run dev- Demo Page: http://localhost:3000
- Admin Console: http://localhost:3000/admin
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs (if available)
- Navigate to the Admin Console at http://localhost:3000/admin
- Go to the Security tab
- Enter your OpenAI API key
- Optionally enter your Lakera API key and enable Lakera Guard
- Configure other settings as needed
In the Branding tab:
- Set your business name and tagline
- Upload logo and hero images
- Customize hero text
In the LLM tab:
- Select OpenAI model (GPT-4o, GPT-4o-mini, etc.)
- Adjust temperature (0-10 scale)
- Customize system prompt
In the RAG tab:
- Upload documents (PDF, MD, TXT, CSV)
- Generate AI-powered seed packs
- View ingested content
In the Tools tab:
- Add custom tools
- Configure MCP endpoints
- Test tool functionality
In the Demo Prompts tab:
- Create curated demo prompts for different scenarios
- Organize prompts by category (general, security, tools, rag, malicious)
- Add tags for easy searching
- Mark prompts as malicious for security testing
- Track usage statistics
Chat Autocomplete:
- Start typing in the chat (minimum 2 characters)
- See real-time suggestions with autocomplete overlay
- Press right arrow key (β) to complete the current suggestion
- Click on suggestions in the dropdown to select them
- Escape key to dismiss suggestions
GET /config- Get current configurationPUT /config- Update configurationPOST /config/export- Export config as JSONPOST /config/import- Import config from JSON
POST /chat- Send message to AI assistant
POST /rag/upload- Upload documentsPOST /rag/generate- Generate AI contentGET /rag/search- Search stored content
GET /tools- List toolsPOST /tools- Create toolPUT /tools/{id}- Update toolDELETE /tools/{id}- Delete toolPOST /tools/test/{id}- Test tool
GET /lakera/last- Get last guardrail result
GET /demo-prompts- List demo promptsGET /demo-prompts/search- Search demo prompts with autocompletePOST /demo-prompts- Create demo promptPUT /demo-prompts/{id}- Update demo promptDELETE /demo-prompts/{id}- Delete demo promptPOST /demo-prompts/{id}/use- Track prompt usage
lakeraclientdemov2/
βββ backend/ # FastAPI backend
β βββ __init__.py
β βββ main.py # FastAPI app
β βββ models.py # SQLAlchemy models
β βββ schemas.py # Pydantic schemas
β βββ database.py # Database connection
β βββ openai_client.py # OpenAI integration
β βββ rag.py # RAG service
β βββ lakera.py # Lakera integration
β βββ toolhive.py # ToolHive service
β βββ agent.py # ReAct agent
βββ src/ # React frontend
β βββ components/ # React components
β β βββ ChatWidget.tsx # Chat with autocomplete
β β βββ DemoPromptManager.tsx # Prompt management
β β βββ ...
β βββ pages/ # Page components
β βββ services/ # API services
β βββ types/ # TypeScript types
β βββ ...
βββ data/ # Data storage
β βββ agentic_demo.db # SQLite database
β βββ chroma/ # ChromaDB vectors
βββ uploads/ # Uploaded files
βββ exports/ # Exported configs
βββ requirements.txt # Python dependencies
βββ package.json # Node.js dependencies
βββ start_backend.py # Backend startup script
βββ README.md # This file
- Real-time chat with AI assistant
- Smart autocomplete with demo prompt corpus
- Tool usage tracking
- Lakera guardrail monitoring
- Message history
- Content moderation with blocking/watching modes
- Guardrail enforcement (blocking mode) or monitoring (watching mode)
- Real-time status monitoring
- Detailed violation reporting with TL;DR summaries
- Document upload (PDF, MD, TXT, CSV)
- AI-generated content creation
- Semantic search
- Content chunking and embedding
- Calculator tool
- HTTP fetch tool
- Calendar lookup
- GitHub repository info
- Custom tool addition
- Curated prompt library for consistent demos
- Category-based organization (general, security, tools, rag, malicious)
- Tag-based search and filtering
- Usage tracking and analytics
- Smart autocomplete in chat interface
- Right arrow key (β) completion trigger
- Visual indicators for malicious prompts
- Admin interface for prompt management
- API key masking in UI
- Secure file upload validation
- Content moderation via Lakera
- Input sanitization
- CORS configuration
- Go to Admin Console β Export/Import
- Click "Export Config"
- Download JSON file with all settings
- Go to Admin Console β Export/Import
- Upload previously exported JSON file
- Configuration will be restored
-
Backend won't start
- Check Python version (3.8+)
- Verify all dependencies installed
- Check port 8000 availability
-
Frontend won't start
- Check Node.js version (16+)
- Run
npm install - Check port 3000 availability
-
API errors
- Verify OpenAI API key is set
- Check network connectivity
- Review browser console for CORS issues
-
Database issues
- Delete
data/folder to reset - Check file permissions
- Verify SQLite installation
- Delete
- Backend logs: Check terminal running
start_backend.py - Frontend logs: Check browser console
- API logs: Check backend terminal output
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For issues and questions:
- Check the troubleshooting section
- Check the browser console for errors
- Review backend logs in the terminal
- Check the API endpoints in the code if needed
Happy Demo-ing! π