AxCrew

Agent Configuration

Learn how to configure agents in your AxCrew

Agent Configuration Options

Each agent in your crew is defined by a configuration object with various properties that control its behavior. Here's a complete reference of all available configuration options:

{
  name: "AgentName",                // Required: Unique name for the agent
  description: "Agent description",  // Required: What the agent does
  signature: "input:type -> output:type", // Required: Input/output signature
  provider: "openai",               // Required: AI provider to use
  providerKeyName: "OPENAI_API_KEY", // Required: Env var name for API key
  ai: {                             // Required: AI model configuration
    model: "gpt-4",                 // Required: Model to use
    temperature: 0.7,               // Randomness (0-1)
  },
  definition: "...",                // Optional: Agent persona (min 100 chars)
  prompt: "...",                    // Optional: Alias for definition
  providerArgs: {},                 // Optional: Provider-specific arguments
  options: {                        // Optional: Additional settings
    debug: false,                   // Whether to log debug info
    stream: true                    // Whether to stream responses
  },
  agents: ["OtherAgent1"],          // Optional: Sub-agent dependencies
  functions: ["FunctionName"],      // Optional: Functions this agent can use
  mcpServers: {},                   // Optional: MCP server configurations
  examples: [],                     // Optional: Example input/output pairs
  ace: {}                           // Optional: ACE learning configuration
}

Required Fields

FieldDescription
nameA unique identifier for the agent within the crew.
descriptionA clear description of what the agent does. Helps guide the AI model.
signatureDefines the input and output structure in the format: input:type -> output:type.
providerThe AI provider to use (e.g., "openai", "anthropic", "google-gemini").
providerKeyNameThe name of the environment variable containing the API key.
aiConfiguration settings for the AI model (model name, temperature, etc.).

AI Configuration

The ai object contains settings specific to the AI model:

ai: {
  model: "gpt-4",           // Required: Model name (provider-specific)
  temperature: 0.7,         // Optional: Controls randomness (0-1)
  maxTokens: 2000,          // Optional: Maximum response length
  topP: 0.9,                // Optional: Nucleus sampling parameter
  presencePenalty: 0.0,     // Optional: Penalize new token repeat
  frequencyPenalty: 0.0     // Optional: Penalize all repeat
}

Agent Persona (definition/prompt)

You can customize the agent's persona using the definition or prompt field:

  • definition: Detailed persona/program description used as the system prompt. Must be at least 100 characters.
  • prompt: An alias for definition. If both are provided, definition takes precedence.
{
  "name": "Planner",
  "description": "Creates a plan to complete a task",
  "definition": "You are a meticulous planning assistant. Produce concise, executable step-by-step plans with clear justifications, constraints, and assumptions. Prefer brevity, avoid fluff, and ask for missing critical details before proceeding when necessary.",
  "signature": "task:string -> plan:string",
  "provider": "google-gemini",
  "providerKeyName": "GEMINI_API_KEY",
  "ai": { "model": "gemini-1.5-flash", "temperature": 0 }
}

Provider Arguments (providerArgs)

Some providers require extra top-level configuration beyond ai.model. Pass these via providerArgs:

{
  name: "AzureAgent",
  provider: "azure-openai",
  providerKeyName: "AZURE_OPENAI_API_KEY",
  providerArgs: {
    resourceName: "my-azure-resource",
    deploymentName: "gpt-4-deployment",
    version: "2024-02-15-preview"
  },
  // ...
}

AxCrew forwards providerArgs to Ax unchanged. Refer to Ax provider docs for supported fields.

Agent Dependencies

Use the agents array to specify other agents that this agent depends on:

agents: ["Researcher", "Calculator"]

When agents have dependencies:

  • Dependencies must be initialized before the dependent agent
  • The AxCrew system will automatically handle initialization order when using crew.addAllAgents() or crew.addAgentsToCrew()
  • Dependent agents have access to the capabilities of their dependencies

Signature Format

The signature defines the input and output structure for your agent. It follows this format:

inputName:inputType "input description" -> outputName:outputType "output description"

For example:

task:string "a task to be completed" -> plan:string "a plan to execute the task"

This defines:

  • An input named task of type string
  • An output named plan of type string
  • Descriptions for both input and output

You can have multiple inputs and outputs:

query:string "search query", maxResults:number "max results" -> results:string[] "search results", totalCount:number "total results"

Supported Providers and Models

AxCrew supports all providers and models supported by AxLLM.

ProviderEnvironment VariableModels
openaiOPENAI_API_KEYgpt-4, gpt-4-turbo, gpt-3.5-turbo, etc.
anthropicANTHROPIC_API_KEYclaude-3-opus, claude-3-sonnet, claude-3-haiku, etc.
google-geminiGEMINI_API_KEYgemini-1.5-pro, gemini-1.5-flash, etc.
cohereCOHERE_API_KEYcommand, command-r, command-r-plus, etc.
groqGROQ_API_KEYllama-3-8b-8192, llama-3-70b-8192, mixtral-8x7b-32768, etc.
togetherTOGETHER_API_KEYVarious open-source models
mistralMISTRAL_API_KEYmistral-tiny, mistral-small, mistral-medium, etc.
azure-openaiAZURE_OPENAI_API_KEYAzure-hosted OpenAI models

Complete Configuration Example

Here's a complete example of a crew with multiple agents:

{
  "crew": [
    {
      "name": "Calculator",
      "description": "Performs mathematical calculations",
      "signature": "equation:string \"mathematical equation\" -> result:number \"calculated result\"",
      "provider": "openai",
      "providerKeyName": "OPENAI_API_KEY",
      "ai": {
        "model": "gpt-3.5-turbo",
        "temperature": 0
      }
    },
    {
      "name": "Planner",
      "description": "Creates a plan to complete a task",
      "signature": "task:string \"a task to complete\" -> plan:string \"a plan to execute the task\"",
      "provider": "google-gemini",
      "providerKeyName": "GEMINI_API_KEY",
      "ai": {
        "model": "gemini-1.5-pro",
        "temperature": 0
      }
    },
    {
      "name": "Manager",
      "description": "Manages task execution using other agents",
      "signature": "question:string, plan:string -> answer:string",
      "provider": "anthropic",
      "providerKeyName": "ANTHROPIC_API_KEY",
      "ai": {
        "model": "claude-3-sonnet",
        "temperature": 0.2
      },
      "agents": ["Planner", "Calculator"],
      "functions": ["CurrentDateTime", "DaysBetweenDates"],
      "mcpServers": {
        "playwright": {
          "command": "npx",
          "args": ["@playwright/mcp@latest"]
        }
      }
    }
  ]
}

On this page