Skip to content

Agent Configuration

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 (see below)
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)
... // Other AxLLM model config options
},
options: { // Optional: Additional settings
debug: false, // Whether to log debug info
stream: true // Whether to stream responses
... // Other AxCrew options
},
agents: ["OtherAgent1", "OtherAgent2"], // Optional: Agents this agent depends on. Note that if you specify agents here, they must be defined in the crew config.
functions: [ // Optional: Functions (tools) this agent can use.
"CurrentDateTime", // Built-in function
"DaysBetweenDates", // Built-in function
{ // Custom function
name: 'googleSearch',
description: 'Use this function to search google for links related to the query',
func: googleSearchAPI,
parameters: {
type: 'object',
properties: {
query: {
description: `The query to search for`,
type: 'string'
},
}
}
}
],
mcpServers: { // Optional: MCP server configurations
"google-maps": { // Server name
"command": "npx", // Command to launch server
"args": [ // Arguments for the command
"-y",
"@modelcontextprotocol/server-google-maps"
],
"env": { // Environment variables
"GOOGLE_MAPS_API_KEY": "your_api_key"
}
},
"custom-api": { // Example of HTTP transport
"sseUrl": "http://localhost:3000/sse"
}
}
examples: [ // Optional: Example input/output pairs depending on the agent's signature.
{
input: "example input",
output: "example output"
}
]
}
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.).

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
}

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

Examples help guide the agent’s behavior by providing clear input/output pairs:

examples: [
{
problem: "what is the square root of 144?",
solution: "Let's solve this step by step:\n1. The square root of a number is a value that, when multiplied by itself, gives the original number\n2. For 144, we need to find a number that when multiplied by itself equals 144\n3. 12 × 12 = 144\nTherefore, the square root of 144 is 12"
},
{
problem: "what is the cube root of 27?",
solution: "Let's solve this step by step:\n1. The cube root of a number is a value that, when multiplied by itself twice, gives the original number\n2. For 27, we need to find a number that when cubed equals 27\n3. 3 × 3 × 3 = 27\nTherefore, the cube root of 27 is 3"
}
]

Note that the field names in the examples should match your agent’s signature.

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 "maximum results to return" -> results:string[] "search results" , totalCount:number "total available results"

For more details on the signature format, see the AxLLM documentation.

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_KEYtogethercomputer/llama-3-8b, togethercomputer/llama-3-70b, etc.
mistralMISTRAL_API_KEYmistral-tiny, mistral-small, mistral-medium, etc.
huggingfaceHUGGINGFACE_API_KEYVarious models available through Hugging Face’s Inference API

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

{
"crew": [
{
"name": "Calculator",
"description": "Performs mathematical calculations",
"signature": "equation:string \"mathematical equation to solve\" -> 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 be completed\" -> 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 the execution of tasks using other agents",
"signature": "question:string \"question to be answered\", plan:string \"plan from the Planner\" -> answer:string \"final answer\"",
"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"
]
}
}
}
]
}