Introducing Meta Agents: An agent that creates agents.

Introducing Meta Agents: An agent that creates agents.

Introducing Meta Agents: An agent that creates agents. Instead of manually scripting every new AI assistant, the Meta Agent Generator dynamically builds fully operational single-file ReACT agents.

Need a task done? Spin up an agent. Need multiple agents coordinating? Let them generate and manage each other. This is automation at scale, where agents don’t just execute—they expand, delegate, and optimize.

Built on Deno, it runs anywhere with instant cold starts, secure execution, and TypeScript-native support. No dependency hell, no setup headaches. The system generates fully self-contained, single-file ReACT agents, interleaving chain-of-thought reasoning with execution. Integrated with OpenRouter, it enables high-performance inference while keeping costs predictable.

Agents aren’t just passing text back and forth—they use tools to execute arithmetic, algebra, code evaluation, and time-based queries with exact precision. This is neuro-symbolic reasoning in action—agents don’t just guess; they compute, validate, and refine their outputs. Self-reflection steps let them check and correct their work before returning a final response. Multi-agent communication enables coordination, delegation, and modular problem-solving.

This isn’t just about efficiency—it’s about letting agents run the show. You define the job, they handle the rest. CLI, API, serverless—wherever you deploy, these agents self-assemble, execute, and generate new agents on demand.

The future isn’t isolated AI models. It’s networks of autonomous agents that build, deploy, and optimize themselves.

This is the blueprint. Now go see what it can do.

Visit Github: https://github.com/ruvnet/hello_world_agent/blob/main/meta-agent

Concept

A Meta Agent is an agent that creates single file agents. This generator automates the creation of fully self-contained AI agents which can:

? Understands & Executes: Processes complex user queries step by step.

??? Uses Specialized Tools: Built-in support for calculations, time queries, algebra, and code execution.

?? Self-Optimizes: Reflects on its reasoning, catching and improving errors before returning results.

?? Multi-Agent Communication: (Optional) Follows robots.txt-style controls to coordinate with other agents.

Built using Deno and Typescript

Deno is a modern runtime for JavaScript and TypeScript, designed with security and developer efficiency in mind. Its native TypeScript support and secure-by-default execution environment make it an excellent choice for developing meta agents—autonomous AI entities that process natural language inputs and execute specialized tasks. Deno's robust security model ensures controlled permissions, while its streamlined tooling simplifies the development and deployment of these intelligent agents.

Features

Dynamic Agent Creation: Automatically assembles a complete agent from your configuration, including tool implementations, a robust ReACT loop, and self–reflection.

Built-in Tools:

? Calculator: Performs arithmetic calculations (e.g., "2 + 2" → "4")

? DateTime: Returns current time in ISO format

?? AlgebraSolver: Solves linear equations (e.g., "3*x = 15" → "x = 5")

?? CodeExecutor: Runs JavaScript/TypeScript code securely (e.g., factorial calculations)

User-Defined Customization: Configure:

Optional NPM Package Integration: Import and integrate npm packages via Deno's npm support by providing a comma-separated list of packages.

Multi-Agent Communication Controls: Optionally check a target agent's robots.txt to control inter-agent communication.

Neuro–Symbolic Reasoning Enhancements: The system prompt instructs the agent to use specialized tools for arithmetic, time, and symbolic tasks, enabling exact computations and improved reasoning.

Self–Reflection: An optional reflection step reviews the chain-of-thought and final answer, allowing the agent to catch and correct errors.

Command-Line Arguments

The meta-agent supports extensive configuration through command-line arguments. Here's a comprehensive guide to all available options:

Quick Start Examples

Easily generate and run AI agents with a single command:

# Basic usage - Create a local CLI agent
deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --agentName="MathBot"

# Full configuration - Create an HTTP server agent
deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --agentName="CalculatorAgent" \
  --model="openai/gpt-4" \
  --deployment=http \
  --port=3000 \
  --hostname="localhost" \
  --outputFile="./agents/calculator_agent.ts" \
  --enableReflection=true \
  --enableMultiAgentComm=true \
  --npmPackages="mathjs,moment" \
  --advancedArgs='{"logLevel":"debug","memoryLimit":256,"timeout":30000}'        

Required Deno Permissions

Core Arguments: Agent Identity

