RunAgent: Build AI Agents in Python, Invoke Them Natively from Any Language

7月25日 Published inAI Agent Tools

RunAgent eliminates the language barrier in AI agent development.

The current workflow for many teams is inefficient. An AI team might develop a sophisticated agent in Python using LangChain, CrewAI, or a custom combination of prompt loops and vector stores. However, the backend team—often working in Rust or Go—is then presented with a massive REST API specification. They are forced to spend days managing JSON schemas, handling WebSocket handshakes, and deciphering opaque error codes.

RunAgent offers a better alternative.

You write your agent once in Python and expose it via a simple configuration file. From that point on, you can call it from Rust, Go, JavaScript, or TypeScript as if it were a native library. Type safety is integrated by design, and streaming responses function identically across every supported language. Your team can stop manually managing /v1/agent/invoke endpoints forever.

How It Works

The system is managed through a runagent.config.json file. You define your entrypoints—the specific Python functions you wish to expose—and assign each a tag. The RunAgent CLI then initializes a local FastAPI server. Once active, any of the language-specific SDKs can connect to and invoke those functions directly.

The platform supports both synchronous calls and native streaming. The SDKs handle the heavy lifting, including authentication, automatic retries, and connection management, allowing you to focus on core logic.

Because the stack is framework-agnostic, if a tool runs in Python, RunAgent can serve it. Whether you use LangChain, LangGraph, CrewAI, Letta, or Agno, the integration remains consistent.

Why Use It?

RunAgent eliminates the need for excessive "glue code." Python specialists no longer have to write Node.js wrappers, and Rust engineers aren't required to decode Python pickles over HTTP. Instead, RunAgent provides a clean, reliable contract between the AI layer and the rest of the software stack.

It also streamlines the deployment process. While the local server facilitates development, a single runagent deploy command (with cloud deployment currently on the roadmap) will push the project to a production environment featuring auto-scaling and edge distribution.

Target Use Cases

  • Multi-language teams: Frontend developers working in TypeScript and backend engineers using Go can call the same Python agent directly.
  • Microservices: Centralize AI logic and distribute access across your service mesh without the overhead of building a new API gateway.
  • Legacy systems: Integrate modern AI capabilities into existing applications without needing to rewrite the entire codebase in Python.
  • Performance-critical paths: Handle complex reasoning in Python while invoking those processes from Rust to maintain high-speed performance where it matters most.

Getting Started

Install the CLI via pip:

pip install runagent

Initialize your project. You can choose a specific framework template or start with a minimal setup:

runagent init my_agent --langgraph   # LangGraph template
runagent init my_agent --crewai      # CrewAI template
runagent init my_agent               # Basic starter

The generated project includes a runagent.config.json file. Use it to define your function entrypoints. For example:

{
  "agent_name": "my-agent",
  "agent_architecture": {
    "entrypoints": [
      {
        "file": "main.py",
        "module": "mock_response",
        "tag": "minimal"
      },
      {
        "file": "main.py",
        "module": "mock_response_stream",
        "tag": "minimal_stream"
      }
    ]
  }
}

Each entrypoint links to a specific Python function, and the tag serves as the reference for your clients.

To launch the local server, run:

runagent serve .

The CLI will provide an agent_id and a host:port combination to be used with the RunAgent SDKs.

Invoking Your Agent

Python

from runagent import RunAgentClient

ra = RunAgentClient(
    agent_id="<agent_id>",
    entrypoint_tag="minimal",
    local=True
)

result = ra.run(
    role="user",
    message="Analyze the benefits of remote work for software teams"
)
print(result)

For streaming, simply use standard Python iteration:

for chunk in ra.run(role="user", message="Explain quantum computing step by step"):
    print(chunk, end='')

Rust

use runagent::client::RunAgentClient;
use serde_json::json;

let client = RunAgentClient::new("<agent_id>", "minimal", true).await?;
let result = client.run(&[
    ("message", json!("Plan a trip to Japan")),
    ("role", json!("user"))
]).await?;

JavaScript/TypeScript

import { RunAgentClient } from 'runagent';

const ra = new RunAgentClient({
  agentId: "<agent_id>",
  entrypointTag: "minimal",
  local: true
});

await ra.initialize();
const result = await ra.run({
  role: 'user',
  message: 'Analyze remote work benefits',
});

Go

client := runagent.NewRunAgentClient(runagent.Config{
    AgentID:       "<agent_id>",
    EntrypointTag: "minimal",
    Local:         true,
})

ctx := context.Background()
client.Initialize(ctx)
result, _ := client.Run(ctx, map[string]interface{}{
    "role":    "user",
    "message": "Analyze remote work benefits",
})

Consistent Streaming Across Languages

Streaming is a core feature of RunAgent. The SDKs translate Python generator patterns into the idiomatic structures expected by each host language:

  • Python: for chunk in client.run(...):
  • JavaScript: for await (const chunk of client.run(...))
  • Rust: while let Some(chunk) = stream.next().await
  • Go: for chunk, hasMore, _ := stream.Next(ctx); hasMore;

This removes the need for WebSocket boilerplate or custom event parsing.

Future Development

The development team has announced a forthcoming serverless cloud deployment option (runagent deploy). This feature aims to provide auto-scaling, global edge distribution, and integrated monitoring. Currently, the local server provides a robust environment for development and various production scenarios.

RunAgent addresses a common technical friction point: integrating Python-based AI into a broader software ecosystem. It achieves this without adding significant cognitive load. Define your functions, tag them, and invoke them natively.

For multi-language teams building with AI, RunAgent is a necessary addition to the development toolkit.