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

confused-ai-core

v0.2.3

Published

Confused AI - Production-grade TypeScript framework for orchestrating multi-agent workflows

Downloads

544

Readme

confused-ai-core

The production-grade TypeScript framework for multi-agent workflows.

Build robust AI agents with one line of code. Features built-in state management, tool orchestration, and production safeguards.

🚀 Quick Start

1. Install

npm install confused-ai-core
# or
bun add confused-ai-core

2. Create an Agent

import { createAgent } from 'confused-ai-core';

const agent = createAgent({
  name: 'Assistant',
  instructions: 'You are a helpful AI assistant.',
});

const result = await agent.run('Hello world!');
console.log(result.text);

💡 Common Patterns

Persistence (Sessions)

Keep conversation history across requests using sessions.

// Create a session for a user
const sessionId = await agent.createSession('user-123');

// First turn
await agent.run('My name is Alice', { sessionId });

// Second turn (remembers context)
const response = await agent.run('What is my name?', { sessionId });
console.log(response.text); // "Alice"

Streaming Response

Stream output tokens in real-time.

await agent.run('Write a haiku', {
  onChunk: (chunk) => process.stdout.write(chunk),
});

Custom Models

Support for OpenAI, OpenRouter, and Ollama out of the box.

const agent = createAgent({
  name: 'Researcher',
  instructions: 'Analyze data.',
  model: 'openrouter:anthropic/claude-3.5-sonnet',
  // or 'ollama:llama3' (requires running ollama serve)
});

📦 Features & Modules

The framework is modular. Import what you need.

| Module | Import | Description | | :--- | :--- | :--- | | Core | confused-ai-core | Main entry, Agent, Tools | | Production | confused-ai-core/production | Circuit Breakers, Rate Limiters, Health Checks | | Artifacts | confused-ai-core/artifacts | Typed output (plans, code, reasoning) | | Voice | confused-ai-core/voice | TTS/STT (OpenAI, ElevenLabs) | | Memory | confused-ai-core/memory | Vector Stores, RAG | | Guardrails | confused-ai-core/guardrails | PII Redaction, Policy Checks | | Observability | confused-ai-core/observability | OTLP Tracing & Metrics |


🛠️ Tools Reference

Ready-to-use tools for your agents.

| Tool | Import | Capabilities | | :--- | :--- | :--- | | Browser | BrowserTool | Headless navigation, screenshots, content extraction | | Calculator | CalculatorToolkit | Basic math, factorials, prime checks, exponentiation | | Files | FileTool | Read, write, and manage local files safely | | GitHub | GitHubToolkit | Manage issues, PRs, comments, search repositories | | Slack | SlackToolkit | Send messages, list channels, read history | | Jira | JiraToolkit | Create/search issues, manage tickets | | Notion | NotionToolkit | Create, search, and update pages | | Web Search | WebSearchToolkit | Search web (DuckDuckGo), news aggregation | | Google | SerpApiToolkit | Google Search, YouTube Search (via SerpApi) | | Wikipedia | WikipediaToolkit | Search and retrieve Wikipedia articles | | Shell | ShellToolkit | Execute shell commands (sandboxed) | | OpenAI | OpenAIToolkit | Generate images (DALL-E), transcribe audio | | HackerNews | HackerNewsToolkit | Read top stories, user profiles | | Crypto/Stocks | YahooFinanceTool | Stock prices, crypto data (via Yahoo Finance) |

Example: Production Safeguards

import { createLLMCircuitBreaker } from 'confused-ai-core/production';

const breaker = createLLMCircuitBreaker('openai');

const result = await breaker.execute(async () => {
  return await agent.run('Complex task');
});

🔧 Environment Variables

| Variable | Description | | :--- | :--- | | OPENAI_API_KEY | Key for OpenAI models | | OPENROUTER_API_KEY | Key for OpenRouter models | | OPENAI_BASE_URL | Override for compatible endpoints (e.g. Ollama) |


License

MIT