Welcome to OAK
Welcome to the OAK documentation! OAK is an open-source platform designed to make building, customizing, and deploying AI agents effortless. With its modular design and built-in integrations, you can connect to any LLM, extend functionality with powerful plugins, and seamlessly embed AI into your workflows.
OAK empowers developers with flexibility and scalability, allowing you to tailor every aspect of your AI solutions. Dive in and unlock the full potential of OAK to bring your vision to life—without the hassle.
Basic Setup
Select this option to run the app locally without modifying the codebase or developing custom plugins.
-
Start the App: Execute the following command to launch the app:
npx @open-agent-kit/cli run docker
-
Configure the Model: The CLI will prompt you to select a model and provide the associated API key. See the Configuration section below for more information.
-
Access the App: Open your browser and navigate to:
http://localhost:3000
Advanced Setup
Select this option if you wish to modify the default model, install plugins, or develop your own plugins.
Scaffold a New Project
To begin, scaffold a new project by running the following command:
npx @open-agent-kit/cli create project
This command will generate a new project with the default configuration.
Set Up a Database
You can set up a PostgreSQL database in a Docker container using the command below. Replace the placeholder values with your actual configuration:
docker run --name <container_name> \
-e POSTGRES_USER=<your_username> \
-e POSTGRES_PASSWORD=<your_password> \
-e POSTGRES_DB=<your_database> \
-p 5432:5432 -d pgvector/pgvector:pg17
Alternatively, for a simpler setup and maintenance, consider using a managed database service like Neon.
Configuration
Obtain API Keys
This project utilizes the Vercel AI SDK to initialize and interact with the respective AI models. Ensure that the environment variables are correctly set to configure the AI model. For more information, refer to the Vercel AI SDK Providers documentation.
-
OpenAI API Key: Follow the OpenAI Documentation to obtain your API key.
-
Google Generative AI API Key: Refer to the Gemini Documentation to acquire your API key.
-
Anthropic API Key: Visit the Anthropic API Documentation to generate your API key.
-
XAI API Key: Refer to the XAI Documentation to obtain your API key.
Generate App Secret Key
You can generate a secure app secret key using the following tool:
https://api.open-agent-kit.com/generate-secret.html
Set Environment Variables
Duplicate the .env.example
file and rename it to .env
. Set the necessary variables in the .env
file according to your setup.
cp .env.example .env
Ensure all required variables are correctly configured to match your environment and API keys.
Detailed Environment Variables Description
-
App Secret Key:
APP_SECRET
: Secret key for your application. Generate using:openssl rand -hex 32
.
-
Base URL:
APP_URL
: The base URL for your application, default ishttp://localhost:5173
.
-
PostgreSQL Database Connection:
POSTGRES_PASSWORD
: Password for PostgreSQL database.DATABASE_URL
: PostgreSQL database connection string, including user, password, host, port, and database name. Theschema=public
specifies the schema to use.
-
Google Authentication:
GOOGLE_CLIENT_SECRET
: Client secret for Google login authentication. Obtain this from the Google Cloud Console by creating OAuth 2.0 credentials.GOOGLE_CLIENT_ID
: Client ID for Google login authentication. Obtain this from the Google Cloud Console by creating OAuth 2.0 credentials.
-
AI Service API Keys:
OPENAI_API_KEY
: API key for accessing OpenAI's services.GOOGLE_GENERATIVE_AI_API_KEY
: API key for Google's Generative AI services.ANTHROPIC_API_KEY
: API key for Anthropic's services.XAI_API_KEY
: API key for XAI's services.
-
Email Service Configuration (SMTP):
SMTP_HOST
: Hostname of the SMTP server.SMTP_PORT
: Port number for SMTP, typically 587 for TLS.SMTP_USER
: Username for SMTP authentication.SMTP_PASSWORD
: Password for SMTP user account.SENDER_EMAIL
: Email address used as the sender in email communications.
Local Development
Step 1: Install Dependencies
First, navigate to the project directory. Then, install the necessary dependencies by running:
npm install
Step 2: Run Initial Migration
Ensure that your database is running and accessible. Apply the initial database migrations using Prisma with the following commands:
npm run generate
npm run migrate:deploy
Step 3: Start the Application
To start the application, execute:
npm run dev
Once started, the admin interface will be accessible at http://localhost:5173/.