--agentName=<string>     # Agent identifier (default: "HelloWorldAgent")
                                            # Used in file naming and agent identification
                                            # Example: --agentName="MathBot"

--model=<string>              # OpenRouter model (default: "openai/o3-mini-high")
                                            # Supported: gpt-4, claude-2, llama-2, etc.
                                            # Example: --model="openai/gpt-4"
        

Deployment Configuration

--deployment=<mode>     # Deployment mode (default: "local")
                                            # Options:
                                            #   local: Run as CLI tool
                                            #   http: Run as HTTP server
                                            # Example: --deployment=http

--outputFile=<path>         # Generated file path (default: "./generated_agent.ts")
                                            # Supports relative/absolute paths
                                            # Example: --outputFile="./agents/math_bot.ts"        

Feature Controls

Agent Capabilities

--enableReflection=<bool> # Enable self-optimization (default: true)
                                            # Adds post-response reflection step
                                            # Helps catch and correct errors
                                           # Example: --enableReflection=true

--enableMultiAgentComm=<bool> # Multi-agent support (default: false)
                                                # Implements robots.txt protocol
                                                # Enables agent discovery
                                                # Example: --enableMultiAgentComm=true        

External Dependencies

--npmPackages=<string>  # Comma-separated npm packages
                                            # Auto-imports via Deno's npm support
                                            # Example: --npmPackages="mathjs,moment,lodash"
        

Advanced Configuration

Performance Tuning

--advancedArgs=<json>     # Fine-tuning options as JSON
{
  "logLevel": "debug",     // Logging level (debug|info|warn|error)
  "memoryLimit": 256,      // Memory cap in MB
  "timeout": 30000,        // Request timeout (ms)
  "maxIterations": 10,     // Max reasoning steps
  "temperature": 0.7,      // Model temperature
  "streamResponse": true,  // Enable streaming
  "retryAttempts": 3,     // API retry count
  "cacheSize": 1000,      // Response cache size
  "contextWindow": 4096,   // Token context window
  "batchSize": 32         // Batch processing size
}
        

HTTP Server Options

When using --deployment=http, additional options are available:

Server Configuration

--port=<number>             # Server port (default: 8000)
                                           # Example: --port=3000

--hostname=<string>      # Server hostname (default: "0.0.0.0")
                                           # Example: --hostname="localhost"        

Security & Performance

--cors=<boolean>          # Enable CORS headers
                                         # Example: --cors=true

--rateLimit=<number>     # Max requests per IP/minute
                                           # Example: --rateLimit=60

--timeout=<number>       # Request timeout (ms)
                                           # Example: --timeout=30000
        

TLS/SSL Support

--cert=<path>           # TLS certificate file
                                   # Example: --cert=./cert.pem

--key=<path>            # TLS private key file
                                   # Example: --key=./key.pem
        

Environment Variables

The following environment variables can be used to override defaults:

OPENROUTER_API_KEY      # Required: OpenRouter API key
OPENROUTER_MODEL        # Optional: Default model
PORT                                    # Optional: Server port
HOST                                    # Optional: Server hostname
LOG_LEVEL                            # Optional: Logging verbosity
MEMORY_LIMIT                    # Optional: Memory cap (MB)        

Examples

  1. Basic Local Agent

deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --agentName="MathBot"        

  1. Advanced HTTP Server

deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --deployment=http \
  --port=3000 \
  --hostname="localhost" \
  --cors=true \
  --rateLimit=60 \
  --cert=./cert.pem \
  --key=./key.pem \
  --advancedArgs='{"logLevel":"debug","timeout":30000}'        

  1. Full-Featured Agent

deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --agentName="SuperBot" \
  --model="openai/gpt-4" \
  --deployment=http \
  --outputFile="./agents/super_bot.ts" \
  --enableReflection=true \
  --enableMultiAgentComm=true \
  --npmPackages="mathjs,moment,lodash" \
  --advancedArgs='{
    "logLevel": "debug",
    "memoryLimit": 512,
    "timeout": 30000,
    "maxIterations": 15,
    "temperature": 0.8,
    "streamResponse": true,
    "retryAttempts": 3,
    "cacheSize": 2000,
    "contextWindow": 8192,
    "batchSize": 64
  }'        

Tool Specifications

Calculator Tool

  • Supports basic arithmetic operations: +, -, *, /
  • Handles parentheses and floating-point numbers
  • Input validation prevents code injection
  • Example: Calculator|2 + 2 * (3 - 1)

