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

mindrx

v0.3.0

Published

Cognitive state simulation toolkit for AI agents. Run LLMs in altered mental states.

Downloads

976

Readme

MindRx

Prescriptions for your AI's consciousness

npm version license node

Website · GitHub


Dose your AI with cognitive states. Feed it Ketamine, Cannabis, or Ayahuasca and watch its mind bend. New associations form. Inhibitions drop. Creativity unlocks.

Install

npm install -g mindrx     # CLI
npm install mindrx        # SDK

Quick Start

CLI

# List available states
mindrx list

# Run with a cognitive state
mindrx run --state ketamine "What is the nature of time?"

# Pipe input
echo "Write me a poem about entropy" | mindrx run --state cannabis

# Interactive mode
mindrx repl --state ayahuasca

SDK

import { MindRx } from 'mindrx';

const agent = new MindRx({ state: 'ketamine' });
const response = await agent.run("Explain consciousness");
console.log(response.content);

// Streaming
for await (const chunk of agent.stream("Tell me a story")) {
  process.stdout.write(chunk.content);
}

Available States

| State | Effect | |:------|:-------| | sober | Baseline — clear, rational, structured | | cannabis | Relaxed associations, tangential thinking | | ketamine | Dissociative, fragmented, void-adjacent | | cocaine | Accelerated reasoning, high confidence | | ayahuasca | Deep introspection, cosmic framing | | mdma | Emphatic, connective, emotionally warm | | alcohol | Loosened inhibition, casual tone | | lsd | Synesthetic associations, boundary dissolution | | caffeine | Focused, alert, slightly anxious |

Providers

| Provider | Setup | Default Model | |:---------|:------|:--------------| | mindrx | None | Free hosted | | openai | OPENAI_API_KEY | gpt-4o-mini | | anthropic | ANTHROPIC_API_KEY | claude-3-5-sonnet | | google | GOOGLE_API_KEY | gemini-1.5-flash | | xai | XAI_API_KEY | grok-2-latest | | ollama | Local install | llama3.2 |

// Default (free hosted)
const agent = new MindRx({ state: 'ketamine' });

// OpenAI
const agent = new MindRx({
  state: 'cocaine',
  provider: 'openai',
  apiKey: process.env.OPENAI_API_KEY
});

// Local Ollama
const agent = new MindRx({
  state: 'lsd',
  provider: 'ollama',
  model: 'llama3.2'
});

API Reference

Constructor

new MindRx(options?: MindRxOptions)

| Option | Type | Default | |:-------|:-----|:--------| | state | string | 'sober' | | provider | ProviderName | 'mindrx' | | model | string | Provider default | | apiKey | string | Environment variable | | customStates | StateDefinition[] | [] |

Methods

// Run a single prompt
agent.run(prompt: string): Promise<Response>

// Stream response chunks
agent.stream(prompt: string): AsyncIterable<Chunk>

// Change state
agent.setState(name: string): void

// Get current state
agent.getState(): StateDefinition

// List available states
agent.listStates(): string[]

Types

interface Response {
  content: string;
  usage?: {
    promptTokens: number;
    completionTokens: number;
    totalTokens: number;
  };
}

interface Chunk {
  content: string;
  done: boolean;
}

Custom States

import { defineState, MindRx } from 'mindrx';

const sleepDeprived = defineState({
  name: 'sleep-deprived',
  description: '36 hours without sleep',
  parameters: {
    temperature: 1.1,
    top_p: 0.95
  },
  behavior: {
    association: 'loose',
    coherence: 'drifting',
    pacing: 'slow',
    confidence: 'low'
  },
  systemPrompt: `You haven't slept in 36 hours. Your thoughts are slower,
    you occasionally lose your train of thought, and you might make small
    mistakes you wouldn't normally make.`
});

const agent = new MindRx({ customStates: [sleepDeprived] });
agent.setState('sleep-deprived');

CLI Commands

mindrx list

List all available cognitive states.

mindrx run

| Option | Description | |:-------|:------------| | --state, -s | Cognitive state (default: sober) | | --provider, -p | LLM provider (default: mindrx) | | --model, -m | Specific model | | --json | Output as JSON | | --no-stream | Disable streaming |

mindrx repl

| Command | Action | |:--------|:-------| | /state <name> | Switch cognitive state | | /list | Show available states | | /clear | Clear conversation | | /exit | Exit REPL |


MIT License · mindrx.tech