LLM agents powered by supypowers - build AI agents with tool use, multi-agent orchestration, and secure credential management
Project description
Supyagent
LLM agents powered by supypowers tools.
Features
- ๐ค Interactive & Execution Agents - Chat interactively or run automated pipelines
- ๐ง Tool Integration - Use any supypowers function as an agent tool
- ๐ Any LLM Provider - Via LiteLLM (OpenAI, Anthropic, Ollama, etc.)
- ๐ YAML Configuration - Simple, declarative agent definitions
- ๐ Session Persistence - Conversations persist across sessions
- ๐ Credential Management - Secure storage for API keys and secrets
- ๐ญ Multi-Agent Orchestration - Agents can delegate tasks to other agents
- ๐ฆ Batch Processing - Process multiple inputs from JSONL/CSV files
Installation
pip install supyagent
Or with uv:
uv pip install supyagent
Quick Start
# Initialize supyagent (sets up default tools)
supyagent init
# Set up your API key (stored securely)
supyagent config set ANTHROPIC_API_KEY
# Create your first agent
supyagent new myagent
# Start chatting
supyagent chat myagent
Usage
Interactive Mode
# Create an interactive agent
supyagent new researcher
# Chat with it
supyagent chat researcher
# Resume a previous session
supyagent chat researcher --session <session-id>
# Start fresh
supyagent chat researcher --new
Execution Mode
For automation and pipelines:
# Create an execution agent
supyagent new summarizer --type execution
# Run with inline input
supyagent run summarizer "Summarize this text..."
# Run with file input
supyagent run summarizer --input document.txt
# Get JSON output
supyagent run summarizer --input doc.txt --output json
# Pipe from stdin
cat article.txt | supyagent run summarizer
Batch Processing
# Process multiple inputs
supyagent batch summarizer inputs.jsonl --output results.jsonl
# From CSV
supyagent batch summarizer data.csv --format csv
Multi-Agent Orchestration
# Use the planning agent to orchestrate complex tasks
supyagent plan "Build a Python library for data validation"
# The planner will delegate to specialist agents (coder, writer, researcher)
Configuration
Setting Up API Keys
Supyagent securely stores your LLM API keys so you don't need to export them every time:
# Interactive setup (recommended)
supyagent config set
# Shows a menu of common providers to choose from
# Set a specific key
supyagent config set ANTHROPIC_API_KEY
supyagent config set OPENAI_API_KEY
# Import from a .env file
supyagent config import .env
# Import only specific keys
supyagent config import .env --filter OPENAI
# List configured keys
supyagent config list
# Export keys to backup
supyagent config export backup.env
# Delete a key
supyagent config delete OPENAI_API_KEY
Keys are encrypted and stored in ~/.supyagent/config/. They're automatically loaded when running any agent command.
Supported Providers
Supyagent uses LiteLLM, supporting 100+ providers:
model:
# OpenAI
provider: openai/gpt-4o
# Anthropic
provider: anthropic/claude-3-5-sonnet-20241022
# Ollama (local)
provider: ollama/llama3
# Azure OpenAI
provider: azure/gpt-4
# Google
provider: gemini/gemini-pro
Agent Configuration
Agents are defined in YAML files in the agents/ directory:
name: researcher
description: An AI research assistant
type: interactive # or "execution"
model:
provider: anthropic/claude-3-5-sonnet-20241022
temperature: 0.7
max_tokens: 4096
system_prompt: |
You are a helpful research assistant...
tools:
allow:
- "*" # Allow all tools
# or be specific:
# - "web:*" # All functions in web.py
# - "math:calc" # Specific function
deny:
- "dangerous:*" # Block specific tools
# For multi-agent support
delegates:
- coder
- writer
CLI Reference
Core Commands
| Command | Description |
|---|---|
supyagent init |
Initialize project with default tools |
supyagent new <name> |
Create a new agent |
supyagent list |
List all agents |
supyagent show <name> |
Show agent details |
supyagent chat <name> |
Interactive chat session |
supyagent run <name> <task> |
Execute agent (non-interactive) |
supyagent batch <name> <file> |
Process multiple inputs |
supyagent plan <task> |
Run task through planning agent |
Session Commands
| Command | Description |
|---|---|
supyagent sessions <name> |
List sessions for an agent |
supyagent chat <name> --session <id> |
Resume a session |
supyagent chat <name> --new |
Start a new session |
Agent Management
| Command | Description |
|---|---|
supyagent agents |
List active agent instances |
supyagent cleanup |
Remove completed instances |
Config Commands
| Command | Description |
|---|---|
supyagent config set [KEY] |
Set an API key (interactive menu if no key specified) |
supyagent config list |
List all configured keys |
supyagent config import <file> |
Import keys from .env file |
supyagent config export <file> |
Export keys to .env file |
supyagent config delete <key> |
Delete a stored key |
In-Chat Commands
While chatting, use these commands:
| Command | Description |
|---|---|
/help |
Show available commands |
/tools |
List available tools |
/history |
Show conversation history |
/sessions |
List your sessions |
/switch <id> |
Switch to another session |
/new |
Start a new session |
/save <title> |
Save session with title |
/export <file> |
Export session to file |
/model <name> |
Switch LLM model |
/creds |
Manage stored credentials |
/clear |
Clear conversation history |
/quit |
Exit the chat |
Bundled Tools
Running supyagent init installs these default tools:
Shell (shell.py)
run_command- Execute shell commandsrun_script- Run multi-line bash scriptswhich- Find executable pathsget_env- Get environment variables
Files (files.py)
read_file/write_file- File I/Olist_directory- List files with glob patternscopy_file/move_file/delete_file- File operationscreate_directory- Create directoriesfile_info- Get file metadata
You can add your own tools by creating Python files in powers/.
Project Structure
your-project/
โโโ agents/ # Agent YAML definitions
โ โโโ assistant.yaml
โ โโโ planner.yaml
โ โโโ researcher.yaml
โโโ powers/ # Tool definitions (Python)
โ โโโ shell.py # Shell commands (bundled)
โ โโโ files.py # File operations (bundled)
โ โโโ my_tools.py # Your custom tools
โโโ .supyagent/ # Runtime data (gitignore this)
โโโ sessions/ # Conversation history
โโโ credentials/ # Encrypted secrets
โโโ registry.json # Agent instances
Credential Management
Supyagent securely manages API keys and secrets:
# In chat, agents can request credentials
๐ Credential requested: SLACK_API_TOKEN
Purpose: To send messages to Slack
Enter value (or press Enter to skip): ****
Save for future sessions? [Y/n]: y
# View stored credentials
/creds
Credentials are encrypted at rest using Fernet encryption.
Multi-Agent Architecture
Create orchestrator agents that delegate to specialists:
# agents/planner.yaml
name: planner
type: interactive
delegates:
- researcher # Can delegate research tasks
- coder # Can delegate coding tasks
- writer # Can delegate writing tasks
system_prompt: |
You are a planning agent. Break down complex tasks
and delegate to specialist agents...
The planner can then:
- Analyze tasks
- Create execution plans
- Delegate subtasks to appropriate agents
- Synthesize results
Development
# Clone the repo
git clone https://github.com/ergodic-ai/supyagent
cd supyagent
# Install with dev dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check .
License
MIT
Related Projects
- supypowers - Tool execution framework
- LiteLLM - LLM provider abstraction
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file supyagent-0.3.5.tar.gz.
File metadata
- Download URL: supyagent-0.3.5.tar.gz
- Upload date:
- Size: 372.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69aa376817630b97fada06db5a70125e85ba2e4c20bcc3af391e3758da5b91dc
|
|
| MD5 |
366f468871b5ebb76c57e6405bb3ee17
|
|
| BLAKE2b-256 |
c2f1ad7fbf8eccc6efa83df1e6fac536d59f29eb0a3097527c27e4711f9511fe
|
File details
Details for the file supyagent-0.3.5-py3-none-any.whl.
File metadata
- Download URL: supyagent-0.3.5-py3-none-any.whl
- Upload date:
- Size: 140.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ecb9dfa575c45784f601cc4855951518cf43da556d258c2de60a17d6ee43d0d
|
|
| MD5 |
e7d01d7be619749ad44976d93d82869f
|
|
| BLAKE2b-256 |
07dee3c599bbd29773315b6a1807c6c9edacc235c67b33bc0c840e935e934cc3
|