File size: 8,642 Bytes
e56fe9e 4f8462f e56fe9e 4f8462f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | ---
license: mit
tags:
- agentic-workflows
- llm-agents
- prompt-engineering
- tool-use
- function-calling
- agent-security
- prompt-injection
- synthetic-data
- preference-data
- dpo
- rlhf
- instruction-tuning
language:
- en
size_categories:
- 1K<n<10K
task_categories:
- text-generation
- question-answering
task_ids:
- text2text-generation
- dialogue-modeling
pretty_name: Agentic Workflows 6K
dataset_info:
features:
- name: question
dtype: string
- name: chosen
dtype: string
splits:
- name: train
num_examples: 6000
downloads: 0
configs:
- config_name: default
data_files:
- split: train
path: agentic_workflows_6k.parquet
---
# Agentic Workflows 6K Dataset
A high-quality preference dataset of **6,000 question-answer pairs** covering agentic workflows, LLM agent design patterns, tool/function calling, prompt engineering, and agent security. Designed for **DPO/RLHF training**, **instruction tuning**, and **agent capability evaluation**.
## π Dataset Overview
| Property | Value |
|----------|-------|
| **Examples** | 6,000 |
| **Format** | Parquet (question + chosen response) |
| **Language** | English |
| **License** | MIT |
| **Task** | Preference learning, Instruction tuning, Agent training |
| **Size** | ~47.6 KB (compressed) |
## π― Use Cases
- **DPO / RLHF Training**: Preference pairs for aligning models to agentic behavior
- **Instruction Tuning**: High-quality Q&A for teaching agent workflows
- **Agent Benchmarking**: Evaluate model capability on agent design questions
- **Synthetic Data Generation**: Seed for generating more agentic training data
- **RAG / Few-shot**: Reference implementations for agent patterns
## π Data Structure
Each example contains two fields:
```json
{
"question": "How do I protect my AI agent from prompt injection attacks where malicious content in the environment tries to hijack the agent?",
"chosen": "## Agent Security: Defending Against Prompt Injection\n\n### The Threat Model\n\nPrompt injection is unique to agents because agents process untrusted content (web pages, emails, files) as part of their operation..."
}
```
- **`question`** (string): A practical question about agentic workflows, agent design, tool use, or agent security
- **`chosen`** (string): A comprehensive, well-structured markdown response with code examples, threat models, best practices, and actionable guidance
## π§ Topic Coverage
The dataset spans **agentic workflow domains**:
| Category | Example Topics |
|----------|----------------|
| **Agent Security** | Prompt injection defense, sandboxing, tool permissions, data exfiltration prevention |
| **Tool/Function Design** | Schema design, error handling, composition patterns, parallel execution, retry logic |
| **Prompt Engineering** | System prompts, few-shot examples, chain-of-thought, ReAct, Plan-and-Execute |
| **Memory & State** | Conversation history, long-term memory, context windows, retrieval-augmented agents |
| **Multi-Agent Systems** | Orchestration, delegation, communication protocols, consensus mechanisms |
| **Evaluation & Observability** | Tracing, metrics, eval frameworks, debugging agent failures |
| **Production Patterns** | Rate limiting, cost optimization, fallbacks, human-in-the-loop, gradual rollout |
## π‘ Example Questions
- *"What are the best patterns for designing LLM tools/functions? I want to avoid common mistakes that make agents fail."*
- *"How do I protect my AI agent from prompt injection attacks where malicious content in the environment tries to hijack the agent?"*
- *"What's the recommended approach for handling tool failures gracefully in an agent loop?"*
- *"How should I structure system prompts for multi-step agent workflows?"*
- *"What are the tradeoffs between ReAct and Plan-and-Execute agent architectures?"*
## π Quick Start
### Load with Hugging Face `datasets`
```python
from datasets import load_dataset
# Load the dataset
dataset = load_dataset("R0U5/agentic_workflows_6k", split="train")
# Inspect
print(dataset[0])
# {'question': 'How do I protect my AI agent from prompt injection...',
# 'chosen': '## Agent Security: Defending Against Prompt Injection...'}
# Convert to preference format for DPO
def format_for_dpo(example):
return {
"prompt": example["question"],
"chosen": example["chosen"],
"rejected": "" # Add your rejected responses here
}
dpo_dataset = dataset.map(format_for_dpo)
```
### Load with Pandas
```python
import pandas as pd
df = pd.read_parquet("hf://datasets/R0U5/agentic_workflows_6k/agentic_workflows_6k.parquet")
print(df.head())
print(f"Total examples: {len(df)}")
```
## π§ Training Example: DPO with TRL
```python
from trl import DPOTrainer
from transformers import AutoModelForCausalLM, AutoTokenizer
from datasets import load_dataset
model = AutoModelForCausalLM.from_pretrained("your-base-model")
tokenizer = AutoTokenizer.from_pretrained("your-base-model")
tokenizer.pad_token = tokenizer.eos_token
dataset = load_dataset("R0U5/agentic_workflows_6k", split="train")
# Format for DPO (requires rejected responses - generate or curate)
def format_dpo(example):
return {
"prompt": example["question"],
"chosen": example["chosen"],
"rejected": generate_rejected(example["question"]) # Your method
}
train_dataset = dataset.map(format_dpo)
trainer = DPOTrainer(
model=model,
args=TrainingArguments(
output_dir="./agent-dpo",
per_device_train_batch_size=4,
num_train_epochs=3,
learning_rate=5e-7,
),
train_dataset=train_dataset,
tokenizer=tokenizer,
)
trainer.train()
```
## π Dataset Statistics
```
Examples: 6,000
Avg question length: ~150 chars
Avg response length: ~2,500 chars
Total tokens (est): ~15M
Format: Markdown with code blocks, headers, lists
```
## ποΈ Data Generation
This dataset was created through a **curated synthetic generation pipeline**:
1. **Seed topics** collected from agent development forums, GitHub issues, technical blogs
2. **Question generation** using diverse prompt templates covering all major agentic workflow categories
3. **Response generation** with high-quality models instructed to produce comprehensive, structured markdown
4. **Quality filtering** for completeness, accuracy, code correctness, and formatting consistency
5. **Deduplication** and near-dedup removal
## βοΈ License
**MIT License** β Free for commercial and research use.
```
MIT License
Copyright (c) 2024 R0U5
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
## π Citation
If you use this dataset in your research, please cite:
```bibtex
@misc{agentic_workflows_6k,
title={Agentic Workflows 6K: A Preference Dataset for LLM Agent Training},
author={R0U5},
year={2024},
publisher={Hugging Face},
url={https://huggingface.co/datasets/R0U5/agentic_workflows_6k},
note={MIT License}
}
```
## π Related Resources
- [Hugging Face Datasets Library](https://huggingface.co/docs/datasets)
- [TRL DPO Trainer](https://huggingface.co/docs/trl/main/en/dpo_trainer)
- [Agent Security Best Practices](https://github.com/owasp/www-project-ai-security)
- [Function Calling Patterns](https://platform.openai.com/docs/guides/function-calling)
## π Support
- **Issues**: [GitHub Issues](https://github.com/R0U5/Electric-Sheep/issues) (or HF Discussions tab)
- **Questions**: Open a Discussion on this dataset page
---
*Dataset created as part of the [Electric Sheep](https://github.com/R0U5/Electric-Sheep) project β self-improving agentic systems research.* |