|
| 1 | +# Agent Design Patterns |
| 2 | + |
| 3 | +Guide for designing AI agents in ObjectStack. |
| 4 | + |
| 5 | +## Agent Types |
| 6 | + |
| 7 | +- **Data Chat** — Natural language query interface for data |
| 8 | +- **Metadata Assistant** — Schema design and modification helper |
| 9 | +- **Custom Agents** — Domain-specific AI assistants |
| 10 | + |
| 11 | +## Agent Configuration |
| 12 | + |
| 13 | +```typescript |
| 14 | +{ |
| 15 | + name: 'customer_support_agent', |
| 16 | + model: 'gpt-4', |
| 17 | + systemPrompt: 'You are a helpful customer support agent...', |
| 18 | + tools: ['query_records', 'create_record', 'send_email'], |
| 19 | + context: { |
| 20 | + objects: ['account', 'contact', 'case'], |
| 21 | + }, |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +## Tool Definition |
| 26 | + |
| 27 | +```typescript |
| 28 | +{ |
| 29 | + name: 'query_records', |
| 30 | + description: 'Query records from an object', |
| 31 | + parameters: { |
| 32 | + object: { type: 'string', required: true }, |
| 33 | + filter: { type: 'object' }, |
| 34 | + limit: { type: 'number', default: 10 }, |
| 35 | + }, |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +## Incorrect vs Correct |
| 40 | + |
| 41 | +### ❌ Incorrect — Vague Tool Description |
| 42 | + |
| 43 | +```typescript |
| 44 | +{ |
| 45 | + name: 'get_data', // ❌ Vague name |
| 46 | + description: 'Gets data', // ❌ Vague description |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +### ✅ Correct — Clear Tool Definition |
| 51 | + |
| 52 | +```typescript |
| 53 | +{ |
| 54 | + name: 'query_account_records', // ✅ Specific name |
| 55 | + description: 'Query account records with optional filters and pagination', // ✅ Clear description |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +## Best Practices |
| 60 | + |
| 61 | +1. **Use clear, descriptive tool names** — Agent must understand purpose |
| 62 | +2. **Provide detailed tool descriptions** — Include examples |
| 63 | +3. **Limit tool count** — 5-10 tools per agent max |
| 64 | +4. **Define parameter schemas** — Validate input |
| 65 | +5. **Handle errors gracefully** — Return user-friendly messages |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +See parent skill for complete documentation: [../SKILL.md](../SKILL.md) |
0 commit comments