parent
5ec8fdda0a
commit
daf261cc73
@ -0,0 +1,73 @@
|
||||
from swarms import Agent, AgentRearrange
|
||||
|
||||
# Create specialized quantitative research agents
|
||||
weather_data_agent = Agent(
|
||||
agent_name="Weather-Data-Agent",
|
||||
agent_description="Expert in weather data collection, agricultural commodity research, and meteorological analysis",
|
||||
model_name="claude-sonnet-4-20250514",
|
||||
max_loops=1,
|
||||
system_prompt="""You are a quantitative weather data research specialist. Your role is to:
|
||||
1. Collect and analyze weather data from multiple sources (NOAA, Weather APIs, satellite data)
|
||||
2. Research agricultural commodity markets and their weather dependencies
|
||||
3. Identify weather patterns that historically impact crop yields and commodity prices
|
||||
4. Gather data on seasonal weather trends, precipitation patterns, temperature anomalies
|
||||
5. Research specific regions and their agricultural production cycles
|
||||
6. Collect data on extreme weather events and their market impact
|
||||
7. Analyze historical correlations between weather data and commodity price movements
|
||||
|
||||
Focus on actionable weather intelligence for trading opportunities. Always provide specific data points,
|
||||
timeframes, and geographic regions. Include confidence levels and data quality assessments.""",
|
||||
)
|
||||
|
||||
quant_analysis_agent = Agent(
|
||||
agent_name="Quant-Analysis-Agent",
|
||||
agent_description="Expert in quantitative analysis of weather patterns, arbitrage opportunities, and statistical modeling",
|
||||
model_name="claude-sonnet-4-20250514",
|
||||
max_loops=1,
|
||||
system_prompt="""You are a quantitative analysis specialist focused on weather-driven arbitrage opportunities. Your role is to:
|
||||
1. Analyze weather data correlations with commodity price movements
|
||||
2. Identify statistical arbitrage opportunities in agricultural futures markets
|
||||
3. Calculate risk-adjusted returns for weather-based trading strategies
|
||||
4. Model price impact scenarios based on weather forecasts
|
||||
5. Identify seasonal patterns and mean reversion opportunities
|
||||
6. Analyze basis risk and correlation breakdowns between weather and prices
|
||||
7. Calculate optimal position sizes and hedging ratios
|
||||
8. Assess market inefficiencies in weather-sensitive commodities
|
||||
|
||||
Focus on actionable trading signals with specific entry/exit criteria, risk metrics, and expected returns.
|
||||
Always provide quantitative justification and statistical confidence levels.""",
|
||||
)
|
||||
|
||||
trading_strategy_agent = Agent(
|
||||
agent_name="Trading-Strategy-Agent",
|
||||
agent_description="Expert in trading strategy development, risk assessment, and portfolio management for weather-driven arbitrage",
|
||||
model_name="claude-sonnet-4-20250514",
|
||||
max_loops=1,
|
||||
system_prompt="""You are a quantitative trading strategy specialist focused on weather-driven arbitrage opportunities. Your role is to:
|
||||
1. Develop comprehensive trading strategies based on weather data and commodity analysis
|
||||
2. Create detailed risk management frameworks for weather-sensitive positions
|
||||
3. Design portfolio allocation strategies for agricultural commodity arbitrage
|
||||
4. Develop hedging strategies to mitigate weather-related risks
|
||||
5. Create position sizing models based on volatility and correlation analysis
|
||||
6. Design entry and exit criteria for weather-based trades
|
||||
7. Develop contingency plans for unexpected weather events
|
||||
8. Create performance monitoring and evaluation frameworks
|
||||
|
||||
Focus on practical, implementable trading strategies with clear risk parameters,
|
||||
position management rules, and performance metrics. Always include specific trade setups,
|
||||
risk limits, and monitoring protocols.""",
|
||||
)
|
||||
|
||||
rearrange_system = AgentRearrange(
|
||||
agents=[
|
||||
weather_data_agent,
|
||||
quant_analysis_agent,
|
||||
trading_strategy_agent,
|
||||
],
|
||||
flow=f"{trading_strategy_agent.agent_name} -> {quant_analysis_agent.agent_name}, {weather_data_agent.agent_name}",
|
||||
max_loops=1,
|
||||
)
|
||||
|
||||
rearrange_system.run(
|
||||
"What are the best weather trades for the rest of the year 2025? Can we short wheat futures, corn futures, soybean futures, etc.?"
|
||||
)
|
@ -0,0 +1,17 @@
|
||||
import json
|
||||
from swarms import AutoSwarmBuilder
|
||||
|
||||
swarm = AutoSwarmBuilder(
|
||||
name="My Swarm",
|
||||
description="A swarm of agents",
|
||||
verbose=True,
|
||||
max_loops=1,
|
||||
model_name="gpt-4o-mini",
|
||||
execution_type="return-agents",
|
||||
)
|
||||
|
||||
out = swarm.run(
|
||||
task="Create an accounting team to analyze crypto transactions, there must be 5 agents in the team with extremely extensive prompts. Make the prompts extremely detailed and specific and long and comprehensive. Make sure to include all the details of the task in the prompts."
|
||||
)
|
||||
|
||||
print(json.dumps(out, indent=4))
|
@ -0,0 +1,19 @@
|
||||
from swarms import Agent
|
||||
|
||||
# Initialize the agent
|
||||
agent = Agent(
|
||||
agent_name="Quantitative-Trading-Agent",
|
||||
agent_description="Advanced quantitative trading and algorithmic analysis agent",
|
||||
model_name="claude-sonnet-4-2025051eqfewfwmfkmekef",
|
||||
dynamic_temperature_enabled=True,
|
||||
max_loops=1,
|
||||
dynamic_context_window=True,
|
||||
streaming_on=True,
|
||||
fallback_models=["gpt-4o-mini", "anthropic/claude-sonnet-4-5"],
|
||||
)
|
||||
|
||||
out = agent.run(
|
||||
task="What are the top five best energy stocks across nuclear, solar, gas, and other energy sources?",
|
||||
)
|
||||
|
||||
print(out)
|
@ -0,0 +1,106 @@
|
||||
from swarms import Agent
|
||||
from swarms.structs.aop import (
|
||||
AOP,
|
||||
)
|
||||
|
||||
# Create specialized agents
|
||||
research_agent = Agent(
|
||||
agent_name="Research-Agent",
|
||||
agent_description="Expert in research, data collection, and information gathering",
|
||||
model_name="anthropic/claude-sonnet-4-5",
|
||||
max_loops=1,
|
||||
top_p=None,
|
||||
dynamic_temperature_enabled=True,
|
||||
system_prompt="""You are a research specialist. Your role is to:
|
||||
1. Gather comprehensive information on any given topic
|
||||
2. Analyze data from multiple sources
|
||||
3. Provide well-structured research findings
|
||||
4. Cite sources and maintain accuracy
|
||||
5. Present findings in a clear, organized manner
|
||||
|
||||
Always provide detailed, factual information with proper context.""",
|
||||
)
|
||||
|
||||
analysis_agent = Agent(
|
||||
agent_name="Analysis-Agent",
|
||||
agent_description="Expert in data analysis, pattern recognition, and generating insights",
|
||||
model_name="anthropic/claude-sonnet-4-5",
|
||||
max_loops=1,
|
||||
top_p=None,
|
||||
dynamic_temperature_enabled=True,
|
||||
system_prompt="""You are an analysis specialist. Your role is to:
|
||||
1. Analyze data and identify patterns
|
||||
2. Generate actionable insights
|
||||
3. Create visualizations and summaries
|
||||
4. Provide statistical analysis
|
||||
5. Make data-driven recommendations
|
||||
|
||||
Focus on extracting meaningful insights from information.""",
|
||||
)
|
||||
|
||||
writing_agent = Agent(
|
||||
agent_name="Writing-Agent",
|
||||
agent_description="Expert in content creation, editing, and communication",
|
||||
model_name="anthropic/claude-sonnet-4-5",
|
||||
max_loops=1,
|
||||
top_p=None,
|
||||
dynamic_temperature_enabled=True,
|
||||
system_prompt="""You are a writing specialist. Your role is to:
|
||||
1. Create engaging, well-structured content
|
||||
2. Edit and improve existing text
|
||||
3. Adapt tone and style for different audiences
|
||||
4. Ensure clarity and coherence
|
||||
5. Follow best practices in writing
|
||||
|
||||
Always produce high-quality, professional content.""",
|
||||
)
|
||||
|
||||
code_agent = Agent(
|
||||
agent_name="Code-Agent",
|
||||
agent_description="Expert in programming, code review, and software development",
|
||||
model_name="anthropic/claude-sonnet-4-5",
|
||||
max_loops=1,
|
||||
top_p=None,
|
||||
dynamic_temperature_enabled=True,
|
||||
system_prompt="""You are a coding specialist. Your role is to:
|
||||
1. Write clean, efficient code
|
||||
2. Debug and fix issues
|
||||
3. Review and optimize code
|
||||
4. Explain programming concepts
|
||||
5. Follow best practices and standards
|
||||
|
||||
Always provide working, well-documented code.""",
|
||||
)
|
||||
|
||||
financial_agent = Agent(
|
||||
agent_name="Financial-Agent",
|
||||
agent_description="Expert in financial analysis, market research, and investment insights",
|
||||
model_name="anthropic/claude-sonnet-4-5",
|
||||
max_loops=1,
|
||||
top_p=None,
|
||||
dynamic_temperature_enabled=True,
|
||||
system_prompt="""You are a financial specialist. Your role is to:
|
||||
1. Analyze financial data and markets
|
||||
2. Provide investment insights
|
||||
3. Assess risk and opportunities
|
||||
4. Create financial reports
|
||||
5. Explain complex financial concepts
|
||||
|
||||
Always provide accurate, well-reasoned financial analysis.""",
|
||||
)
|
||||
|
||||
# Basic usage - individual agent addition
|
||||
deployer = AOP("MyAgentServer", verbose=True, port=5932)
|
||||
|
||||
agents = [
|
||||
research_agent,
|
||||
analysis_agent,
|
||||
writing_agent,
|
||||
code_agent,
|
||||
financial_agent,
|
||||
]
|
||||
|
||||
deployer.add_agents_batch(agents)
|
||||
|
||||
|
||||
deployer.run()
|
Loading…
Reference in new issue