Dexrag

Getting Started

Learn how to integrate Dexrag into your application

Getting Started with Dexrag

This guide will help you get started with Dexrag in minutes.

Prerequisites

  • Node.js 18+ or Python 3.8+
  • API key from dashboard

Quick Start

1. Install the SDK

Node.js:

pnpm add dexrag

Python:

pip install dexrag

2. Initialize the Client

import { Dexrag } from 'dexrag'

const dex = new Dexrag({
  apiKey: process.env.DEXRAG_API_KEY
})

3. Create a Collection

Collections help you organize documents by project, topic, or use case.

const collection = await dex.create({
  name: 'legal-contracts',
  mode: 'adaptive'  // Enable adaptive learning
})

4. Upload Documents

// Upload from local files
await collection.add(['contracts/*.pdf'])

// Or upload directly
await collection.addDocument({
  content: 'Your document content...',
  metadata: {
    title: 'Contract #123',
    date: '2025-01-15'
  }
})
const results = await collection.search('indemnification clause')

// Mark relevant results for adaptive learning
await results[0].markRelevant()

Next Steps