@curiosityai/agentive v0.1.0-beta.1
Agentive.js
Vision
Agentive.js aims to be the simplest yet most powerful way to build agentic AI workflows in JavaScript. Our goal is to make working with multiple AI models from different providers an absolute breeze for developers.
Features
- đĒļ Lightweight Core: Minimal base with only essential features
- đ Multi-Model Support: Seamlessly work with models from OpenAI, Anthropic, Mistral, and more
- đ§Š Modular Architecture: Use only what you need with our plugin system
- đ§ Claude MCP Integration: First-class support for Claude's Model Context Protocol
- đ§° Standardized Tool API: Consistent interface for all tools and extensions
- đ Event-Driven Workflows: Resilient and observable workflow orchestration
- đĄī¸ TypeScript Native: Built with TypeScript from the ground up for type safety
- đ Visualization: Real-time visualization of agent workflows
- đ Security: Secure credential management for API keys
Getting Started
Installation
npm install agentiveBasic Usage
import { Agent, Team, Task } from 'agentive';
import { ClaudeProvider } from 'agentive/models';
import { WebSearchTool } from 'agentive/tools';
// Create an agent with Claude
const researcher = new Agent({
name: 'Researcher',
model: new ClaudeProvider('claude-3-opus-20240229'),
tools: [new WebSearchTool()]
});
// Create a simple task
const researchTask = new Task({
description: 'Research the impact of AI on healthcare in 2025',
agent: researcher
});
// Create a team to orchestrate the workflow
const team = new Team({
name: 'Research Team',
agents: [researcher],
tasks: [researchTask]
});
// Start the workflow
team.start()
.then(result => console.log('Research completed:', result))
.catch(error => console.error('Error:', error));Core Concepts
Agentive.js is built around a few key concepts:
Agents
Agents are autonomous entities capable of performing tasks using AI models. They can be enhanced with tools and capabilities to specialize their behavior.
Tasks
Tasks represent discrete units of work that agents can perform. They can have dependencies on other tasks and can specify input/output schemas.
Teams
Teams orchestrate workflows by coordinating agents and tasks. They manage the flow of information and handle state management.
Tools
Tools extend agent capabilities by providing specific functionalities like web search, data analysis, or code generation.
Capabilities
Capabilities are modular enhancements that can be added to agents to give them new abilities or behaviors.
Examples
Multi-Agent Research Team
// Example of a multi-agent research team with different models
import { Agent, Team, Task } from 'agentive';
import { ClaudeProvider, OpenAIProvider } from 'agentive/models';
const researcher = new Agent({
name: 'Researcher',
model: new ClaudeProvider('claude-3-haiku')
});
const analyst = new Agent({
name: 'Analyst',
model: new OpenAIProvider('gpt-4o')
});
const writer = new Agent({
name: 'Writer',
model: new ClaudeProvider('claude-3-opus-20240229')
});
// Create inter-dependent tasks
const researchTask = new Task({
description: 'Gather information on renewable energy trends',
agent: researcher
});
const analysisTask = new Task({
description: 'Analyze the research data and identify key insights',
agent: analyst,
dependencies: [researchTask]
});
const reportTask = new Task({
description: 'Write a comprehensive report based on the analysis',
agent: writer,
dependencies: [analysisTask]
});
const team = new Team({
tasks: [researchTask, analysisTask, reportTask]
});
team.start();Advanced Tool Usage
// Example showing tool composition and advanced usage
import { Agent } from 'agentive';
import { ToolComposer } from 'agentive/tools';
const researchTool = new ToolComposer()
.pipe('web-search', { query: '{input}' })
.pipe('summarize', { text: '{result}', maxLength: 1000 })
.pipe('translate', { text: '{result}', targetLanguage: 'Spanish' })
.build();
const agent = new Agent({
tools: [researchTool]
});Real-World Examples
For more comprehensive examples demonstrating real-world use cases, check out:
Claude with Web Search: Shows how to combine Claude with web search capabilities to answer questions requiring up-to-date information.
Team Workflow Monitoring: Demonstrates a complete multi-agent workflow with real-time monitoring, progress tracking, and visualization.
Memory Tool Usage: Shows how to implement persistent memory for agents to store and retrieve information.
Model Provider Examples: Individual examples for Claude, OpenAI, Mistral, and Gemini providers to help you get started with your preferred LLM.
API
For comprehensive API documentation, please see our API Reference.
Key Classes
- Agent: The primary class for creating AI agents
- Task: Represents a unit of work for an agent to perform
- Team: Orchestrates workflows with multiple agents and tasks
- Tool: Extends agent capabilities with specific functionalities
- ModelProvider: Abstract class for integrating with different LLM providers
License
MIT
1 year ago