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 installConfiguration
Create your environment file:
cp .env.example .envAdd 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=3000Database Setup
Initialize the database:
npm run db:pushStart the Server
npm run devYour 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
- Learn about the API endpoints
- Explore configuration options
- Use the JavaScript SDK for easier integration
