Skip to main content

Welcome to the localtrain.ai Typescript SDK! A powerful TypeScript toolkit designed to help you seamlessly build AI-powered agents using any LLMs on runtimes like Node.js. Explore the SDK to integrate AI into your applications effortlessly and scale your capabilities!
Before you dive in, make sure you have Node.js installed on your machine.

Installation

First, install the Core Package of localtrain.ai:

Using npm

Using yarn

Now, you’re ready to start building amazing AI-powered solutions! πŸ’‘

πŸ“š Usage Guide

Example: Building an AI Agent with the SDK Core

Let’s walk through creating a Customer Feedback Analyzer Agent step by step:

Step 1: Initialize the SDK

Start by importing the required components and initializing the localtrain.ai SDK:
πŸ‘‰ What’s happening here? The LocalTrain.initialize() sets up the SDK, making it ready to use.

Step 2: Attach Providers to the Registry

Add the necessary providers (e.g., OpenAI) for your agent to use:
πŸ‘‰ What’s happening here? The LocalTrain.useProviders() function registers the providers, allowing your agent to leverage their services (e.g., OpenAI for LLM functionalities).

Step 3: Create and Configure the Agent

Define an agent with its configuration and purpose:
πŸ‘‰ What’s happening here? You’re creating an agent feedbackAgent and specifying its name, description, and behaviors. Each behavior defines how the agent interacts with the OpenAI provider.

Step 4: Run the Agent

Finally, run the agent with a custom prompt:
πŸ‘‰ What’s happening here? The run() method executes the agent with the given prompt and logs the results.

Ready to build your first AI-powered agent? πŸš€ Dive into the Documentation and start exploring today!


🌐 Community

Join our community to connect, share ideas, and get support: We’d love to hear from you and help you build amazing projects!

πŸ“œ License

This project is licensed under the MIT License. See the LICENSE file for details.