0.1.4 โ€ข Published 6 months ago

@bat-ai/core v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Bat AI Core

npm version License: MIT Documentation

Bat AI Core is a sophisticated framework for building and managing AI agent teams. It provides a robust architecture for creating, coordinating, and deploying AI agents that can work together to accomplish complex tasks.

Features

  • ๐Ÿค– Multi-Agent Collaboration: Teams of specialized agents working together
  • ๐Ÿ“‹ Advanced Task Management: Priority-based scheduling, timeout control, and automatic retries
  • ๐Ÿง  Flexible Memory System: Short-term and long-term memory with persistence
  • ๐Ÿ› ๏ธ Extensible Tool System: Built-in tools and custom tool creation
  • ๐Ÿ”’ Secure Execution: Sandboxed environment and access control
  • ๐Ÿ“Š Monitoring & Logging: Comprehensive system metrics and logging

Installation

npm install @bat-ai/core

Quick Start

import { Agent, Bat } from "@bat-ai/core";
import { ChatOpenAI } from "@langchain/openai";

// Create an agent
const agent = new Agent({
  role: "developer",
  goal: "Write and maintain code",
  backstory: "A skilled developer agent",
  model: new ChatOpenAI({ temperature: 0 }),
  capabilities: ["code_execution"],
});

// Create a Bat instance
const bat = new Bat([agent]);

// Add a task
bat.addTask({
  description: "Write a function to sort an array",
  agentRole: "developer",
});

// Execute tasks
const results = await bat.kickoff();

Documentation

For detailed documentation, visit https://bataiinc.github.io/bat-ai-core/#/

License

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

Keywords

ai, agents, automation, collaboration, task-management, memory-system, tools, typescript, nodejs, npm, openai, langchain

๐Ÿš€ Features

  • ๐Ÿค– Specialized agents for different types of tasks
  • ๐Ÿ› ๏ธ Support for multiple AI tools
  • ๐Ÿ”„ Memory management for agents
  • ๐Ÿ” Task delegation and coordination
  • ๐Ÿ“ฆ Easy to extend with new tools and agents

๐Ÿ“‹ Prerequisites

  • Node.js (version 16 or higher)
  • npm or yarn
  • Access to AI APIs (OpenAI, Groq, etc.)

๐Ÿ”ง Installation

Install the public package from npm:

npm install @bat-ai/core
# or
yarn add @bat-ai/core

๐ŸŽฏ Usage

Basic Setup

import { Agent, Bat, Task, AgentConfig } from "@bat-ai/core";
import { ChatOpenAI } from "@langchain/openai";

// Configure an agent
const agentConfig: AgentConfig = {
  role: "developer",
  goal: "Write and execute code",
  backstory: "A skilled developer agent",
  model: new ChatOpenAI({ temperature: 0 }),
  capabilities: ["code_execution", "code_review"],
};

// Create an agent
const agent = new Agent(agentConfig);

// Create a task
const task = new Task("Write a function to sort an array", agent);

// Create a Bat instance with agents
const bat = new Bat([agent]);

// Add and execute tasks
bat.addTask("Write a function to sort an array", "developer");
const results = await bat.kickoff();

Agent Configuration

interface AgentConfig {
  role: string;
  goal: string;
  backstory: string;
  model: BaseChatModel;
  memory?: AgentMemory;
  tools?: BatTool[];
  capabilities?: string[];
}

Task Execution

// Execute a single task
const result = await task.run();

// Execute multiple tasks with Bat
const results = await bat.kickoff();

๐Ÿงช Testing

To run the tests:

npm test
# or
yarn test

๐Ÿ“š Documentation

The complete documentation is available in the docs/ directory. It includes:

  • Development Guide
  • API Reference
  • Usage Examples
  • Contribution Guidelines

๐Ÿค Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

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

๐Ÿ“ž Support

For support, please open an issue on GitHub or contact us at: support@example.com