Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agenticjs

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agenticjs

AI Agents library for Javascript Developers.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
decreased by-24.53%
Maintainers
0
Weekly downloads
 
Created
Source

AgenticJS

AI Agents library for Javascript Developers.

1. Installation

npm install agenticjs

2. Environment Variables

export OPENAI_API_KEY="sk-......" # Replace with your key

3. How to use it

import { Agent, Task, Team } from 'agenticjs';

process.env.OPENAI_API_KEY = "YOUR_API_KEY"

// Define agents
const researcher = new Agent({name: 'Alice', role: 'Researcher', 
    goal: 'Analyze AI advancements about {topic}', background: 'AI researcher',tools: []});
    
const writer = new Agent({name: 'Bob', role: 'Writer', 
    goal: 'Write an article about {topic}', background: 'Tech writer',tools: []});

// Define tasks
const researchTask = new Task({ 
  description: ` Identify the next big trend in {topic}.
  Focus on identifying pros and cons and the overall narrative.
  Your final report should clearly articulate the key points,
  its market opportunities, and potential risks.
  `, 
  expectedOutput: 'A comprehensive 3 paragraphs long report on the latest AI trends.', 
  agent: researcher 
});

const writingTask = new Task({ 
    description: `Compose an insightful article on {topic}.
    Focus on the latest trends and how it's impacting the industry.
    This article should be easy to understand, engaging, and positive.`, 
    expectedOutput: 'A 4 paragraph article on {topic} advancements formatted as markdown.', 
    agent: writer 
});

// Create a team
const team = new Team({
  name:'Productivity Team',
  agents: [researcher, writer],
  tasks: [researchTask, writingTask],
  verbose: 2
});

team.start({topic: "AI Agents"})

Other Examples

Resume Creation Team

import { Agent, Task, Team } from 'agenticjs';

// Define agents
const profileAnalyst = new Agent({
    name: 'Ivy', 
    role: 'Profile Analyst', 
    goal: 'Extract structured information from conversational user input.', 
    background: 'Data Processor',
    tools: []  // Tools are omitted for now
});

const formatter = new Agent({
    name: 'Formy', 
    role: 'Formatter', 
    goal: 'Format structured information into a professional resume.', 
    background: 'Document Formatter',
    tools: []
});

const reviewer = new Agent({
    name: 'Revy', 
    role: 'Reviewer', 
    goal: 'Review and polish the final resume.', 
    background: 'Quality Assurance Specialist',
    tools: []
});

// Define tasks
const processingTask = new Task({ 
  description: `Extract relevant details such as name, experience, skills, and job history from the user's 'aboutMe' input. 
  aboutMe: {aboutMe}`,
  expectedOutput: 'Structured data ready for formatting.', 
  agent: profileAnalyst
});

const formattingTask = new Task({ 
    description: `Use the extracted information to create a clean, professional resume layout tailored for a JavaScript Developer.`,
    expectedOutput: 'A well-formatted resume in PDF format.', 
    agent: formatter 
});

const reviewTask = new Task({ 
    description: `Ensure the resume is error-free, engaging, and meets professional standards.`,
    expectedOutput: 'A polished, final resume ready for job applications.', 
    agent: reviewer 
});

// Create a team
const team = new Team({
  name: 'Resume Creation Team',
  agents: [profileAnalyst, formatter, reviewer],
  tasks: [processingTask, formattingTask, reviewTask],
  verbose: 2
});

// Start the resume creation process
team.start({
    aboutMe: 'My name is Will, I have been a Javascript Developer for 3 years. I know React, NextJS, and REDUX. My latest job was as a Junior Developer at Disney creating UIs for the main landing page.'
});

Keywords

FAQs

Package last updated on 02 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc