Step-by-step guide for deploying your agency in a production environment.
run_demo()
or demo_gradio
methods.Step 1: Dynamically Load Conversation Threads
Agency()
, it starts a fresh conversation thread. However, in production environments, you typically need to pick up old conversations or handle multiple users at once.Step 2: Dynamically Load Assistant Settings
settings_path
parameter (settings.json
by default). While this works well for development, in production environments, we recommend storing these settings in a database to persist changes between deployments.save
callback.settings_callbacks
are executed every time agent settings are loaded or saved. Just like threads_callbacks
, you can use it to load or save agent configurations based on your identifier (e.g. user_id):Step 3: Deploying Agents and Tools on a Production Server
Comparison Table
Feature | Agents with Tools | Tools as Separate API Endpoints |
---|---|---|
Setup Complexity | ”One-click” deployment | Additional setup required |
Scalability | Combined agency scaling | Independent tool/agent scaling |
Tool Reusability | Limited to current agency | Cross-project utilization |
Cost Efficiency | Predictable resource allocation | Optimized resource scaling |
Security | Internal tool access only | API authentication required |
Best For | Small to medium projects | Large-scale or multi-project environments |