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 🙏

© 2026 – Pkg Stats / Ryan Hefner

js-agent-core

v1.0.33

Published

A powerful, isomorphic JS Agent core library for building AI agents with TypeScript (WIP: Early development stage)

Downloads

106

Readme

JS Agent Core

⚠️ 注意 (Warning): 该项目目前正处于活跃开发阶段,功能尚不完善且 API 可能发生破坏性变更。目前不建议在生产环境中使用。

This project is currently under active development. Features are incomplete and APIs may undergo breaking changes. Not recommended for production use.

A powerful, isomorphic, and extensible AI Agent framework built with TypeScript. Run your agents anywhere — from Node.js servers to browsers and edge environments.

NPM Version License: ISC

🚀 Key Features

  • 🌐 Isomorphic: Seamlessly runs in Node.js, Browsers, and Edge (Vercel/Cloudflare).
  • 🧠 Dynamic Skill Routing: Scale your agent with hundreds of skills without blowing up context tokens. Only relevant tools are activated on-demand.
  • 🏗️ Structured Planning: Uses a goal-oriented planning system that can break down complex requests into manageable tasks.
  • 💾 Hybrid Memory: Combines short-term conversational history with long-term vector-based retrieval (RAG).
  • 🛠️ Self-Evolution: Enable your agents to create, persist, and reuse their own skills in real-time.
  • 📊 Observability: Built-in event system for tracing, logging, and real-time progress monitoring.

📦 Installation

npm install js-agent-core

🚦 Quick Start

Basic Usage

import { BaseAgent, LLMProvider, NodeFsLogger } from 'js-agent-core';

const agent = new BaseAgent({
  provider: new LLMProvider({ apiKey: 'your-key' }),
  model: 'gpt-4o',
  logger: new NodeFsLogger()
});

const response = await agent.run('Explain quantum entanglement like I am five.');
console.log(response);

Using Skills & Tools

import { BaseAgent, LLMProvider } from 'js-agent-core';
import { z } from 'zod';

const agent = new BaseAgent({
  provider: new LLMProvider({ apiKey: '...' }),
  model: 'gpt-4o'
});

// Register a simple tool
agent.registerTool({
  name: 'get_weather',
  description: 'Get weather for a city',
  parameters: z.object({ city: z.string() }),
  execute: async ({ city }) => ({ success: true, data: `Sunny in ${city}` })
});

await agent.run('What is the weather in Tokyo?');

🧩 Advanced Features

Dynamic Skill Routing

Avoid context explosion by enabling enableDynamicSkills. The agent will use a "Router" to select only necessary skills from its library before execution.

const agent = new BaseAgent({
  // ...
  enableDynamicSkills: true,
  routerModel: 'gpt-4o-mini' // Use a cheaper model for routing
});

agent.registerSkill(massiveMathSkillLibrary);
agent.registerSkill(massiveDevOpsSkillLibrary);

// Agent will only activate math tools for math questions
await agent.run('What is the derivative of x^2?');

Node.js Runtime (Auto-loaded)

When running in Node.js, js-agent-core automatically provides powerful system capabilities:

  • File System: Read, write, list, and search files.
  • Terminal: Execute shell commands.
  • Self-Evolution: Agents can define new skills and save them for future use.

📖 API Reference

See the full API Reference for detailed documentation.

📄 License

ISC