A multi-agent AI system for exploring Jewish thought, practice, and meaning from a progressive Modern Orthodox perspective.
rebbe.dev is a chatbot that provides guidance on questions of Jewish law, ethics, and spirituality. It uses a multi-agent architecture where specialized agents handle different aspects of rabbinic reasoning:
- Pastoral Context Agent - Determines how to respond based on emotional context
- Halachic Reasoning Agent - Provides the landscape of Jewish legal opinions
- Moral-Ethical Agent - Ensures responses preserve human dignity
- Meta-Rabbinic Voice Agent - Crafts the final response with appropriate tone
Important: This is guidance, not binding psak (legal ruling). A rabbi who knows you personally may counsel differently.
- Real-time streaming responses
- WorkOS SSO authentication
- Mobile-friendly dark theme UI
- Multi-agent reasoning pipeline
- Token-by-token response streaming
- Credit-based usage with Stripe payments
- Tiered credit packages ($1 for 10 credits, $2 for 25 credits)
- Python 3.11 or higher
- uv package manager
- An OpenRouter API key
-
Clone the repository
git clone https://github.com/cheesejaguar/rabbi.git cd rabbi -
Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh -
Install dependencies
uv sync
-
Configure environment variables
cp .env.example .env
Edit
.envand add your API keys:OPENROUTER_API_KEY=your-openrouter-api-key # Optional: WorkOS for authentication WORKOS_API_KEY=your-workos-api-key WORKOS_CLIENT_ID=your-workos-client-id -
Run the application
./run.sh
Or manually:
uv run uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 --reload
-
Open in browser
Navigate to http://localhost:8000
# Build and run
docker compose up -d
# View logs
docker compose logs -f
# Stop
docker compose down# Build
docker build -t rebbe .
# Run
docker run -p 8000:8000 --env-file .env rebbe# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=backend/app --cov-report=term-missing
# Run specific test file
uv run pytest backend/tests/test_agents.py -vrabbi/
├── backend/
│ ├── app/
│ │ ├── agents/ # Multi-agent system
│ │ │ ├── base.py # Base agent class and data models
│ │ │ ├── pastoral.py # Pastoral context analysis
│ │ │ ├── halachic.py # Halachic reasoning
│ │ │ ├── moral.py # Ethical assessment
│ │ │ ├── voice.py # Response generation
│ │ │ └── orchestrator.py
│ │ ├── auth.py # WorkOS SSO authentication
│ │ ├── config.py # Settings and configuration
│ │ ├── database.py # PostgreSQL database operations
│ │ ├── payments.py # Stripe payment processing
│ │ ├── main.py # FastAPI application
│ │ └── models.py # Pydantic models
│ └── tests/ # Test suite
├── frontend/
│ ├── index.html # Main HTML
│ ├── app.js # Frontend JavaScript
│ └── styles.css # Styles
├── pyproject.toml # Project dependencies
├── uv.lock # Locked dependencies
└── Dockerfile
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check |
| GET | /api/greeting |
Get welcome message |
| POST | /api/chat |
Send message (non-streaming) |
| POST | /api/chat/stream |
Send message (streaming SSE) |
| GET | /auth/login |
Initiate SSO login |
| GET | /auth/logout |
Log out |
| GET | /auth/check |
Check authentication status |
| GET | /api/payments/packages |
Get available credit packages |
| POST | /api/payments/create-intent |
Create Stripe PaymentIntent |
| POST | /api/payments/webhook |
Stripe webhook handler |
| Variable | Required | Description |
|---|---|---|
OPENROUTER_API_KEY |
Yes | OpenRouter API key for LLM access |
OPENROUTER_BASE_URL |
No | OpenRouter API base URL (default: https://openrouter.ai/api/v1) |
LLM_MODEL |
No | Model to use (default: anthropic/claude-sonnet-4-20250514) |
WORKOS_API_KEY |
No | WorkOS API key for SSO |
WORKOS_CLIENT_ID |
No | WorkOS client ID |
WORKOS_REDIRECT_URI |
No | OAuth callback URL |
SESSION_SECRET_KEY |
No | Secret for session tokens |
STRIPE_SECRET_KEY |
No | Stripe secret key for payments |
STRIPE_PUBLISHABLE_KEY |
No | Stripe publishable key for frontend |
STRIPE_WEBHOOK_SECRET |
No | Stripe webhook signing secret |
DATABASE_URL |
No | PostgreSQL connection URL |
The system uses a pipeline architecture where each agent processes the user's message in sequence:
User Message
│
▼
┌─────────────────────┐
│ Pastoral Context │ Determines HOW to respond
│ Agent │ (tone, authority level)
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Halachic Reasoning │ Provides legal landscape
│ Agent │ (majority/minority views)
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Moral-Ethical │ Ensures dignity preserved
│ Agent │ (may trigger reconsideration)
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Meta-Rabbinic │ Crafts final response
│ Voice Agent │ (warm, humble tone)
└─────────────────────┘
│
▼
Final Response
This project operates on several key principles:
- Guidance, not psak - The AI provides information and perspective, not binding rulings
- Pastoral sensitivity - Emotional context shapes how information is delivered
- Halachic pluralism - Multiple valid opinions are presented, not collapsed into one
- Human dignity first - A technically correct answer that causes harm is a failure
- Encourage human connection - Users are directed to human rabbis for personal guidance
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with FastAPI
- LLM access via OpenRouter
- Authentication via WorkOS
- Payments via Stripe
- Package management with uv