npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

praisonai

v1.0.19

Published

PraisonAI TypeScript AI Agents Framework - Node.js, npm, and Javascript AI Agents Framework

Downloads

592

Readme

PraisonAI TypeScript Node.js AI Agents Framework

PraisonAI is a production-ready Multi AI Agents framework, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. It provides a low-code solution to streamline the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.

Installation

npm install praisonai

Development Setup

  1. Clone the repository:
git clone https://github.com/MervinPraison/PraisonAI.git
cd src/praisonai-ts
  1. Install dependencies:
npm install
  1. Build the package:
npm run build

Usage

Here are examples of different ways to use PraisonAI:

1. Single Agent Example

import { Agent, PraisonAIAgents } from 'praisonai';

async function main() {
    // Create a simple agent (no task specified)
    const agent = new Agent({
        name: "BiologyExpert",
        instructions: "Explain the process of photosynthesis in detail.",
        verbose: true
    });

    // Run the agent
    const praisonAI = new PraisonAIAgents({
        agents: [agent],
        tasks: ["Explain the process of photosynthesis in detail."],
        verbose: true
    });

    try {
        console.log('Starting single agent example...');
        const results = await praisonAI.start();
        console.log('\nFinal Results:', results);
    } catch (error) {
        console.error('Error:', error);
    }
}

main();

2. Multi-Agent Example

import { Agent, PraisonAIAgents } from 'praisonai';

async function main() {
    // Create multiple agents with different roles
    const researchAgent = new Agent({
        name: "ResearchAgent",
        instructions: "Research and provide detailed information about renewable energy sources.",
        verbose: true
    });

    const summaryAgent = new Agent({
        name: "SummaryAgent",
        instructions: "Create a concise summary of the research findings about renewable energy sources. Use {previous_result} as input.",
        verbose: true
    });

    const recommendationAgent = new Agent({
        name: "RecommendationAgent",
        instructions: "Based on the summary in {previous_result}, provide specific recommendations for implementing renewable energy solutions.",
        verbose: true
    });

    // Run the agents in sequence
    const praisonAI = new PraisonAIAgents({
        agents: [researchAgent, summaryAgent, recommendationAgent],
        tasks: [
            "Research and analyze current renewable energy technologies and their implementation.",
            "Summarize the key findings from the research.",
            "Provide actionable recommendations based on the summary."
        ],
        verbose: true
    });

    try {
        console.log('Starting multi-agent example...');
        const results = await praisonAI.start();
        console.log('\nFinal Results:', results);
    } catch (error) {
        console.error('Error:', error);
    }
}

main();

3. Task-Based Agent Example

import { Agent, Task, PraisonAIAgents } from 'praisonai';

async function main() {
    // Create agents first
    const dietAgent = new Agent({
        name: "DietAgent",
        role: "Nutrition Expert",
        goal: "Create healthy and delicious recipes",
        backstory: "You are a certified nutritionist with years of experience in creating balanced meal plans.",
        verbose: true,  // Enable streaming output
        instructions: `You are a professional chef and nutritionist. Create 5 healthy food recipes that are both nutritious and delicious.
Each recipe should include:
1. Recipe name
2. List of ingredients with quantities
3. Step-by-step cooking instructions
4. Nutritional information
5. Health benefits

Format your response in markdown.`
    });

    const blogAgent = new Agent({
        name: "BlogAgent",
        role: "Food Blogger",
        goal: "Write engaging blog posts about food and recipes",
        backstory: "You are a successful food blogger known for your ability to make recipes sound delicious and approachable.",
        verbose: true,  // Enable streaming output
        instructions: `You are a food and health blogger. Write an engaging blog post about the provided recipes.
The blog post should:
1. Have an engaging title
2. Include an introduction about healthy eating`
    });

    // Create tasks
    const createRecipesTask = new Task({
        name: "Create Recipes",
        description: "Create 5 healthy and delicious recipes",
        agent: dietAgent
    });

    const writeBlogTask = new Task({
        name: "Write Blog",
        description: "Write a blog post about the recipes",
        agent: blogAgent,
        dependencies: [createRecipesTask]  // This task depends on the recipes being created first
    });

    // Run the tasks
    const praisonAI = new PraisonAIAgents({
        tasks: [createRecipesTask, writeBlogTask],
        verbose: true
    });

    try {
        console.log('Starting task-based example...');
        const results = await praisonAI.start();
        console.log('\nFinal Results:', results);
    } catch (error) {
        console.error('Error:', error);
    }
}

main();

Running the Examples

  1. First, set up your environment variables:
export OPENAI_API_KEY='your-api-key'
  1. Create a new TypeScript file (e.g., example.ts) with any of the above examples.

  2. Run the example:

npx ts-node example.ts

For more examples, check out the examples/concepts/ directory in the repository.

Package Structure

src/
├── agent/         # Agent-related interfaces and implementations
├── agents/        # Multi-agent system management
├── knowledge/     # Knowledge base and management
├── llm/          # Language Model interfaces
├── memory/       # Memory management systems
├── process/      # Process management
├── task/         # Task management
└── tools/        # Various utility tools
    ├── arxivTools.ts
    └── ... (other tools)

Contributing

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

License

MIT License - see the LICENSE file for details

Testing

Manual Testing

export OPENAI_API_KEY='your-api-key'
npx ts-node tests/development/simple/single-agent.ts
npx ts-node tests/development/simple/multi-agent.ts
npx ts-node tests/development/simple/multi-agents-simple.js

Examples Testing

export OPENAI_API_KEY='your-api-key'
npx ts-node examples/simple/single-agent.ts
npx ts-node examples/simple/multi-agent.ts

Automated Testing (WIP)

npm run test