Codync
A free, open-source 1:1 alternative to Grok Bot and Muse. Message Claude Code, Codex, Cursor and 40+ coding agents as persistent bots from your iPhone, Mac or Linux desktop. Group chats, threads, appr
Free, open-source Next.js platform for building RAG-powered AI chatbots. MIT licensed and self-hosted: build, brand, and monetize chatbots for yourself or your clients.
Developer toolsJavaScript · TypeScriptGitHub @areia-aiOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Open-source Next.js platform for RAG-powered AI chatbots: 100+ models, pgvector search, visual config UI, voice, WhatsApp, and MCP tools. MIT licensed.
Taken from the repository README
Loading the full README.
Read the full README ↗Before setup, decide which architecture fits your use case. ChatRAG supports two modes with the same codebase:
One Knowledge Base, Multiple Users
┌─────────────────────────┐
│ Application │
├─────────────────────────┤
│ Shared Knowledge Base │
│ (All users access same │
│ documents) │
├─────────────────────────┤
│ User A │ User B │ User C│
│ Chats │ Chats │ Chats │
│(Private)│(Private)│(Private)│
└─────────────────────────┘
Perfect For:
Features:
Isolated Workspaces, Team Collaboration
┌──────────────────────────────┐
│ Application │
├──────────────────────────────┤
│ User A │ User B │ Team C │
│ Personal │Personal │Shared │
│ Workspace │Workspace│Workspace│
│(Auto) │(Auto) │(Created)│
├───────────┼─────────┼────────┤
│Private KB │Private KB│Team KB │
└──────────────────────────────┘
Perfect For:
Features:
Are you building a SaaS product with multiple customers?
├─ YES → Multi-Tenant Mode
│ └─ Each customer needs isolated data
│
└─ NO → Does everyone access the same knowledge base?
├─ YES → Single-Tenant Mode
│ └─ Perfect for chatbots, docs, assistants
│
└─ NO → Need team collaboration?
├─ YES → Multi-Tenant Mode
│ └─ Teams with shared workspaces
│
└─ NO → Single-Tenant Mode
└─ Simplest option
| Feature | Single-Tenant | Multi-Tenant |
|---|---|---|
| Knowledge Base | Shared globally | Isolated per organization |
| Chat History | User-isolated | User + Org isolated |
| Team Management | ❌ No | ✅ Roles (owner/admin/member/viewer) |
| Document Isolation | ❌ No | ✅ Complete isolation |
| Storage Quotas | ❌ No | ✅ Per-organization |
| Subscriptions | User-level | Organization-level |
| Team Invitations | ❌ No | ✅ Email-based |
| Setup Time | ~10 minutes | ~20 minutes |
| Database Tables | 14 tables | 18 tables |
| Best For | Single product/service | SaaS platforms |
📖 Need More Details? See the complete comparison and implementation reference in README_DEPLOYMENT_MODES.md.
🚀 Ship in Minutes
Visual config UI lets you launch a production-ready chatbot in under 10 minutes
💪 Enterprise Ready
Dual-mode architecture with RLS, real-time updates, and battle-tested security
♾️ Unlimited Deployment
Build unlimited chatbots for yourself or clients with full white-label support
Language Models
Advanced Features
HNSW-Optimized Vector Search - Lightning-fast semantic search
| Feature | Description |
|---|---|
| Vector Search | HNSW indexes with 15-28x speed improvement |
| Query Time | <50ms for semantic search |
| Document Support | PDF, DOCX, TXT, HTML, RTF, EPUB |
| Smart Processing | Auto-chunking with configurable overlap |
| Embeddings | 1536-dimensional vectors (OpenAI) |
| Pure Semantic | Simplified for better accuracy |
✅ Node.js >=20.9.0 and npm
✅ Supabase account (free tier works)
✅ OpenAI API key (for embeddings)
✅ At least one AI provider API key
For: AI Twins, Product Documentation, Internal Knowledge Bases
git clone https://github.com/areia-ai/chatrag.git
cd chatrag
npm install
Option A: Interactive (Recommended)
npm run configure-deployment
# Select "1" for Single-Tenant
# Follow prompts for API keys
Option B: Manual
# Create .env.local with:
NEXT_PUBLIC_CHATRAG_DEPLOYMENT_MODE=single-tenant
# Database
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# AI
OPENAI_API_KEY=your_openai_key
OPENROUTER_API_KEY=your_openrouter_key
# Option 1: Automatic
npm run db:setup
# Option 2: Manual via Supabase Dashboard
# 1. Go to: https://supabase.com/dashboard/project/YOUR_PROJECT/sql/new
# 2. Copy contents of: supabase/single-tenant-setup.sql
# 3. Paste and execute
# Start configuration UI (optional but recommended)
npm run config # http://localhost:3333
# Start your chatbot
npm run dev # http://localhost:3000
✅ Done! Your single-tenant chatbot is ready. All users will access the same knowledge base with private chat history.
For: SaaS Products, Enterprise Deployments, Agency Solutions
git clone https://github.com/areia-ai/chatrag.git
cd chatrag
npm install
Option A: Interactive (Recommended)
npm run configure-deployment
# Select "2" for Multi-Tenant
# Follow prompts for API keys
# Enable multi-tenant features when asked
Option B: Manual
# Create .env.local with:
NEXT_PUBLIC_CHATRAG_DEPLOYMENT_MODE=multi-tenant
# Multi-Tenant Features
ENABLE_ORGANIZATIONS=true
ENABLE_TEAM_INVITES=true
ENABLE_STORAGE_QUOTAS=true
ENABLE_USAGE_ANALYTICS=true
# Database
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# AI
OPENAI_API_KEY=your_openai_key
OPENROUTER_API_KEY=your_openrouter_key
# Option 1: Automatic
npm run db:setup
# Option 2: Manual via Supabase Dashboard
# 1. Go to: https://supabase.com/dashboard/project/YOUR_PROJECT/sql/new
# 2. Copy contents of: supabase/multi-tenant-setup.sql
# 3. Paste and execute
# Start configuration UI (optional but recommended)
npm run config # http://localhost:3333
# Start your chatbot
npm run dev # http://localhost:3000
Auto-Personal Organizations:
Team Workspaces:
// Users can create team workspaces via UI or API
POST /api/organizations
{
"name": "Acme Corp",
"slug": "acme-corp"
}
✅ Done! Your multi-tenant platform is ready. Users get personal workspaces automatically and can create team workspaces.
Learn More:
Support for the latest reasoning-capable AI models:
| Model | Method | Configuration |
|---|---|---|
| OpenAI o1/o3 | Effort levels | low / medium / high |
| Claude 3.7+ | Token-based | Up to 32k reasoning tokens |
| DeepSeek R1 | Dual method | Effort + tokens |
| Gemini Thinking | Token-based | Configurable limits |
Configure globally or per-message:
NEXT_PUBLIC_REASONING_ENABLED=true
NEXT_PUBLIC_DEFAULT_REASONING_EFFORT=medium
NEXT_PUBLIC_MAX_REASONING_TOKENS=8000
Document Processing
Intelligent chunking with configurable overlap for optimal context
HNSW Search
15-28x faster with production-optimized indexes (m=64, ef=200)
Semantic Matching
Pure vector similarity for accurate, relevant results
Dual-Provider Architecture - Maximum flexibility and reliability
// Automatically selects based on config
WHATSAPP_PROVIDER=koyeb // or flyio
Features:
Access at http://localhost:3333 to configure:
Organizations & Workspaces:
Team Collaboration:
Data Isolation:
Subscription Management:
Your RAG_SYSTEM_PROMPT MUST include {{context}}:
You are an AI assistant with access to documents.
Context:
{{context}}
Answer based on the context above.
⚠️ Without {{context}}, RAG won't work!
# Embedding model (best performance)
OPENAI_EMBEDDING_MODEL=text-embedding-3-small
# WhatsApp provider (choose koyeb or flyio)
WHATSAPP_PROVIDER=flyio
| Metric | Traditional RAG | ChatRAG (HNSW) | Improvement |
|---|---|---|---|
| Single Query | 100-500ms | <50ms | 🚀 15-28x |
| 10 Concurrent Users | 800-2000ms | <100ms | 🚀 20x |
| 100k Documents | 1-3 seconds | <200ms | 🚀 15x |
| Accuracy | 95% | 98% | ✨ +3% |
chatrag/
├── src/
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ └── lib/ # Core utilities
│ ├── mcp/ # MCP integration
│ └── whatsapp/ # WhatsApp providers
├── voice-agent/ # Real-time voice service (LiveKit)
├── baileys-whatsapp/ # WhatsApp integration service
├── scripts/
│ └── config-ui/ # Visual config UI
├── supabase/
│ ├── single-tenant-setup.sql
│ └── multi-tenant-setup.sql
└── AGENTS.md # Canonical AI assistant guide
Single-Tenant (14 tables):
document_chunks - Vector embeddingsdocuments - File metadatachats - Conversationsfolders - Organizationsubscriptions - PaymentsMulti-Tenant (18 tables):
organizations - Workspacesorganization_members - Team with rolesteam_invitations - Invitation systemtenant_usage - Usage trackingREADME_DEPLOYMENT_MODES.mdChatRAG is optimized for AI-assisted development. Use:
Claude Code
CLAUDE.md imports AGENTS.md, so Claude Code picks up the rules automatically.
Cursor IDE
# Cursor reads AGENTS.md automatically.
# To pin it as a Project Rule instead:
mkdir -p .cursor/rules
cp AGENTS.md .cursor/rules/chatrag.md
Windsurf IDE
# Add as a Workspace Rule
# Copy relevant sections from AGENTS.md
# into Windsurf's Rules settings
Other AI Tools (Copilot, Codeium, Gemini, etc.)
# Reference AGENTS.md manually
# Copy relevant sections when prompting
💡 Tip: AGENTS.md contains all the context agents need. Adapt to your tool's rules format if needed.
If you ever see UI jank during heavy local dev, you can temporarily enable these env flags, then restart npm run dev:
# Disable verbose console spam from debugging
NEXT_PUBLIC_DISABLE_DEBUG_LOGS=true
# Reduce animations during profiling
NEXT_PUBLIC_REDUCED_MOTION=true
# Opt-in when profiling component render times
NEXT_PUBLIC_ENABLE_PERF_MONITOR=false
Best practices that prevent re-renders:
useShallow from zustand/react/shallow instead of subscribing to the whole store.NEXT_PUBLIC_CHATRAG_DEPLOYMENT_MODE in .env.localENABLE_ORGANIZATIONS=true and other flags are setnpm run db:setup again with correct mode{{context}} exists in RAG_SYSTEM_PROMPTtext-embedding-3-smallsupabase/fix-multi-tenant-rls.sqlENABLE_ORGANIZATIONS=truePull requests are welcome. Read CONTRIBUTING.md first, and AGENTS.md if you're pointing an AI agent at the code. Report security issues privately as described in SECURITY.md, not in a public issue.
ChatRAG is released under the MIT License. Use it, change it, ship it to clients, or build a product on it, commercial or not. Keep the copyright notice and license text in your copies.
The license covers the code, not the ChatRAG name or logo. If you publish or sell your own version, give it its own name. See TRADEMARKS.md.
Built with amazing technologies:
Built with 🧡 for developers who ship fast