> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Core SDK Overview

> Build and manage AI agents with the BoostGPT Core SDK

## What is the Core SDK?

The Core SDK provides programmatic access to create, manage, and interact with BoostGPT agents. It handles bot management, chat interactions, and training data.

## Installation

```bash theme={null}
npm install boostgpt
```

## Quick Start

```javascript theme={null}
import { BoostGPT } from 'boostgpt';

const client = new BoostGPT({
  project_id: process.env.BOOSTGPT_PROJECT_ID,
  key: process.env.BOOSTGPT_API_KEY
});
```

## Key Features

> [card] [Bot Management](/docs/sdk/core/bot-management.md)
>
> Create, update, and delete bots

> [card] [Chat API](/docs/sdk/core/chat-api.md)
>
> Send messages and get AI responses

> [card] [Training Data](/docs/sdk/core/training-data.md)
>
> Add knowledge to your bots

> [card] [API Reference](/docs/sdk/core/api-reference.md)
>
> Complete method documentation

## Response Format

All SDK methods return a consistent format:

```javascript theme={null}
{
  err: null | string,      // Error message if failed
  response: object | null  // Response data if successful
}
```

Always check `err` before using `response`:

```javascript theme={null}
const result = await client.createBot({
  name: 'My Bot',
  model: 'gpt-6-luna',
  instruction: 'You are helpful.'
});

if (result.err) {
  console.error('Error:', result.err);
} else {
  console.log('Success:', result.response);
}
```

## Available Methods

### Bot Management

* `createBot()` - Create a new bot
* `fetchBot()` - Get bot details
* `fetchBots()` - List all bots (paginated)
* `updateBot()` - Update bot settings
* `resetBot()` - Delete all training data
* `deleteBot()` - Delete a bot

### Chat

* `chat()` - Send message and get response (supports streaming)
* `fetchChat()` - Get chat history
* `fetchChats()` - List all chats (paginated)
* `deleteChat()` - Delete chat history
* `search()` - Search bot's knowledge base
* `executeTool()` - Execute tool calls
* `voteMessage()` - Upvote/downvote messages
* `fetchVoteStatus()` - Get message vote status
* `deleteMessage()` - Delete a specific message

### Training

* `startTraining()` - Add training content (queued)
* `fetchTraining()` - Get training source
* `fetchTrainings()` - List training data (paginated)
* `updateTraining()` - Update training source
* `deleteTraining()` - Remove training data

### Analytics & Statistics

* `fetchVoteStats()` - Get voting statistics
* `fetchSummaryStats()` - Get summary statistics
* `fetchDashboardStats()` - Get dashboard statistics
* `fetchToolUsageStats()` - Get tool usage statistics
* `fetchWorkflowStats()` - Get workflow statistics
* `fetchPerformanceMetrics()` - Get performance metrics
* `fetchBehaviorStats()` - Get user behavior statistics
* `fetchErrorAnalysis()` - Get error analysis
* `fetchReasoningSummary()` - Get reasoning summary

## Example Usage

```javascript theme={null}
// Create a bot
const bot = await client.createBot({
  name: 'Support Bot',
  model: 'gpt-6-luna',
  instruction: 'You are a customer support assistant.'
});

// Add training
await client.startTraining({
  bot_id: bot.response.id,
  type: 'text',
  source: 'We offer 24/7 support at support@example.com'
});

// Chat
const response = await client.chat({
  bot_id: bot.response.id,
  message: 'How can I contact support?'
});

console.log('Bot:', response.response);
```

## Next Steps

> [card] [Installation](/docs/sdk/core/installation.md)
>
> Install and configure SDK

> [card] [Bot Management](/docs/sdk/core/bot-management.md)
>
> Create and manage bots


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.