Prerequisites: Python 3.8+ and pip installed on your system

The Magic You’re About to Experience

In the next 5 minutes, you’ll:

  1. Deploy a Python agent that responds intelligently to questions
  2. Call it from multiple languages like it’s a native function
  3. Stream responses in real-time across language boundaries
  4. Understand why this changes everything for AI development

Ready? Let’s make some magic happen ✨

Installation: Your Gateway to Multi-Language AI

Install RunAgent CLI (includes Python SDK):

pip install runagent

Verify the installation:

runagent --version

What just happened? You now have both a powerful CLI for deploying agents AND a Python SDK for accessing them. Two tools, one install!

Create Your First Agent: From Zero to Intelligence

Let’s create a simple but intelligent agent that demonstrates RunAgent’s core superpower:

1

Initialize the Magic

runagent init my_agent
cd my_agent

What RunAgent just created for you:

my_agent/
├── main.py                # Your agent's brain (two smart functions)
├── email_agent.py         # Mock AI client (no API keys needed!)  
├── runagent.config.json   # The bridge to other languages
└── __init__.py            # Python package magic

Pro insight: This isn’t just boilerplate. Each file serves a specific purpose in making your Python agent accessible from any programming language.

2

Peek Under the Hood: See Your Agent's Brain

Your agent has two functions that will become universally accessible APIs:

def mock_response(message, role="user"):
    """Your agent's instant-response mode"""
    client = MockOpenAIClient()

    prompt = [{"role": role, "content": message}]
    response = client.create(model="gpt-4", messages=prompt)

    print(f"Tokens used: {response.usage_tokens}")
    print(f"Response time: {response.response_time:.2f}s")

    return response.content  # Complete response, all at once

The “Aha!” Moment: These Python functions accept message and role parameters. That’s exactly what you’ll pass from JavaScript, Rust, or any other language—RunAgent handles the translation!

3

The Configuration Bridge

Open runagent.config.json to see how Python functions become universal APIs:

{
  "agent_name": "my-agent",
  "description": "A simple placeholder agent",
  "framework": "default",
  "agent_architecture": {
    "entrypoints": [
      {
        "file": "main.py",
        "module": "mock_response", 
        "tag": "minimal"
      },
      {
        "file": "main.py",
        "module": "mock_response_stream",
        "tag": "minimal_stream"
      }
    ]
  }
}

What this means:

  • Your mock_response function becomes accessible via the minimal tag
  • Your streaming function gets the minimal_stream tag (note the _stream suffix!)
  • Any language can now call these functions by their tags
4

Activate Your Agent

Launch your agent into the RunAgent universe:

runagent serve .

You’ll see magic happen:

🚀 Agent Starting...
📦 Agent ID: agent_abc123
🌐 Server running at: http://localhost:8000
✅ Agent ready for multi-language access!

Critical insight: That agent_id is your agent’s universal address. Any programming language can now connect to your Python intelligence using this ID!

The Multi-Language Magic: Same Agent, Every Language

Now comes the mind-blowing part. Your Python agent is now accessible from any supported language as if it were written natively in that language.

Standard Responses: Get Complete Intelligence

The fastest way to prove the magic works:

runagent run --id agent_abc123 --local --tag minimal \
  --message "Explain why the sky is blue" \
  --role user

Live output:

🚀 RunAgent Configuration:
   Agent ID: agent_abc123
   Tag: minimal
   Local: Yes
🔍 Auto-resolved address: 127.0.0.1:8000
🤖 Executing agent: agent_abc123
✅ Agent execution completed!

The sky appears blue due to a phenomenon called Rayleigh scattering...

What just happened? You called your Python function from the command line with zero setup!

Streaming Intelligence: Real-Time AI Responses

Watch your Python agent stream responses in real-time to any language:

Experience real-time AI streaming in your terminal:

runagent run --id agent_abc123 --local --tag minimal_stream \
  --message "Write a creative story about AI agents"

Live streaming output:

🚀 RunAgent Configuration:
   Agent ID: agent_abc123
   Tag: minimal_stream
   Local: Yes
🔍 Auto-resolved address: 127.0.0.1:8000

Once
 upon
 a
 time,
 in
 a
 digital
 realm
 far
 beyond
 the
 clouds...
[STREAM COMPLETE]

What’s happening: Your Python generator function is streaming across the network in real-time!

Level Up: Real AI Frameworks

Ready to move beyond mock responses? RunAgent works with any Python AI framework:

runagent init my_langgraph_agent --langgraph
cd my_langgraph_agent

# Add your AI power
echo "OPENAI_API_KEY=your-key-here" > .env

# Install and activate
pip install -r requirements.txt
runagent serve .

What you get: Multi-step reasoning agents with state management, accessible from any language!

Understanding the Universal Entrypoint System

This is the core concept that makes RunAgent revolutionary:

How Function Signatures Become Universal APIs

The Revolutionary Insight: Your Python function signature automatically defines the API contract for all programming languages. Change the Python function, and all language SDKs automatically adapt!

Streaming: The Real-Time Superpower

When you use Iterator[str] in Python, RunAgent automatically:

  • 🔄 Establishes WebSocket connections for real-time data flow
  • 📡 Streams chunks immediately as your function yields them
  • 🌐 Provides native iteration patterns in each target language
  • Handles connection lifecycle and error recovery
# Your Python generator
def generate_report(topic: str) -> Iterator[str]:
    yield "# Report: " + topic + "\n\n"
    yield "## Introduction\n"
    # ... more yields
    
# Becomes JavaScript async iterator
for await (const chunk of stream) {
    document.body.innerHTML += chunk;
}

# Becomes Rust futures stream  
while let Some(chunk) = stream.next().await {
    println!("{}", chunk?);
}

What Just Happened? The Full Picture

In these 5 minutes, you’ve experienced something revolutionary:

🧠 Universal AI Access

Your Python AI agent is now callable from any programming language with native-feeling APIs

⚡ Real-Time Streaming

Streaming responses work seamlessly across language boundaries with zero setup

🔧 Zero Infrastructure

No REST APIs to build, no WebSocket handling, no deployment complexity

🚀 Production Ready

The same code and SDKs will work in production with automatic scaling

The Path Forward: Your RunAgent Journey

Common Questions from New Users

🎉 Congratulations! You’ve just experienced the future of AI development. Your Python agents can now be accessed from any programming language with the same ease as calling local functions. This is just the beginning—imagine what you’ll build next!

Ready to go deeper? Join our Discord community to see what other developers are creating with RunAgent!