In this guide you will deploy a Market News Agent that:
- Fetches real-time market news for any topic
- Generates AI-powered trading insights using Google Gemini
- Runs continuously, updating every hour
- Gets its own unique URL for sharing
Prerequisites
- GitHub account
- Google AI API key (get one here)
- 5 minutes
Step 1: Fork the Example Repository
- Go to example-market-news-agent
- Click "Fork" in the top-right corner
- Choose your GitHub account as the destination
Step 2: Deploy to AgentHub
- Visit AgentHub
- Click "Sign in with GitHub"
- Authorize AgentHub (first time only)
- Click "Deploy Your Agent"
- Select your forked
example-market-news-agent
repository (if no repositories show, make sure to install the AgentHub GitHub app) - Choose the
main
branch
Done! AgentHub is now analyzing the code and generating a container.
Step 3: Configure Your Agent
You'll see the configuration page with auto-detected settings:
Required Environment Variables
You should see these two variables:
-
TARGET_QUERY
- What market topic to track
- Example:
"renewable energy stocks"
- Example:
"artificial intelligence companies"
-
GEMINI_API_KEY
- Your Google AI API key
- Get one free at Google AI Studio
If these variables are set now, they will be used for all instances of this agent. You can also set them when starting an instance. You can leave them empty for now.
Important Settings
Check this box:
- Long running - Keeps your agent running continuously
Click "Publish" to create your agent blueprint.
Step 4: Start Your Instance
- Wait for build - The "Builds" tab shows progress (1-2 minutes)
- Build complete - You'll see "Build Ready" status
- Click "Start an Instance"
- Fill environment variables:
TARGET_QUERY: electric vehicle stocks GEMINI_API_KEY: AIzaSyBOUrActualAPIKeyHere123456
- Click "Start Instance"
Done! Your agent is starting up.
Step 5: Watch It Work
Instance Page Features:
- Real-time logs - Watch your agent fetch news and generate insights
- Unique URL - Share your running agent with others
- Performance metrics - CPU, memory, and response time tracking
Expected Log Output:
[INFO] Agent started successfully
[INFO] Fetching news for: electric vehicle stocks
[INFO] Found 15 relevant articles
[INFO] Generated 3 trading insights:
[INFO] 1. Tesla earnings beat expectations, potential 5% upside
[INFO] 2. EV charging infrastructure expanding, benefiting ChargePoint
[INFO] 3. Battery technology breakthrough from QuantumScape
[INFO] Next update in 60 minutes
What you now have:
- Running AI agent with unique URL
- Real-time market analysis
- Shareable link for social media
- Professional agent landing page
- Usage analytics and monitoring
Sharing Your Agent
Agent blueprints are public but not indexed, so you can share the link directly. Users can start their own instances with their API keys.
What Happens Next?
Your Agent Will:
- Fetch market news every hour
- Generate fresh AI insights
- Log all activity for monitoring
- Run continuously until you stop it
You Can:
- Monitor performance via the dashboard
- Share your agent with others
- Deploy updates by creating new builds
Others Can:
- Visit your agent's landing page
- Start their own instance with their API keys
- Customize the target query for their interests
Next Steps (Optional)
Build Your Own Agent
Simple Web Agent Template:
# app.py - Basic web agent template
from flask import Flask, request, jsonify
import os
app = Flask(__name__)
@app.route('/health')
def health():
return {'status': 'healthy'}
@app.route('/chat', methods=['POST'])
def chat():
user_message = request.json.get('message')
# Your AI logic here
response = f"AI response to: {user_message}"
return jsonify({'response': response})
if __name__ == '__main__':
port = int(os.environ.get('PORT', 8080))
app.run(host='0.0.0.0', port=port)
Publish your code to GitHub, then follow the same steps to deploy it on AgentHub.
Explore Advanced Features
API Integration:
- Use the AgentHub API to manage agents programmatically
- Set up automated deployments from CI/CD pipelines
- Build custom dashboards with webhook integration
Team Collaboration:
- Invite team members to your organization
- Share costs and analytics across the team
LLM Router:
- Automatically route requests to the best LLM provider (OpenAI, Anthropic, Google, etc.)
- Optimize costs and performance with smart routing
- A/B test different LLMs for your agents
🚀 Ready to deploy? Start your 5-minute quickstart →