Base Chat is a multi-tenant RAG chatbot that uses Ragie Connect to allow users to connect and chat with their organization's knowledgebase. It serves as a reference application showcasing Ragie's features.
NOTE: This project is under active development and may include breaking changes in subsequent releases.
- Multi-tenant Architecture: Support for multiple organizations in a single deployment
- RAG (Retrieval-Augmented Generation): AI responses enhanced with knowledge from your organization's documents
- Knowledge Management: Connect to various data sources through Ragie Connect
- Authentication: Secure login using Auth.js with Google provider support
- Customization: Add your organization's logo and customize the chat interface
- Multiple LLM Support: Compatible with OpenAI, Google AI, Anthropic, Groq, and more
- Node.js 22+
- PostgreSQL database
- Ragie API key (get one at ragie.ai)
- API keys for supported LLM providers (OpenAI, Google AI, Anthropic, or Groq)
- Google OAuth credentials (for authentication)
Base Chat is built with Next.js and uses Auth.js for authentication.
-
Clone and install dependencies
git clone https://github.com/ragieai/basechat.git cd basechat npm install -
Database setup
# Create PostgreSQL database createdb basechat -
Environment configuration
# Copy environment variables template cp env.example .env # Edit .env file to add required credentials and configuration # Required minimums: # - DATABASE_URL # - RAGIE_API_KEY # - At least one LLM provider API key (OPENAI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY, etc.) # - AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET # - ENCRYPTION_KEY (generate with: openssl rand -hex 32) # - DEFAULT_PARTITION_LIMIT
-
Set up database schema
npm run db:migrate
-
Start development server
npm run dev
The application will be available at http://localhost:3000.
Base Chat includes Docker support for easy deployment:
# Build Docker image
docker build -t basechat .
# Run container (adjust environment variables as needed)
docker run -p 3000:3000 --env-file .env basechatKey environment variables include:
| Variable | Description | Required |
|---|---|---|
| DATABASE_URL | PostgreSQL connection string | Yes |
| RAGIE_API_KEY | API key from Ragie | Yes |
| OPENAI_API_KEY | OpenAI API key | One LLM required |
| GOOGLE_GENERATIVE_AI_API_KEY | Google AI API key | One LLM required |
| ANTHROPIC_API_KEY | Anthropic API key | One LLM required |
| GROQ_API_KEY | Groq API key | One LLM required |
| AUTH_GOOGLE_ID | Google OAuth client ID | Yes |
| AUTH_GOOGLE_SECRET | Google OAuth client secret | Yes |
| ENCRYPTION_KEY | 32-byte hex key for encryption | Yes |
| STORAGE_* | Object storage settings for logo uploads | No |
See env.example for a complete list of configuration options.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run db:migrate- Run database migrationsnpm run update-api-key- Update your Ragie API key
Distributed under the MIT License. See LICENSE.txt for more information.