Getting Started

Getting Started

Prerequisites

  • Node.js 20+ and pnpm 9+
  • Python 3.11+
  • Docker and Docker Compose (for databases)

Installation

1. Clone the Repository

git clone https://github.com/AgentaFlow/agentbase.git
cd agentbase

2. Install Dependencies

pnpm install

3. Environment Configuration

Copy the root environment file and the frontend environment file:

cp .env.example .env
cp packages/frontend/.env.example packages/frontend/.env.local

Key variables to set in .env:

VariableDescriptionDefault
OPENAI_API_KEYOpenAI API key for GPT models (platform key, optional for BYOK)
ANTHROPIC_API_KEYAnthropic API key for Claude (platform key, optional for BYOK)
GEMINI_API_KEYGoogle Gemini API key (platform key, optional for BYOK)
HUGGINGFACE_API_KEYHuggingFace Inference API key (platform key, optional for BYOK)
ENCRYPTION_KEY64-hex-char key for encrypting user BYOK provider keys at rest
JWT_SECRETSecret for signing JWT tokensCHANGE_ME...
JWT_REFRESH_SECRETSecret for refresh tokensCHANGE_ME...
POSTGRES_PASSWORDPostgreSQL passwordagentbase_dev
REDIS_PASSWORDRedis passwordagentbase_dev

Generating ENCRYPTION_KEY: run node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" — store the output securely and never rotate it without first re-encrypting all saved provider keys.

See Self-Hosting Guide for the full list of environment variables.

4. Start Infrastructure

docker compose up -d

This starts PostgreSQL, MongoDB, and Redis.

5. Run Migrations

pnpm db:migrate

6. Start Development Servers

pnpm dev

This starts all three services concurrently (core, frontend, ai-service).

First Steps

  1. Open http://localhost:3000 (opens in a new tab) and register an account
  2. Create your first AI application
  3. Try a conversation in the chat interface
  4. Browse the plugin marketplace
  5. Customize themes in the dashboard

Next Steps