Skip to content

boy1dr/AgentDex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AgentDex

bash-ollama-into-agent-pipeline

A dead-simple way to chain AI agents together using Ollama and bash pipes. No frameworks, no dependencies, just bash doing what it does best.

Agents, Gotta catch 'em all, then deploy the right one for the job.

What is this?

Ever wanted to pass the output of one AI agent to another? Like having Bob the Accountant analyze something, then having Penny from Customer Service explain it in friendly terms? That's what this does.

#Always use single quotes
./agentdex bob 'Calculate the ROI on a $50k investment at 7% over 5 years' | ./agentdex penny

Bob does the math, Penny makes it sound nice. All with standard Unix pipes.

Why though?

Because sometimes you don't need a 10,000-line framework to experiment with agentic workflows. Sometimes you just need 60 lines of bash and a local LLM.

This is great for:

  • Learning how agent pipelines work
  • Prototyping multi-agent systems
  • Running everything locally with Ollama
  • Not installing npm packages

TL;DR Speedrun

# Install Ollama if you haven't (https://ollama.ai)
ollama pull llama3.2:3b

# Get the thing
git clone https://github.com/boy1dr/agentdex.git
cd agentdex
chmod +x agentdex

# Read the script (reading is fundamental)
cat agentdex
sleep 3  # let it sink in

# Run it
echo "You are a helpful assistant." > helper.agent
./agentdex helper 'What is the meaning of life?'

Now go read the rest. You know you want to.

Installation

  1. Install Ollama if you haven't already: https://ollama.ai

  2. Pull a model (or use one you already have):

    ollama pull llama3.2:3b
  3. Clone this repo:

    git clone https://github.com/boy1dr/agentdex.git
    cd agentdex
  4. Make the script executable:

    chmod +x agentdex

That's it. You're done.

Quick Start

Create an agent file (or use the examples):

echo "You are a pirate captain. Speak like one." > pirate.agent

Run it:

./agentdex pirate 'Tell me about machine learning'

Chain agents together:

./agentdex pirate 'Explain neural networks' | ./agentdex penny

The pirate explains it their way, then Penny translates it to normal human speech.

How It Works

An agent is just a text file with a system prompt:

bob.agent:

You are Bob the Accountant. Always good with numbers and quick assessments of financial risk and reward.

When you run ./agentdex bob 'your prompt', the script:

  1. Loads bob.agent as the system message
  2. Uses your prompt as the user message
  3. Sends both to Ollama
  4. Returns the response

Since it's just text in/out, you can pipe agents together like any other Unix tool.

Usage

./agentdex <agent_name> <prompt>
./agentdex <agent_name> < input.txt
echo "something" | ./agentdex <agent_name>

Examples

Simple query:

./agentdex bob 'Should I lease or buy a car?'

Multi-agent pipeline:

./agentdex bob 'Analyze the cost of a $200/month gym membership over 10 years' \
  | ./agentdex penny \
  > advice.txt

Read from file:

./agentdex legal < contract.txt

Chain three agents with context injection:

echo "Explain quantum computing" \
  | ./agentdex penny \
  | ./agentdex professor 'explain it like im 5 years old.' \
  | ./agentdex pirate

(Penny simplifies it, professor dumbs it down even more with additional context, pirate makes it fun)

Just make a .agent file with a system prompt:

echo "You are a grumpy old programmer who hates modern JavaScript frameworks." > grumpy.agent
./agentdex grumpy 'Should I use React or Vue?'

The simpler the better. The LLM does the rest.

Configuration

By default, the script uses llama3.2:3b. To use a different model, set the OLLAMA_MODEL environment variable:

OLLAMA_MODEL=llama3.2:1b ./agentdex bob 'quick question'

Or export it:

export OLLAMA_MODEL=mistral
./agentdex bob 'another question'

Tips

  • Keep agents simple - A one-sentence description often works best
  • Pipe liberally - That's the whole point
  • Mix and match - Technical agent → Customer service agent → Marketing agent
  • Use stdin - Great for processing files or combining with other tools
  • Debug with set -x - Add it to the script if things get weird
  • Collect agents - Build your own AgentDex and deploy the right one for each situation

Command Line Usage:

  • Always use single quotes for prompts with special characters: ./agentdex bob 'text with $pecial chars'
  • Double quotes allow shell expansion: "$50k" becomes "" before the script sees it
  • Or escape special chars: "Calculate \$50k ROI"

Example Agents

Check the examples/agents/ directory for:

  • bob.agent - Financial advisor
  • penny.agent - Customer service
  • professor.agent - Technical explainer
  • eli5.agent - Explain like I'm 5
  • critic.agent - Brutally honest feedback
  • pirate.agent - Yarrr

Limitations

  • No conversation history (each call is independent)
  • No fancy streaming or progress bars
  • Agents can't call other agents automatically
  • It's bash, so Windows users need WSL or similar

These are features, not bugs. Keep it simple.

⚠️ Security Notice

This is a quick-and-dirty tool for local/trusted use. If you're accepting inputs from untrusted sources (web, email, user input), you MUST add your own security layers.

  • Never run as root or privileged user with untrusted inputs
  • Prompt injection is real - malicious prompts can manipulate agent behavior
  • The script provides basic sanitization but YOU are responsible for proper input validation in production
  • Don't blindly pipe web/email content into agents without filtering
  • Consider sandboxing if running on servers (containers, limited users, etc.)

Read the code. Understand what it does. Add protections for your use case. Security is your responsibility.

Contributing

Found a cool agent? Add it to examples/agents/ and send a PR.

Found a bug? Open an issue.

Want to add features? Keep them simple and in the spirit of "just bash and pipes."

License

Apache 2.0 - Do whatever you want with it. No attribution required.

Credits

Made by boy1dr who thought "do I really need a framework for this?"

The answer was no.

About

A dead-simple way to chain AI agents together using Ollama and bash pipes. No frameworks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages