DriftOSDriftOS

Getting Started

Get up and running with DriftOS Core

Getting Started

This guide will help you set up DriftOS Core and start routing conversations.

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Groq API key (get one here)

Installation

# Clone and install
git clone https://github.com/DriftOS/driftos-core
cd driftos-core
npm install

Configuration

Create your environment file:

cp .env.example .env

Add your configuration:

# Required
DATABASE_URL=postgresql://user:password@localhost:5432/driftos
GROQ_API_KEY=your-groq-api-key

# LLM Configuration
LLM_MODEL=llama-3.1-8b-instant
LLM_TIMEOUT=5000

# Optional
PORT=3000

Database Setup

Initialize the database:

npm run db:push

Start the Server

npm run dev

Your DriftOS Core server is now running at http://localhost:3000.

First Route

Try routing your first message:

curl -X POST http://localhost:3000/api/v1/drift/route \
  -H "Content-Type: application/json" \
  -d '{
    "conversationId": "conv-123",
    "content": "I want to plan a trip to Japan",
    "role": "user"
  }'

Response:

{
  "action": "BRANCH",
  "branchId": "branch-456",
  "branchTopic": "Japan trip planning",
  "confidence": 0.95,
  "isNewBranch": true,
  "reason": "New topic introduced: planning a trip to Japan"
}

Next Steps

On this page