Overview
RunAgent supports any Python-based AI agent framework or custom implementation. This guide shows how to adapt your existing code or build custom agents for deployment.Quick Start
Basic Structure
Any Python code can be deployed as long as it provides the required entrypoints:Integration Examples
Hugging Face Transformers
Custom LangChain Implementation
FastAPI Integration
Best Practices
-
Keep Entrypoints Simple
- Entrypoints should be thin wrappers
- Put complex logic in separate modules
- Handle errors gracefully
-
State Management
- Avoid global state when possible
- Use class instances for stateful agents
- Consider thread safety
-
Dependencies
- List all requirements in requirements.txt
- Pin versions for reproducibility
- Test with exact versions
Advanced Patterns
Multi-Model Agent
Async Custom Agent
Plugin System
Testing Your Custom Agent
Migration Guide
From Existing API
From CLI Tool
See Also
- First Agent Guide - Build from scratch
- Framework Overview - Compare frameworks
- Configuration - Configuration details