Installation¶
This guide covers installing EpidBot on your local machine.
Prerequisites¶
- Python 3.12 or higher
- uv package manager (recommended) or pip
- Node.js 18+ with pnpm (frontend)
- PostgreSQL (users, sessions, reports, catalog metadata)
- Git
- (Optional) Docker, for the code-execution sandbox
- (Optional) Ollama for local LLM support
Install uv¶
Clone the Repository¶
Install Dependencies¶
Backend (using uv, recommended):
Using pip:
Frontend:
Environment Variables¶
Create a .env file in the project root (see .env.example for the full set):
# REQUIRED: secret used to sign JWT access tokens.
# Refuses to start without it (SECRET_KEY or JWT_SECRET both work).
SECRET_KEY=some_random_secret_key
# PostgreSQL connection string
DATABASE_URL=postgresql://epidbot:epidbot@localhost:5432/epidbot
# LLM provider keys (at least one)
OPENAI_API_KEY=sk-your-api-key-here
# Sandbox code-execution service (optional but recommended)
SANDBOX_URL=http://localhost:8080
# Email service (registration/password emails via Resend; optional in dev)
RESEND_API_KEY=re_xxxxxxxxxx
APP_BASE_URL=http://localhost:3000
# Optional: Ollama host (for local models)
OLLAMA_HOST=http://localhost:11434
Warning
The API refuses to start without SECRET_KEY (or JWT_SECRET): without a stable secret all access tokens would be invalidated on every restart.
Database Setup¶
EpidBot stores users, sessions, messages, reports, payments and catalog metadata in PostgreSQL. Create a database and user:
The schema is created automatically on first start (epidbot/db/schema.py).
Run the Application¶
Start the backend API (port 8123):
Start the frontend (port 3000), in a second terminal:
The application will be available at http://localhost:3000.
Sandbox (Optional but Recommended)¶
The sandbox is an isolated Docker container that executes agent-generated Python/SQL:
docker build -f Dockerfile.sandbox -t epidbot-sandbox .
docker run -d --name epidbot-sandbox -p 8080:8080 epidbot-sandbox
Point SANDBOX_URL at it. Without a sandbox, chat still works but code/SQL execution tools are unavailable.
Ollama Setup (Optional)¶
For local LLM support:
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model
ollama pull llama3
ollama pull mxbai-embed-large # For knowledge base embeddings
Libby Knowledge Base¶
Knowledge-base functionality uses Libby, installed automatically as a dependency from Git (libby-client). Point LIBBY_URL at a running Libby server to enable KB features.
Next Steps¶
- Configuration - Configure providers and settings
- Authentication - Create users and roles
- Quick Start - Learn how to use EpidBot