Skip to main content
Prerequisites: Go 1.19+ and completed Deploy Your First Agent tutorial

Overview

The Go SDK provides idiomatic access to RunAgent agents with context-aware operations, channel-based streaming, and concurrent processing. It’s designed to work seamlessly with Go’s concurrency model and error handling patterns.

Installation

Basic Usage

Synchronous Calls

Asynchronous Calls

Advanced Features

1. Streaming Responses

2. Error Handling

3. Custom Headers and Metadata

Configuration

Environment Variables

Configuration File

Create ~/.runagent/config.json:

Programmatic Configuration

Best Practices

1. Connection Management

2. Retry Logic

3. Logging and Monitoring

Common Patterns

1. Agent Factory Pattern

2. Agent Wrapper Pattern

3. Agent Pool Pattern

Error Handling

Common Error Types

Performance Optimization

1. Connection Pooling

2. Caching

Testing

Unit Testing

Integration Testing

Next Steps

Concurrency Patterns

Learn advanced concurrency patterns for Go

Production Deployment

Deploy your Go applications to production

Multi-Language Integration

Integrate with other programming languages

Performance Tuning

Optimize your Go applications for production
🎉 Great work! You’ve learned how to use RunAgent agents from Go applications. The Go SDK provides idiomatic access with context-aware operations and channel-based streaming!