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

@opensymbolicai/core

v0.1.0

Published

AI-native programming framework where agents define primitives and LLMs generate execution plans

Readme

OpenSymbolicAI

WARNING: This project is highly experimental. APIs may change without notice.

An AI-native programming framework where agents define primitive methods and LLMs generate execution plans.

Concept

Traditional programming requires explicit step-by-step instructions. OpenSymbolicAI inverts this: you define what operations are possible (primitives), and the LLM figures out how to compose them to solve tasks.

User Task: "Calculate the hypotenuse of a right triangle with sides 3 and 4"
     ↓
LLM generates plan using your primitives:
     const a_squared = multiply(3, 3);
     const b_squared = multiply(4, 4);
     const sum = add(a_squared, b_squared);
     const hypotenuse = squareRoot(sum);
     ↓
Framework executes plan safely
     ↓
Result: 5

Installation

npm install @opensymbolicai/core

Quick Start

import 'reflect-metadata';
import { PlanExecute, primitive, decomposition, LLMConfig } from '@opensymbolicai/core';

class Calculator extends PlanExecute {
  @primitive({ readOnly: true })
  add(a: number, b: number): number {
    return a + b;
  }

  @primitive({ readOnly: true })
  multiply(a: number, b: number): number {
    return a * b;
  }

  // Teach the LLM by example
  @decomposition(
    'Calculate area of rectangle',
    'area = multiply(width, height)'
  )
  _exampleArea() {}
}

const calc = new Calculator(
  { provider: 'openai', model: 'gpt-4', params: { temperature: 0 } },
  'Calculator',
  'A simple calculator'
);

const result = await calc.run('What is 2 + 3?');
console.log(result.result); // 5

Key Features

  • Primitive Methods: Define operations the LLM can use via @primitive decorator
  • Decomposition Examples: Teach patterns to the LLM via @decomposition decorator
  • Secure Execution: Plans are parsed, validated, and executed in a sandboxed interpreter
  • Multiple LLM Providers: OpenAI, Anthropic, Ollama, Fireworks, Groq
  • Execution Traces: Full visibility into each step of plan execution
  • Checkpointing: Save and restore execution state

Supported LLM Providers

| Provider | Config | |----------|--------| | OpenAI | { provider: 'openai', model: 'gpt-4' } | | Anthropic | { provider: 'anthropic', model: 'claude-3-opus-20240229' } | | Ollama | { provider: 'ollama', model: 'llama2' } | | Fireworks | { provider: 'fireworks', model: 'accounts/fireworks/models/llama-v3-70b' } | | Groq | { provider: 'groq', model: 'llama3-70b-8192' } |

Project Structure

src/
├── core.ts           # @primitive and @decomposition decorators
├── plan-execute.ts   # Main PlanExecute base class
├── parser/           # Plan parsing and validation
│   ├── tokenizer.ts  # Lexical analysis
│   ├── parser.ts     # AST generation
│   └── validator.ts  # Security validation
├── executor/         # Plan execution
│   ├── interpreter.ts
│   └── namespace.ts
├── llm/              # LLM provider implementations
│   ├── openai.ts
│   ├── anthropic.ts
│   ├── ollama.ts
│   └── ...
├── checkpoint/       # State serialization
└── models.ts         # Zod schemas and types

Examples

See the examples/ directory:

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

# Watch mode
npm run dev

License

MIT