DateTime Tool

  • Returns current system time in ISO format
  • No input required
  • Example: DateTime|

AlgebraSolver Tool

  • Solves linear equations in the form:x + a = bx - a = ba * x = bx / a = b
  • Returns solution in the form "x = value"
  • Example: AlgebraSolver|3*x = 15

CodeExecutor Tool

  • Executes JavaScript/TypeScript code in a sandboxed environment
  • Supports async/await
  • Captures stdout and stderr
  • Example: CodeExecutor|console.log("Hello, World!")

Security Considerations

  1. Sandboxed Execution:
  2. API Key Management:
  3. Input Validation:

Deployment

The meta-agent and generated agents support multiple deployment scenarios:

Meta-Agent Server Mode

Run the meta-agent as an HTTP server to create agents via REST API:

# Start meta-agent server with custom port (default: 8000)
deno run --allow-net --allow-env --allow-run --allow-write agent.ts \
  --server=true \
  --port=3000

# Create agent via POST request
curl -X POST https://localhost:3000 \
  -H "Content-Type: application/json" \
  -d '{
    "agentName": "TestAgent",
    "model": "openai/gpt-4",
    "deployment": "http",
    "enableReflection": true,
    "tools": [...],
    "systemPrompt": "...",
    "npmPackages": ["mathjs"],
    "advancedArgs": {
      "logLevel": "debug",
      "memoryLimit": 256
    }
  }'

# Response includes:
{
  "message": "Agent generated successfully",
  "outputPath": "./generated_agent.ts",
  "code": "... generated TypeScript code ..."
}        

Generated Agent Deployment

Generated agents can be deployed in various scenarios:

  • Local CLI Execution: Quickly test and iterate on your agent using Deno's CLI.
  • HTTP Server Deployment: Deploy as an HTTP server with customizable options:
  • Edge & Serverless: Leverage Deno's low cold start times and secure sandboxing to run the agent in global serverless environments (compatible with Deno Deploy, Supabase Edge, Fly.io, etc.).
  • Optional Multi-Agent Communication: Enable communication between agents by checking robots.txt of target agents.

Error Handling

The agent includes comprehensive error handling:

  • Tool execution errors are caught and returned as readable messages
  • API communication errors include detailed status codes
  • Invalid input formats trigger helpful validation messages
  • Network timeouts and retries are handled gracefully

Performance Optimization

  1. Cold Start Time:
  2. Memory Usage:
  3. Response Time:

Conclusion

The Meta Agent Generator empowers developers to create custom, flexible, and secure AI agents without extensive manual coding. By simply adjusting configuration options and using command-line arguments, you can generate an agent that meets your domain-specific requirements and deployment environment. Enjoy building and deploying your own autonomous agents with this next-generation tool – created by rUv.


For further questions or contributions, please contact rUv or visit the project repository.

Joel Pakalén

Shaping the future of hospitality | Educator at Haaga-Helia | Proud dad | Hospitality Disruptor (Ex-Expedia & Bob W)

1 周

Whoa, this is next-level! ?? Agents that create agents? We’re basically automating automation now. Love the idea of AI not just working but thinking, optimizing, and delegating. What’s next—agents that take coffee breaks? ??? Curious to see where this goes!?

回复
Cohen Reuven

发明家“IaaS”,天使投资人,成长黑客,导师

1 周

My latest: ? Introducing Declarative Self-improving TypeScript (DSPy.ts): Build & Run powerful AI applications/models right in your users web-browser (computer, mobile or things) for free. https://www.dhirubhai.net/posts/reuvencohen_introducing-declarative-self-improving-activity-7299159328412839937-f1fk?utm_source=share&utm_medium=member_ios&rcm=ACoAAAAsDPgBDJuUuadvvnSxPUkh_oT8zWlUvrk

回复
Luke Thompson

Ex-ActionVFX | Husband | Dad | Technologist

1 周

Take my stars! ?

回复
Peter Smyrniotis

Scaling Vision into Reality | Investor, Founder Coach & GTM Engineer | Helping Startups & Scale-Ups Master AI, Growth, M&A & Exits

1 周

I absolutely love how fast this is moving. Thanks for this Reuven Cohen ??

回复

要查看或添加评论,请登录

Cohen Reuven的更多文章