mindrx
v0.3.0
Published
Cognitive state simulation toolkit for AI agents. Run LLMs in altered mental states.
Downloads
976
Maintainers
Readme
MindRx
Prescriptions for your AI's consciousness
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 # SDKQuick 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 ayahuascaSDK
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
