Skillful Agents Service Reference

This reference guide covers the essential components and usage patterns of the Skillful Agents service, focusing on practical implementation details.

Core Components

SkillfulAgent Component

The primary component for integrating agents into your Unity game. This component handles:

  • Agent selection and management

  • Message sending and receiving

  • Conversation history tracking

  • Error handling and debugging

Basic Implementation Patterns

Single Agent Pattern

Best for simple implementations with one agent:

using SkillfulAI.Agents;
using UnityEngine;

public class BasicAgent : MonoBehaviour
{
    private SkillfulAgent agent;

    void Start()
    {
        // Basic setup
        agent = gameObject.AddComponent<SkillfulAgent>();
        agent.SelectAgentByName("YourAgentName");
    }

    public void SendQuestion(string question)
    {
        agent.SendMessage(question, HandleResponse);
    }

    private void HandleResponse(string response)
    {
        Debug.Log($"Agent Response: {response}");
    }
}

Multi-Agent Pattern

For games requiring multiple different agents:

Conversation Manager Pattern

For handling complex dialogue flows:

UI Integration Pattern

For creating a chat interface:

Game Event Integration Pattern

For creating event-driven agent interactions:

Best Practices

  1. Agent Selection

    • Select agents early in the game lifecycle

    • Keep agent names consistent with the dashboard

    • Implement fallback behavior for missing agents

  2. Message Handling

    • Keep messages concise and context-aware

    • Implement proper error handling

    • Consider message queuing for multiple requests

  3. Performance

    • Don't spam messages in Update loops

    • Cache agent references

    • Implement cooldowns if needed

If you're stuck or need help, don't hesitate to reach out in our Discord Community

Last updated