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

axon-ai

v0.1.0

Published

A self-organizing cognitive architecture based on Global Workspace Theory

Readme

🧠 Axon

Axon is an emergent cognitive architecture for multi-agent systems based on Global Workspace Theory.

import { Axon } from "axon-ai";

const axon = new Axon({
    llm: {
        baseUrl: "http://localhost:1234/v1",
        model: "qwen/qwen3-4b-2507",
        embeddingModel: "text-embedding-nomic-embed-text-v1.5",
        temperature: 0.7,
        provider: "lmstudio",
    },
});

const result = await axon.process("Brainstorm sustainable energy solutions");

console.log(result.finalBroadcast);

🌟 Features

  • Self-organizing - No predefined workflows or hardcoded agent interactions
  • Emergent cognition - Thoughts compete for attention in a shared workspace
  • Flexible configuration - Use any LLM provider (OpenAI, local, etc.)
  • Dynamic specialists - Meta-agent creates specialists tailored to each problem
  • Streaming support - Real-time observation of the cognitive process

🚀 Installation

yarn add axon-ai
# or
pnpm add axon-ai

🧩 Core Concepts

  • ThoughtChunk: The fundamental data unit with content, embeddings, activation energy, and lineage
  • Workspace: An active medium managing ThoughtChunks, decay, and cluster detection
  • Agents: Specialist processing units with specific roles and prompts
  • Meta-Agent: Analyzes the initial prompt and spawns appropriate specialist agents
  • Orchestrator: Manages cognitive cycles and the broadcast mechanism

📐 Architecture

The system operates in cognitive cycles:

  1. User provides an initial prompt
  2. Meta-Agent defines specialist agents needed
  3. Each cycle:
    • Agents receive the most active ThoughtChunks
    • Agents generate new thoughts
    • New thoughts are added to the Workspace
    • All thoughts decay in energy
    • High-energy clusters trigger a broadcast
  4. Process continues for a defined number of cycles

📚 Usage

Basic Example

import { Axon } from "axon-ai";

// Create a new Axon instance with custom config
const axon = new Axon({
    llm: {
        apiKey: "your-api-key", // Not needed for local LLMs
        baseUrl: "https://api.openai.com/v1",
        model: "gpt-4o",
        embeddingModel: "text-embedding-3-large",
    },
});

// Process a prompt
async function main() {
    const result = await axon.process(
        "Design a sustainable transportation system",
        { verbose: true },
    );

    console.log(result.finalBroadcast);
    console.log(`Total thoughts: ${result.thoughts.length}`);
}

main();

Local LLM Example

// Using a local LLM server (LM Studio, Ollama, etc.)
const axon = new Axon({
    llm: {
        baseUrl: "http://localhost:1234/v1",
        model: "mistralai/mixtral-8x7b-instruct",
        provider: "lmstudio",
    },
});

const result = await axon.process("Analyze quantum computing impacts");

⚙️ Configuration

Axon can be fully configured through code:

const axon = new Axon({
    llm: {
        apiKey: "sk-...",
        baseUrl: "https://api.openai.com/v1",
        model: "gpt-4o",
        embeddingModel: "text-embedding-3-large",
        temperature: 0.7,
        provider: "openai",
    },
    context: {
        maxContextTokens: 32000,
        bufferTokens: 2000,
    },
    workspace: {
        decayRate: 0.95,
        activationThreshold: 7.0,
        baseActivationEnergy: 1.0,
        maxResonanceFactor: 2.0,
    },
    orchestrator: {
        maxCycles: 10,
        broadcastThreshold: 10.0,
    },
});

📄 Advanced Features

Custom Event Handlers

// Listen for specific events
axon.on("broadcast", (broadcast) => {
    console.log("New broadcast synthesized:", broadcast);
});

axon.on("agentThought", (agent, thought) => {
    console.log(`Agent ${agent} thinking: ${thought}`);
});

Streaming Results

const result = await axon.processWithStreaming(
    "Analyze the implications of quantum computing",
);

Advanced Workspace Manipulation

// Access the workspace directly
const workspace = axon.getWorkspace();

// Add custom thoughts
workspace.createChunk(
    "Important insight to consider",
    undefined,
    "custom-source",
    [],
);

// Get most active thoughts
const activeThoughts = workspace.getMostActiveChunks(5);

🧪 Examples

The package includes several examples demonstrating different usage scenarios:

# Run the basic example
yarn example:basic

# Run the advanced example with events and streaming
yarn example:advanced

Check the examples directory for more detailed examples and documentation.

🔬 Research & Theory

Axon implements Global Workspace Theory (GWT) as proposed by Bernard Baars and further developed by Stan Franklin in the LIDA cognitive architecture. GWT suggests that consciousness emerges from a competition among specialized cognitive processes, with winners being "broadcast" globally to the entire system.

📜 License

MIT