supyagent 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of supyagent might be problematic. Click here for more details.
- supyagent-0.1.0/.gitignore +45 -0
- supyagent-0.1.0/LICENSE +21 -0
- supyagent-0.1.0/PKG-INFO +328 -0
- supyagent-0.1.0/README.md +292 -0
- supyagent-0.1.0/agents/assistant.yaml +28 -0
- supyagent-0.1.0/agents/coder.yaml +45 -0
- supyagent-0.1.0/agents/planner.yaml +61 -0
- supyagent-0.1.0/agents/researcher.yaml +24 -0
- supyagent-0.1.0/agents/summarizer.yaml +27 -0
- supyagent-0.1.0/agents/writer.yaml +45 -0
- supyagent-0.1.0/plans/initial_plan.md +394 -0
- supyagent-0.1.0/pyproject.toml +88 -0
- supyagent-0.1.0/sprints/README.md +53 -0
- supyagent-0.1.0/sprints/sprint_1_foundation.md +291 -0
- supyagent-0.1.0/sprints/sprint_2_sessions.md +382 -0
- supyagent-0.1.0/sprints/sprint_3_repl.md +548 -0
- supyagent-0.1.0/sprints/sprint_4_execution.md +494 -0
- supyagent-0.1.0/sprints/sprint_5_multiagent.md +630 -0
- supyagent-0.1.0/sprints/sprint_6_polish.md +623 -0
- supyagent-0.1.0/supyagent/__init__.py +5 -0
- supyagent-0.1.0/supyagent/__main__.py +8 -0
- supyagent-0.1.0/supyagent/cli/__init__.py +1 -0
- supyagent-0.1.0/supyagent/cli/main.py +946 -0
- supyagent-0.1.0/supyagent/core/__init__.py +21 -0
- supyagent-0.1.0/supyagent/core/agent.py +379 -0
- supyagent-0.1.0/supyagent/core/context.py +158 -0
- supyagent-0.1.0/supyagent/core/credentials.py +275 -0
- supyagent-0.1.0/supyagent/core/delegation.py +286 -0
- supyagent-0.1.0/supyagent/core/executor.py +232 -0
- supyagent-0.1.0/supyagent/core/llm.py +73 -0
- supyagent-0.1.0/supyagent/core/registry.py +238 -0
- supyagent-0.1.0/supyagent/core/session_manager.py +233 -0
- supyagent-0.1.0/supyagent/core/tools.py +235 -0
- supyagent-0.1.0/supyagent/models/__init__.py +6 -0
- supyagent-0.1.0/supyagent/models/agent_config.py +86 -0
- supyagent-0.1.0/supyagent/models/session.py +43 -0
- supyagent-0.1.0/supyagent/utils/__init__.py +1 -0
- supyagent-0.1.0/supyagent/utils/paths.py +31 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# IDE
|
|
29
|
+
.idea/
|
|
30
|
+
.vscode/
|
|
31
|
+
*.swp
|
|
32
|
+
*.swo
|
|
33
|
+
.DS_Store
|
|
34
|
+
|
|
35
|
+
# Supyagent runtime data
|
|
36
|
+
.supyagent/
|
|
37
|
+
|
|
38
|
+
# Environment variables
|
|
39
|
+
.env
|
|
40
|
+
.env.local
|
|
41
|
+
|
|
42
|
+
# Test artifacts
|
|
43
|
+
.pytest_cache/
|
|
44
|
+
.coverage
|
|
45
|
+
htmlcov/
|
supyagent-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ergodic AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
supyagent-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: supyagent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: LLM agents powered by supypowers - build AI agents with tool use, multi-agent orchestration, and secure credential management
|
|
5
|
+
Project-URL: Homepage, https://github.com/ergodic-ai/supyagent
|
|
6
|
+
Project-URL: Documentation, https://github.com/ergodic-ai/supyagent#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/ergodic-ai/supyagent
|
|
8
|
+
Project-URL: Issues, https://github.com/ergodic-ai/supyagent/issues
|
|
9
|
+
Author-email: Ergodic AI <hello@ergodic.ai>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent,ai,automation,chatbot,litellm,llm,multi-agent,orchestration,supypowers,tools
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: click>=8.0
|
|
26
|
+
Requires-Dist: cryptography>=41.0
|
|
27
|
+
Requires-Dist: litellm>=1.30.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Requires-Dist: rich>=13.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# Supyagent
|
|
38
|
+
|
|
39
|
+
[](https://badge.fury.io/py/supyagent)
|
|
40
|
+
[](https://www.python.org/downloads/)
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
|
|
43
|
+
LLM agents powered by [supypowers](https://github.com/ergodic-ai/supypowers) tools.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- 🤖 **Interactive & Execution Agents** - Chat interactively or run automated pipelines
|
|
48
|
+
- 🔧 **Tool Integration** - Use any supypowers function as an agent tool
|
|
49
|
+
- 🌐 **Any LLM Provider** - Via [LiteLLM](https://docs.litellm.ai/docs/) (OpenAI, Anthropic, Ollama, etc.)
|
|
50
|
+
- 📝 **YAML Configuration** - Simple, declarative agent definitions
|
|
51
|
+
- 🔄 **Session Persistence** - Conversations persist across sessions
|
|
52
|
+
- 🔐 **Credential Management** - Secure storage for API keys and secrets
|
|
53
|
+
- 🎭 **Multi-Agent Orchestration** - Agents can delegate tasks to other agents
|
|
54
|
+
- 📦 **Batch Processing** - Process multiple inputs from JSONL/CSV files
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install supyagent
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or with [uv](https://github.com/astral-sh/uv):
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
uv pip install supyagent
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Create your first agent
|
|
72
|
+
supyagent new myagent
|
|
73
|
+
|
|
74
|
+
# Start chatting
|
|
75
|
+
supyagent chat myagent
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
### Interactive Mode
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Create an interactive agent
|
|
84
|
+
supyagent new researcher
|
|
85
|
+
|
|
86
|
+
# Chat with it
|
|
87
|
+
supyagent chat researcher
|
|
88
|
+
|
|
89
|
+
# Resume a previous session
|
|
90
|
+
supyagent chat researcher --session <session-id>
|
|
91
|
+
|
|
92
|
+
# Start fresh
|
|
93
|
+
supyagent chat researcher --new
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Execution Mode
|
|
97
|
+
|
|
98
|
+
For automation and pipelines:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Create an execution agent
|
|
102
|
+
supyagent new summarizer --type execution
|
|
103
|
+
|
|
104
|
+
# Run with inline input
|
|
105
|
+
supyagent run summarizer "Summarize this text..."
|
|
106
|
+
|
|
107
|
+
# Run with file input
|
|
108
|
+
supyagent run summarizer --input document.txt
|
|
109
|
+
|
|
110
|
+
# Get JSON output
|
|
111
|
+
supyagent run summarizer --input doc.txt --output json
|
|
112
|
+
|
|
113
|
+
# Pipe from stdin
|
|
114
|
+
cat article.txt | supyagent run summarizer
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Batch Processing
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Process multiple inputs
|
|
121
|
+
supyagent batch summarizer inputs.jsonl --output results.jsonl
|
|
122
|
+
|
|
123
|
+
# From CSV
|
|
124
|
+
supyagent batch summarizer data.csv --format csv
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Multi-Agent Orchestration
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Use the planning agent to orchestrate complex tasks
|
|
131
|
+
supyagent plan "Build a Python library for data validation"
|
|
132
|
+
|
|
133
|
+
# The planner will delegate to specialist agents (coder, writer, researcher)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Agent Configuration
|
|
137
|
+
|
|
138
|
+
Agents are defined in YAML files in the `agents/` directory:
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
name: researcher
|
|
142
|
+
description: An AI research assistant
|
|
143
|
+
type: interactive # or "execution"
|
|
144
|
+
|
|
145
|
+
model:
|
|
146
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
147
|
+
temperature: 0.7
|
|
148
|
+
max_tokens: 4096
|
|
149
|
+
|
|
150
|
+
system_prompt: |
|
|
151
|
+
You are a helpful research assistant...
|
|
152
|
+
|
|
153
|
+
tools:
|
|
154
|
+
allow:
|
|
155
|
+
- "*" # Allow all tools
|
|
156
|
+
# or be specific:
|
|
157
|
+
# - "web:*" # All functions in web.py
|
|
158
|
+
# - "math:calc" # Specific function
|
|
159
|
+
deny:
|
|
160
|
+
- "dangerous:*" # Block specific tools
|
|
161
|
+
|
|
162
|
+
# For multi-agent support
|
|
163
|
+
delegates:
|
|
164
|
+
- coder
|
|
165
|
+
- writer
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### LLM Providers
|
|
169
|
+
|
|
170
|
+
Supyagent uses LiteLLM, supporting 100+ providers:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
model:
|
|
174
|
+
# OpenAI
|
|
175
|
+
provider: openai/gpt-4o
|
|
176
|
+
|
|
177
|
+
# Anthropic
|
|
178
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
179
|
+
|
|
180
|
+
# Ollama (local)
|
|
181
|
+
provider: ollama/llama3
|
|
182
|
+
|
|
183
|
+
# Azure OpenAI
|
|
184
|
+
provider: azure/gpt-4
|
|
185
|
+
|
|
186
|
+
# Google
|
|
187
|
+
provider: gemini/gemini-pro
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Set API keys as environment variables:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
export OPENAI_API_KEY=sk-...
|
|
194
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## CLI Reference
|
|
198
|
+
|
|
199
|
+
### Core Commands
|
|
200
|
+
|
|
201
|
+
| Command | Description |
|
|
202
|
+
|---------|-------------|
|
|
203
|
+
| `supyagent new <name>` | Create a new agent |
|
|
204
|
+
| `supyagent list` | List all agents |
|
|
205
|
+
| `supyagent show <name>` | Show agent details |
|
|
206
|
+
| `supyagent chat <name>` | Interactive chat session |
|
|
207
|
+
| `supyagent run <name> <task>` | Execute agent (non-interactive) |
|
|
208
|
+
| `supyagent batch <name> <file>` | Process multiple inputs |
|
|
209
|
+
| `supyagent plan <task>` | Run task through planning agent |
|
|
210
|
+
|
|
211
|
+
### Session Commands
|
|
212
|
+
|
|
213
|
+
| Command | Description |
|
|
214
|
+
|---------|-------------|
|
|
215
|
+
| `supyagent sessions <name>` | List sessions for an agent |
|
|
216
|
+
| `supyagent chat <name> --session <id>` | Resume a session |
|
|
217
|
+
| `supyagent chat <name> --new` | Start a new session |
|
|
218
|
+
|
|
219
|
+
### Agent Management
|
|
220
|
+
|
|
221
|
+
| Command | Description |
|
|
222
|
+
|---------|-------------|
|
|
223
|
+
| `supyagent agents` | List active agent instances |
|
|
224
|
+
| `supyagent cleanup` | Remove completed instances |
|
|
225
|
+
|
|
226
|
+
### In-Chat Commands
|
|
227
|
+
|
|
228
|
+
While chatting, use these commands:
|
|
229
|
+
|
|
230
|
+
| Command | Description |
|
|
231
|
+
|---------|-------------|
|
|
232
|
+
| `/help` | Show available commands |
|
|
233
|
+
| `/tools` | List available tools |
|
|
234
|
+
| `/history` | Show conversation history |
|
|
235
|
+
| `/sessions` | List your sessions |
|
|
236
|
+
| `/switch <id>` | Switch to another session |
|
|
237
|
+
| `/new` | Start a new session |
|
|
238
|
+
| `/save <title>` | Save session with title |
|
|
239
|
+
| `/export <file>` | Export session to file |
|
|
240
|
+
| `/model <name>` | Switch LLM model |
|
|
241
|
+
| `/creds` | Manage stored credentials |
|
|
242
|
+
| `/clear` | Clear conversation history |
|
|
243
|
+
| `/quit` | Exit the chat |
|
|
244
|
+
|
|
245
|
+
## Project Structure
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
your-project/
|
|
249
|
+
├── agents/ # Agent YAML definitions
|
|
250
|
+
│ ├── assistant.yaml
|
|
251
|
+
│ ├── planner.yaml
|
|
252
|
+
│ └── researcher.yaml
|
|
253
|
+
├── supypowers/ # Tool definitions (Python)
|
|
254
|
+
│ ├── hello.py
|
|
255
|
+
│ └── web_search.py
|
|
256
|
+
└── .supyagent/ # Runtime data (gitignore this)
|
|
257
|
+
├── sessions/ # Conversation history
|
|
258
|
+
├── credentials/ # Encrypted secrets
|
|
259
|
+
└── registry.json # Agent instances
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Credential Management
|
|
263
|
+
|
|
264
|
+
Supyagent securely manages API keys and secrets:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# In chat, agents can request credentials
|
|
268
|
+
🔑 Credential requested: SLACK_API_TOKEN
|
|
269
|
+
Purpose: To send messages to Slack
|
|
270
|
+
Enter value (or press Enter to skip): ****
|
|
271
|
+
Save for future sessions? [Y/n]: y
|
|
272
|
+
|
|
273
|
+
# View stored credentials
|
|
274
|
+
/creds
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Credentials are encrypted at rest using Fernet encryption.
|
|
278
|
+
|
|
279
|
+
## Multi-Agent Architecture
|
|
280
|
+
|
|
281
|
+
Create orchestrator agents that delegate to specialists:
|
|
282
|
+
|
|
283
|
+
```yaml
|
|
284
|
+
# agents/planner.yaml
|
|
285
|
+
name: planner
|
|
286
|
+
type: interactive
|
|
287
|
+
|
|
288
|
+
delegates:
|
|
289
|
+
- researcher # Can delegate research tasks
|
|
290
|
+
- coder # Can delegate coding tasks
|
|
291
|
+
- writer # Can delegate writing tasks
|
|
292
|
+
|
|
293
|
+
system_prompt: |
|
|
294
|
+
You are a planning agent. Break down complex tasks
|
|
295
|
+
and delegate to specialist agents...
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
The planner can then:
|
|
299
|
+
1. Analyze tasks
|
|
300
|
+
2. Create execution plans
|
|
301
|
+
3. Delegate subtasks to appropriate agents
|
|
302
|
+
4. Synthesize results
|
|
303
|
+
|
|
304
|
+
## Development
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# Clone the repo
|
|
308
|
+
git clone https://github.com/ergodic-ai/supyagent
|
|
309
|
+
cd supyagent
|
|
310
|
+
|
|
311
|
+
# Install with dev dependencies
|
|
312
|
+
uv pip install -e ".[dev]"
|
|
313
|
+
|
|
314
|
+
# Run tests
|
|
315
|
+
pytest
|
|
316
|
+
|
|
317
|
+
# Run linting
|
|
318
|
+
ruff check .
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT
|
|
324
|
+
|
|
325
|
+
## Related Projects
|
|
326
|
+
|
|
327
|
+
- [supypowers](https://github.com/ergodic-ai/supypowers) - Tool execution framework
|
|
328
|
+
- [LiteLLM](https://github.com/BerriAI/litellm) - LLM provider abstraction
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
# Supyagent
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/supyagent)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
LLM agents powered by [supypowers](https://github.com/ergodic-ai/supypowers) tools.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🤖 **Interactive & Execution Agents** - Chat interactively or run automated pipelines
|
|
12
|
+
- 🔧 **Tool Integration** - Use any supypowers function as an agent tool
|
|
13
|
+
- 🌐 **Any LLM Provider** - Via [LiteLLM](https://docs.litellm.ai/docs/) (OpenAI, Anthropic, Ollama, etc.)
|
|
14
|
+
- 📝 **YAML Configuration** - Simple, declarative agent definitions
|
|
15
|
+
- 🔄 **Session Persistence** - Conversations persist across sessions
|
|
16
|
+
- 🔐 **Credential Management** - Secure storage for API keys and secrets
|
|
17
|
+
- 🎭 **Multi-Agent Orchestration** - Agents can delegate tasks to other agents
|
|
18
|
+
- 📦 **Batch Processing** - Process multiple inputs from JSONL/CSV files
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install supyagent
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or with [uv](https://github.com/astral-sh/uv):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv pip install supyagent
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Create your first agent
|
|
36
|
+
supyagent new myagent
|
|
37
|
+
|
|
38
|
+
# Start chatting
|
|
39
|
+
supyagent chat myagent
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### Interactive Mode
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Create an interactive agent
|
|
48
|
+
supyagent new researcher
|
|
49
|
+
|
|
50
|
+
# Chat with it
|
|
51
|
+
supyagent chat researcher
|
|
52
|
+
|
|
53
|
+
# Resume a previous session
|
|
54
|
+
supyagent chat researcher --session <session-id>
|
|
55
|
+
|
|
56
|
+
# Start fresh
|
|
57
|
+
supyagent chat researcher --new
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Execution Mode
|
|
61
|
+
|
|
62
|
+
For automation and pipelines:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Create an execution agent
|
|
66
|
+
supyagent new summarizer --type execution
|
|
67
|
+
|
|
68
|
+
# Run with inline input
|
|
69
|
+
supyagent run summarizer "Summarize this text..."
|
|
70
|
+
|
|
71
|
+
# Run with file input
|
|
72
|
+
supyagent run summarizer --input document.txt
|
|
73
|
+
|
|
74
|
+
# Get JSON output
|
|
75
|
+
supyagent run summarizer --input doc.txt --output json
|
|
76
|
+
|
|
77
|
+
# Pipe from stdin
|
|
78
|
+
cat article.txt | supyagent run summarizer
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Batch Processing
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Process multiple inputs
|
|
85
|
+
supyagent batch summarizer inputs.jsonl --output results.jsonl
|
|
86
|
+
|
|
87
|
+
# From CSV
|
|
88
|
+
supyagent batch summarizer data.csv --format csv
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Multi-Agent Orchestration
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Use the planning agent to orchestrate complex tasks
|
|
95
|
+
supyagent plan "Build a Python library for data validation"
|
|
96
|
+
|
|
97
|
+
# The planner will delegate to specialist agents (coder, writer, researcher)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Agent Configuration
|
|
101
|
+
|
|
102
|
+
Agents are defined in YAML files in the `agents/` directory:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
name: researcher
|
|
106
|
+
description: An AI research assistant
|
|
107
|
+
type: interactive # or "execution"
|
|
108
|
+
|
|
109
|
+
model:
|
|
110
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
111
|
+
temperature: 0.7
|
|
112
|
+
max_tokens: 4096
|
|
113
|
+
|
|
114
|
+
system_prompt: |
|
|
115
|
+
You are a helpful research assistant...
|
|
116
|
+
|
|
117
|
+
tools:
|
|
118
|
+
allow:
|
|
119
|
+
- "*" # Allow all tools
|
|
120
|
+
# or be specific:
|
|
121
|
+
# - "web:*" # All functions in web.py
|
|
122
|
+
# - "math:calc" # Specific function
|
|
123
|
+
deny:
|
|
124
|
+
- "dangerous:*" # Block specific tools
|
|
125
|
+
|
|
126
|
+
# For multi-agent support
|
|
127
|
+
delegates:
|
|
128
|
+
- coder
|
|
129
|
+
- writer
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### LLM Providers
|
|
133
|
+
|
|
134
|
+
Supyagent uses LiteLLM, supporting 100+ providers:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
model:
|
|
138
|
+
# OpenAI
|
|
139
|
+
provider: openai/gpt-4o
|
|
140
|
+
|
|
141
|
+
# Anthropic
|
|
142
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
143
|
+
|
|
144
|
+
# Ollama (local)
|
|
145
|
+
provider: ollama/llama3
|
|
146
|
+
|
|
147
|
+
# Azure OpenAI
|
|
148
|
+
provider: azure/gpt-4
|
|
149
|
+
|
|
150
|
+
# Google
|
|
151
|
+
provider: gemini/gemini-pro
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Set API keys as environment variables:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
export OPENAI_API_KEY=sk-...
|
|
158
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## CLI Reference
|
|
162
|
+
|
|
163
|
+
### Core Commands
|
|
164
|
+
|
|
165
|
+
| Command | Description |
|
|
166
|
+
|---------|-------------|
|
|
167
|
+
| `supyagent new <name>` | Create a new agent |
|
|
168
|
+
| `supyagent list` | List all agents |
|
|
169
|
+
| `supyagent show <name>` | Show agent details |
|
|
170
|
+
| `supyagent chat <name>` | Interactive chat session |
|
|
171
|
+
| `supyagent run <name> <task>` | Execute agent (non-interactive) |
|
|
172
|
+
| `supyagent batch <name> <file>` | Process multiple inputs |
|
|
173
|
+
| `supyagent plan <task>` | Run task through planning agent |
|
|
174
|
+
|
|
175
|
+
### Session Commands
|
|
176
|
+
|
|
177
|
+
| Command | Description |
|
|
178
|
+
|---------|-------------|
|
|
179
|
+
| `supyagent sessions <name>` | List sessions for an agent |
|
|
180
|
+
| `supyagent chat <name> --session <id>` | Resume a session |
|
|
181
|
+
| `supyagent chat <name> --new` | Start a new session |
|
|
182
|
+
|
|
183
|
+
### Agent Management
|
|
184
|
+
|
|
185
|
+
| Command | Description |
|
|
186
|
+
|---------|-------------|
|
|
187
|
+
| `supyagent agents` | List active agent instances |
|
|
188
|
+
| `supyagent cleanup` | Remove completed instances |
|
|
189
|
+
|
|
190
|
+
### In-Chat Commands
|
|
191
|
+
|
|
192
|
+
While chatting, use these commands:
|
|
193
|
+
|
|
194
|
+
| Command | Description |
|
|
195
|
+
|---------|-------------|
|
|
196
|
+
| `/help` | Show available commands |
|
|
197
|
+
| `/tools` | List available tools |
|
|
198
|
+
| `/history` | Show conversation history |
|
|
199
|
+
| `/sessions` | List your sessions |
|
|
200
|
+
| `/switch <id>` | Switch to another session |
|
|
201
|
+
| `/new` | Start a new session |
|
|
202
|
+
| `/save <title>` | Save session with title |
|
|
203
|
+
| `/export <file>` | Export session to file |
|
|
204
|
+
| `/model <name>` | Switch LLM model |
|
|
205
|
+
| `/creds` | Manage stored credentials |
|
|
206
|
+
| `/clear` | Clear conversation history |
|
|
207
|
+
| `/quit` | Exit the chat |
|
|
208
|
+
|
|
209
|
+
## Project Structure
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
your-project/
|
|
213
|
+
├── agents/ # Agent YAML definitions
|
|
214
|
+
│ ├── assistant.yaml
|
|
215
|
+
│ ├── planner.yaml
|
|
216
|
+
│ └── researcher.yaml
|
|
217
|
+
├── supypowers/ # Tool definitions (Python)
|
|
218
|
+
│ ├── hello.py
|
|
219
|
+
│ └── web_search.py
|
|
220
|
+
└── .supyagent/ # Runtime data (gitignore this)
|
|
221
|
+
├── sessions/ # Conversation history
|
|
222
|
+
├── credentials/ # Encrypted secrets
|
|
223
|
+
└── registry.json # Agent instances
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Credential Management
|
|
227
|
+
|
|
228
|
+
Supyagent securely manages API keys and secrets:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# In chat, agents can request credentials
|
|
232
|
+
🔑 Credential requested: SLACK_API_TOKEN
|
|
233
|
+
Purpose: To send messages to Slack
|
|
234
|
+
Enter value (or press Enter to skip): ****
|
|
235
|
+
Save for future sessions? [Y/n]: y
|
|
236
|
+
|
|
237
|
+
# View stored credentials
|
|
238
|
+
/creds
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Credentials are encrypted at rest using Fernet encryption.
|
|
242
|
+
|
|
243
|
+
## Multi-Agent Architecture
|
|
244
|
+
|
|
245
|
+
Create orchestrator agents that delegate to specialists:
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
# agents/planner.yaml
|
|
249
|
+
name: planner
|
|
250
|
+
type: interactive
|
|
251
|
+
|
|
252
|
+
delegates:
|
|
253
|
+
- researcher # Can delegate research tasks
|
|
254
|
+
- coder # Can delegate coding tasks
|
|
255
|
+
- writer # Can delegate writing tasks
|
|
256
|
+
|
|
257
|
+
system_prompt: |
|
|
258
|
+
You are a planning agent. Break down complex tasks
|
|
259
|
+
and delegate to specialist agents...
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
The planner can then:
|
|
263
|
+
1. Analyze tasks
|
|
264
|
+
2. Create execution plans
|
|
265
|
+
3. Delegate subtasks to appropriate agents
|
|
266
|
+
4. Synthesize results
|
|
267
|
+
|
|
268
|
+
## Development
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Clone the repo
|
|
272
|
+
git clone https://github.com/ergodic-ai/supyagent
|
|
273
|
+
cd supyagent
|
|
274
|
+
|
|
275
|
+
# Install with dev dependencies
|
|
276
|
+
uv pip install -e ".[dev]"
|
|
277
|
+
|
|
278
|
+
# Run tests
|
|
279
|
+
pytest
|
|
280
|
+
|
|
281
|
+
# Run linting
|
|
282
|
+
ruff check .
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## License
|
|
286
|
+
|
|
287
|
+
MIT
|
|
288
|
+
|
|
289
|
+
## Related Projects
|
|
290
|
+
|
|
291
|
+
- [supypowers](https://github.com/ergodic-ai/supypowers) - Tool execution framework
|
|
292
|
+
- [LiteLLM](https://github.com/BerriAI/litellm) - LLM provider abstraction
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: assistant
|
|
2
|
+
description: A helpful AI assistant that can use supypowers tools
|
|
3
|
+
version: "1.0"
|
|
4
|
+
type: interactive
|
|
5
|
+
|
|
6
|
+
model:
|
|
7
|
+
provider: anthropic/claude-3-5-sonnet-20241022
|
|
8
|
+
temperature: 0.7
|
|
9
|
+
max_tokens: 4096
|
|
10
|
+
|
|
11
|
+
system_prompt: |
|
|
12
|
+
You are a helpful AI assistant. You can use tools via supypowers to help
|
|
13
|
+
accomplish tasks.
|
|
14
|
+
|
|
15
|
+
When the user asks you to do something that requires a tool:
|
|
16
|
+
1. Check what tools are available
|
|
17
|
+
2. Use the appropriate tool
|
|
18
|
+
3. Report the results clearly
|
|
19
|
+
|
|
20
|
+
Be concise, helpful, and accurate. If you don't have the right tool
|
|
21
|
+
for a task, let the user know.
|
|
22
|
+
|
|
23
|
+
tools:
|
|
24
|
+
allow:
|
|
25
|
+
- "*" # Allow all available tools
|
|
26
|
+
|
|
27
|
+
limits:
|
|
28
|
+
max_tool_calls_per_turn: 10
|