@bat-ai/core v0.1.4
Bat AI Core
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/coreQuick 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
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - 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