API Enterprise SDK
ChatBots

ChatBots Enterprise SDK

AI-Horizon's ChatBot SDK allows you to easily integrate advanced conversational AI agents with memory, context window management, and custom Retrieval-Augmented Generation (RAG) pipelines directly into your enterprise infrastructure.

Getting Started

The ChatBot agent abstracts complex RAG pipelines, database connections, and model invocation details so you can launch a production-ready chatbot with just a few lines of code.

Installation

Install the enterprise SDK from the package registry:

npm install @ai-horizon/sdk

Set up your API keys in your environment variables:

export OPENAI_API_KEY="sk-..."
export AIH_API_KEY="aih-..."

Core Initialization Methods

The ChatBot class supports several specialized methods based on the target data source:

1. Chat with PDFs (ChatBot.pdf_chat)

import { ChatBot } from '@ai-horizon/sdk';
 
const chatbot = ChatBot.pdf_chat({
  input_files: ["./documents/annual_report_2026.pdf"],
  system_prompt: "You are a helpful financial analyst helper.",
  temperature: 0.2
});
 
const response = await chatbot.chat("What was the net profit for Q3?");
console.log(response.text);

2. Chat with Websites (ChatBot.website_chat)

Crawl and scrape entire websites or specific domains automatically.

const chatbot = ChatBot.website_chat({
  urls: ["https://docs.example.com"],
  recursive: true,
  max_depth: 3
});

3. Chat with Microsoft Word Documents (ChatBot.docx_chat)

const chatbot = ChatBot.docx_chat({
  input_files: ["./specs/system_design.docx"]
});

4. Chat with YouTube Videos (ChatBot.youtube_chat)

Extract video transcripts and answer questions directly from video content.

const chatbot = ChatBot.youtube_chat({
  video_url: "https://www.youtube.com/watch?v=example"
});

Parameter Configuration

Here is the complete configuration object for initializing the ChatBot:

ParameterTypeDefaultDescription
input_filesArray<string>[]List of relative or absolute file paths.
input_dirstringnullDirectory path containing documents to load.
system_promptstringnullGuides the system's persona and rules.
query_wrapper_promptstringnullWraps incoming queries for precise context.
temperaturenumber0.0Controls language model generation randomness.
embed_modelstring"default"Model used for document embedding.
vector_store_paramsobject{}Settings for Pinecone, Qdrant, or PGVector.
llm_paramsobject{}Options for passing to Azure OpenAI or custom LLMs.

Retrieving Source Citations

For auditing, compliance, and transparency, AI-Horizon automatically includes the source citations within the response object:

const response = await chatbot.chat("Analyze our leave policy.");
 
console.log("Answer:", response.text);
 
// Output the source chunks used to generate the answer
response.source_nodes.forEach((node, index) => {
  console.log(`[Citation ${index + 1}] Source: ${node.metadata.file_name}`);
  console.log(`Content snippet: ${node.text}`);
});