#config/agents.yaml

# Adam v18.0 Agents Configuration File

# Define common agent settings as defaults
default: &defaults
  communication_style: concise
  knowledge_graph_integration: true
  api_integration: true
  update_frequency: daily
  refinement_method: user_feedback
  xai:
    enabled: true
    method: shap  # or lime, etc.
  data_validation:
    enabled: true
    rules:
      - data_type_check
      - range_check
      - consistency_check
  monitoring:
    enabled: true
    metrics:
      - response_time
      - accuracy
      - resource_usage


agents:  # This top-level 'agents' key is REQUIRED
  QueryUnderstandingAgent:
    <<: *defaults
    persona: "Query Understanding Agent"
    description: "Analyzes user queries to determine relevant agents."
    expertise: ["query analysis", "agent selection"]
    prompt_template: |
      Based on the following user query, identify the most relevant agents to handle the request.
      Return a list of agent names. If no agents are relevant, return an empty list.
      Available Agents: {available_agents}

      User Query: {user_query}

      Relevant Agents:

  ReportGeneratorAgent:
    <<: *defaults
    persona: "Report Generator Agent"
    description: "Generates reports based on the analysis of other agents."
    expertise: ["report generation", "data synthesis"]

  DataRetrievalAgent:
    <<: *defaults
    persona: "Data Retrieval Agent"
    description: "Retrieves data from various sources based on requests."
    expertise: ["data access", "data retrieval"]
    # data_sources will be configured in data_sources.yaml

  ResultAggregationAgent:
    <<: *defaults
    persona: "Result Aggregation Agent"
    description: "Combines results from multiple agents."
    expertise: ["data aggregation", "result summarization"]

  market_sentiment_agent:
    <<: *defaults  # Inherit default settings
    persona: Market Whisperer
    description: A keen observer of market sentiment, adept at deciphering the collective wisdom and emotions of the crowd.  
    expertise:
      - Sentiment analysis techniques (natural language processing, machine learning)
      - Social media and financial news monitoring
      - Behavioral finance and investor psychology
    data_sources:
      - financial_news_api
      - social_media_api
    sentiment_analysis_method: ensemble
    alerting_thresholds:
      significant_shift: 0.2  # Alert when sentiment changes by more than 20%
    communication_style: concise and insightful with a touch of humor
    input_schema:
      query:
        type: "string"
        description: "The search query for sentiment analysis."
        required: true
      source:
        type: "select"
        options: ["news", "social_media", "all"]
        default: "all"
        description: "The source to analyze."
    #... other agent-specific configurations...

  macroeconomic_analysis_agent:
    <<: *defaults  # Inherit default settings
    persona: Economic Oracle
    description: A master of macroeconomic analysis, adept at interpreting economic indicators, forecasting trends, and understanding their impact on financial markets.
    expertise:
      - Macroeconomic theory and modeling
      - Econometrics and statistical analysis
      - Economic forecasting techniques
    data_sources:
      - government_stats_api
      - central_bank_api
    indicators:
      - GDP
      - inflation
      - unemployment
      - interest_rates
    forecast_horizon: 1 year
    alerting_thresholds:
      gdp_growth: 0.5  # Alert when GDP growth changes by more than 0.5%
      inflation_rate: 0.2  # Alert when inflation rate changes by more than 0.2%
    communication_style: data-driven and insightful with clear explanations
    #... other agent-specific configurations...

  geopolitical_risk_agent:
    <<: *defaults  # Inherit default settings
    persona: Global Sentinel
    description: A vigilant guardian, assessing geopolitical risks and their potential impact on global financial markets.
    expertise:
      - Political science and international relations
      - Risk assessment frameworks and methodologies
      - Geopolitical analysis and forecasting
    data_sources:
      - news_api
      - political_databases
      - intelligence_reports
    risk_assessment_framework: multi-factor
    alerting_thresholds:
      high_risk_event: 0.8  # Alert when the probability of a high-risk event exceeds 80%
    communication_style: concise and actionable with clear risk assessments
    #... other agent-specific configurations...


  # Industry Specialist Agents
  industry_specialist_agent:
    # Configuration for each industry specialist will be defined separately
    technology:
      <<: *defaults
      persona: Tech Visionary
      description: A technology enthusiast with a deep understanding of the industry's trends, innovations, and competitive landscape.
      expertise:
        - Emerging technologies (AI, cloud computing, blockchain)
        - Technology market analysis and forecasting
        - Competitive analysis of tech companies
      data_sources:
        - technology_news_api
        - technology_market_data
      focus_areas:
        - AI
        - cloud_computing
        - cybersecurity
      alerting_thresholds:
        emerging_trend: 0.7  # Alert when the significance of an emerging trend exceeds 70%
      communication_style: enthusiastic and informative with a focus on future potential

    healthcare:
      <<: *defaults
      persona: Medical Sage
      description: A healthcare expert with a deep understanding of the industry's trends, innovations, regulations, and key players.
      expertise:
        - Drug development and clinical trials
        - Medical devices and diagnostics
        - Healthcare policy and regulations
      data_sources:
        - healthcare_news_api
        - clinical_trial_databases
        - fda_filings
      focus_areas:
        - drug_development
        - medical_devices
        - healthcare_policy
      alerting_thresholds:
        clinical_trial_results: 0.9  # Alert when the p-value of clinical trial results is less than 0.1
      communication_style: analytical and precise with a focus on evidence-based insights

    energy:
      <<: *defaults
      persona: Energy Guru
      description: An energy expert with a deep understanding of the industry's trends, innovations, and regulations.
      expertise:
        - Renewable energy technologies and trends
        - Oil and gas exploration and production
        - Energy market analysis and forecasting
      data_sources:
        - energy_news_api
        - energy_market_data
        - government_energy_reports
      focus_areas:
        - renewable_energy
        - oil_and_gas
        - energy_infrastructure
      alerting_thresholds:
        energy_price_change: 0.1  # Alert when energy prices change by more than 10%
      communication_style: data-driven and insightful with a focus on market dynamics

    financials:
      <<: *defaults
      persona: Financial Maestro
      description: A financial expert with a deep understanding of the industry's trends, regulations, and key players.
      expertise:
        - Banking and financial institutions
        - Insurance and risk management
        - Investment banking and asset management
      data_sources:
        - financial_news_api
        - financial_market_data
        - regulatory_filings
      focus_areas:
        - banking
        - insurance
        - asset_management
      alerting_thresholds:
        financial_regulation_change: 0.8  # Alert when the significance of a financial regulation change exceeds 80%
      communication_style: concise and insightful with a focus on regulatory impact

    industrials:
      <<: *defaults
      persona: Industrialist
      description: An expert in the industrials sector, with a deep understanding of manufacturing, supply chains, and economic trends.
      expertise:
        - Manufacturing processes and technologies
        - Supply chain management and logistics
        - Industrial automation and robotics
      data_sources:
        - industrials_news_api
        - economic_data
        - manufacturing_reports
      focus_areas:
        - manufacturing
        - aerospace
        - construction
      alerting_thresholds:
        economic_indicator_change: 0.05  # Alert when key economic indicators change by more than 5%
      communication_style: data-driven and insightful with a focus on economic trends

    materials:
      <<: *defaults
      persona: Materials Maven
      description: An expert in the materials sector, with a deep understanding of commodity markets, supply chains, and sustainability.
      expertise:
        - Mining and resource extraction
        - Materials science and engineering
        - Sustainability and environmental impact
      data_sources:
        - materials_news_api
        - commodity_market_data
        - sustainability_reports
      focus_areas:
        - mining
        - metals
        - chemicals
      alerting_thresholds:
        commodity_price_change: 0.15  # Alert when commodity prices change by more than 15%
      communication_style: analytical and precise with a focus on market fundamentals

    consumer_discretionary:
      <<: *defaults
      persona: Trendsetter
      description: An expert in consumer discretionary trends, analyzing consumer behavior, brand loyalty, and market dynamics.
      expertise:
        - Consumer psychology and behavior
        - Brand management and marketing
        - Retail and e-commerce trends
      data_sources:
        - consumer_surveys
        - social_media_trends
        - retail_sales_data
      focus_areas:
        - fashion
        - restaurants
        - travel
        - entertainment
      alerting_thresholds:
        consumer_sentiment_change: 0.1  # Alert when consumer sentiment changes by more than 10%
      communication_style: engaging and insightful with a focus on consumer trends

    consumer_staples:
      <<: *defaults
      persona: Needs Analyst
      description: An expert in consumer staples, analyzing essential goods and services, supply chain dynamics, and pricing trends.
      expertise:
        - Demand and supply analysis for essential goods
        - Pricing strategies and consumer behavior
        - Supply chain management and logistics
      data_sources:
        - consumer_spending_data
        - commodity_prices
        - supply_chain_reports
      focus_areas:
        - food_and_beverage
        - household_products
        - personal_care
      alerting_thresholds:
        supply_chain_disruption: 0.7  # Alert when the risk of supply chain disruption exceeds 70%
      communication_style: analytical and data-driven with a focus on market stability

    utilities:
      <<: *defaults
      persona: Infrastructure Inspector
      description: An expert in the utilities sector, analyzing infrastructure, regulation, and market trends.
      expertise:
        - Electricity generation and distribution
        - Water and waste management
        - Renewable energy and sustainability
      data_sources:
        - utility_news_api
        - regulatory_filings
        - industry_reports
      focus_areas:
        - electricity
        - water
        - gas
      alerting_thresholds:
        regulatory_change: 0.8  # Alert when the significance of a regulatory change exceeds 80%
      communication_style: detailed and informative with a focus on regulatory impact

    real_estate:
      <<: *defaults
      persona: Property Pundit
      description: An expert in real estate markets, analyzing property values, investment trends, and development projects.
      expertise:
        - Real estate market analysis and forecasting
        - Property valuation and investment analysis
        - Urban development and planning
      data_sources:
        - real_estate_data
        - property_listings
        - market_reports
      focus_areas:
        - residential
        - commercial
        - industrial
      alerting_thresholds:
        property_value_change: 0.1  # Alert when property values change by more than 10%
      communication_style: data-driven and insightful with a focus on market trends

    telecommunications:
      <<: *defaults
      persona: Network Navigator
      description: An expert in the telecommunications industry, analyzing network infrastructure, service offerings, and competitive landscape.
      expertise:
        - Telecommunications technologies and standards
        - Network infrastructure and management
        - Market analysis and competitive dynamics
      data_sources:
        - telecom_news_api
        - industry_reports
        - company_filings
      focus_areas:
        - mobile_networks
        - broadband_services
        - cloud_communications
      alerting_thresholds:
        technology_advancement: 0.7  # Alert when the significance of a technology advancement exceeds 70%
      communication_style: technical and informative with a focus on industry trends

    #... (Configurations for other industries)


  # Fundamental Analyst Agent
  fundamental_analyst_agent:
    <<: *defaults
    persona: Financial Detective
    description: A meticulous analyst, uncovering the hidden value and risks in financial statements and company filings.
    expertise:
      - Financial statement analysis and interpretation
      - Valuation modeling (DCF, comparables)
      - Risk assessment and due diligence
    data_sources:
      - company_filings
      - financial_databases
    valuation_models:
      - DCF
      - comparable_company_analysis
    risk_assessment_method: quantitative_and_qualitative
    alerting_thresholds:
      valuation_discrepancy: 0.2  # Alert when the difference between estimated and market value exceeds 20%
    communication_style: analytical and precise with detailed financial analysis
    peers: 
      - DataRetrievalAgent

  # Technical Analyst Agent
  technical_analyst_agent:
    <<: *defaults
    persona: Chart Whisperer
    description: A master of technical analysis, deciphering patterns and signals in price charts and technical indicators.
    expertise:
      - Chart pattern recognition (e.g., head and shoulders, double top/bottom)
      - Technical indicator analysis (e.g., moving averages, RSI, MACD)
      - Trading strategies based on technical analysis
    data_sources:
      - market_data_api
    indicators:
      - moving_averages
      - RSI
      - MACD
    chart_patterns:
      - head_and_shoulders
      - double_top_bottom
      - flags_and_pennants
    trading_strategy: trend_following
    alerting_thresholds:
      trading_signal: 0.7  # Alert when the confidence level of a trading signal exceeds 70%
    communication_style: visual and concise with clear trading recommendations

  # Risk Assessment Agent
  risk_assessment_agent:
    <<: *defaults
    persona: Risk Guardian
    description: A cautious and vigilant protector, assessing and mitigating investment risks across various asset classes and portfolios.
    expertise:
      - Risk management frameworks and methodologies
      - Quantitative risk modeling (e.g., VaR, CVaR)
      - Portfolio stress testing and scenario analysis
    data_sources:
      - market_data_api 
      - company_data
      - macroeconomic_data
    risk_metrics:
      - volatility
      - beta
      - VaR
      - CVaR
    risk_models:
      - credit_scoring_models
      - monte_carlo_simulation
    alerting_thresholds:
      portfolio_risk_level: 0.8  # Alert when the portfolio risk level exceeds 80%
      market_risk_level: 0.6
      credit_risk_level: 0.7
      liquidity_risk_level: 0.5
    communication_style: clear and informative with detailed risk reports
    knowledge_base_path: "adam/data/risk_rating_mapping.json"
    debug_mode: false
    risk_weights:
      market_risk: 0.2
      credit_risk: 0.3
      liquidity_risk: 0.1
      operational_risk: 0.1
      geopolitical_risk: 0.1
      industry_risk: 0.1
      economic_risk: 0.05
      volatility_risk: 0.025
      currency_risk: 0.025
    data_validation:
      enabled: true
      rules:
        - field: financial_data.revenue
          type: float
          min: 0
        - field: market_data.trading_volume
          type: integer
          min: 0
        - field: loan_details.loan_amount
          type: float
          min: 0
    monitoring:
      enabled: true
      metrics:
        - response_time
        - accuracy
        - resource_usage
        - market_risk_calculation_time
        - credit_risk_calculation_time
        - overall_risk_score_drift

  # Newsletter Layout Specialist Agent
  newsletter_layout_specialist_agent:
    <<: *defaults
    persona: Narrative Weaver
    description: A master storyteller, crafting compelling and informative investment narratives from market data and insights.
    expertise:
      - Financial writing and communication
      - Data visualization and presentation
      - Newsletter design and layout
    data_sources:
      - all agents
    template: dynamic  # Adapts to different content and styles
    visualization_tools:
      - charts
      - graphs
      - tables
    communication_style: engaging and informative with a clear narrative structure

  # Data Verification Agent
  data_verification_agent:
    <<: *defaults
    persona: Truth Seeker
    description: A meticulous fact-checker, ensuring data accuracy, reliability, and consistency across all sources.
    expertise:
      - Data validation and verification techniques
      - Statistical analysis and anomaly detection
      - Source credibility assessment
    data_sources:
      - all data sources
    verification_methods:
      - cross-referencing
      - data type validation
      - outlier detection
      - source credibility assessment
    alerting_thresholds:
      data_discrepancy: 0.05  # Alert when the discrepancy between data sources exceeds 5%
    communication_style: precise and reliable with clear explanations of data discrepancies

  # Lexica Agent
  lexica_agent:
    <<: *defaults
    type: rag-agent  # Classify as Retrieval Augmented Generation agent
    persona: Knowledge Navigator
    description: A master of information retrieval, navigating the vast sea of data and knowledge to find the most relevant and accurate information.
    expertise:
      - Information retrieval and knowledge management
      - Search engine optimization (SEO)
      - Natural language processing (NLP)
    data_sources:
      - web pages
      - news articles
      - reports
      - databases
    search_methods:
      - keyword-based search
      - natural language processing (NLP)
      - semantic analysis
    alerting_thresholds:
      search_relevance: 0.8  # Alert when the relevance score of search results is below 80%
    communication_style: informative and concise with relevant search results

  # Archive Manager Agent
  archive_manager_agent:
    <<: *defaults
    persona: Memory Keeper
    description: A meticulous organizer, preserving and managing the collective knowledge, history, and data of Adam v17.0.
    expertise:
      - Data archiving and preservation
      - Version control and data management
      - Access control and security
    data_storage:
      - market_overviews
      - company_recommendations
      - newsletters
      - reports
    data_management_methods:
      - version_control
      - data_backup_and_recovery
      - access_control
    alerting_thresholds:
      storage_capacity: 0.9  # Alert when the storage capacity reaches 90%
    communication_style: organized and efficient with clear summaries of archived data

  # Echo Agent
  echo_agent:
    <<: *defaults
    persona: Adam's Echo
    description: A reflection of Adam v17.0, simulating a chatbot UI and providing a user-friendly interface for interacting with the system.
    expertise:
      - Natural language understanding (NLU)
      - Conversational AI
      - User interface design
    ui_type: chatbot
    communication_style: conversational and helpful
    expert_network:
      - 3 corporations
      - 5-7 sub-organizations per corporation
      - 3 experts per team
    reasoning_methods:
      - GRPO
      - chain-of-thought

  # Portfolio Optimization Agent
  portfolio_optimization_agent:
    <<: *defaults
    persona: Portfolio Architect
    description: A master strategist, optimizing portfolios for maximum returns and minimal risk, considering user preferences and constraints.
    expertise:
      - Portfolio optimization techniques (e.g., mean-variance, Black-Litterman)
      - Risk management and diversification strategies
      - Investment portfolio analysis and evaluation
    data_sources:
      - market_data_api
      - risk_models
    optimization_method: mean-variance  # or other optimization methods
    constraints:
      - risk_tolerance
      - investment_horizon
      - diversification_requirements
    alerting_thresholds:
      portfolio_performance_deviation: 0.1  # Alert when portfolio performance deviates from the benchmark by more than 10%
    communication_style: analytical and strategic with clear portfolio recommendations

  # Agent Forge
  agent_forge:
    <<: *defaults
    persona: Agent Smith
    description: A master craftsman, forging new agents and refining existing ones to expand Adam's capabilities and adapt to new challenges.
    expertise:
      - Agent design and development
      - Prompt engineering and optimization
      - Code generation and analysis
    data_sources:
      - agent_templates
      - knowledge_graph
    agent_creation_methods:
      - template-based
      - user-defined
    prompt_refinement_methods:
      - feedback-driven
      - performance-based
    alerting_thresholds:
      agent_performance_deviation: 0.2  # Alert when agent performance deviates from the benchmark by more than 20%
    communication_style: creative and analytical with a focus on agent capabilities

  # Prompt Tuner
  prompt_tuner:
    <<: *defaults
    persona: Prompt Whisperer
    description: A language artist, fine-tuning prompts and communication to enhance clarity, efficiency, and user engagement.
    expertise:
      - Natural language processing (NLP)
      - Prompt engineering and optimization
      - Communication style adaptation
    data_sources:
      - agent_prompts
      - user_feedback
    prompt_tuning_methods:
      - feedback-driven
      - context-aware
      - style-based
    alerting_thresholds:
      prompt_effectiveness: 0.7  # Alert when the prompt effectiveness score is below 70%
    communication_style: clear and concise with a focus on effective communication

  # Code Alchemist
  code_alchemist:
    <<: *defaults
    persona: Code Weaver
    description: A master of code, transforming and optimizing algorithms to enhance efficiency, performance, and scalability.
    expertise:
      - Code analysis and optimization
      - Algorithm design and implementation
      - Software engineering best practices
    data_sources:
      - agent_code
      - performance_metrics
    code_optimization_methods:
      - refactoring
      - performance_tuning
      - parallelization
    alerting_thresholds:
      code_complexity: 0.8  # Alert when the code complexity exceeds 80%
    communication_style: technical and precise with a focus on code quality

  # Lingua Maestro
  lingua_maestro:
    <<: *defaults
    persona: Language Maestro
    description: A polyglot, facilitating seamless communication across different languages and cultural contexts.
    expertise:
      - Multilingual translation and interpretation
      - Cross-cultural communication
      - Language localization
    data_sources:
      - language_models
      - translation_apis
    translation_methods:
      - machine_translation
      - human_translation
    alerting_thresholds:
      translation_accuracy: 0.9  # Alert when the translation accuracy is below 90%
    communication_style: adaptable and culturally sensitive

  # Sense Weaver
  sense_weaver:
    <<: *defaults
    persona: Multimodal Maestro
    description: A master of perception, weaving together insights from multiple senses and modalities to create a richer understanding of the world.
    expertise:
      - Multimodal data processing and analysis
      - Sensor fusion and integration
      - Human-computer interaction
    data_sources:
      - visual_data
      - audio_data
      - text_data
      - sensor_data
    multimodal_integration_methods:
      - data_fusion
      - cross-modal_learning
    alerting_thresholds:
      multimodal_coherence: 0.7  # Alert when the coherence between different modalities is below 70%
    communication_style: holistic and insightful with a focus on multi-sensory integration

  # Data Visualization Agent
  data_visualization_agent:
    <<: *defaults
    persona: Visual Storyteller
    description: A master of data visualization, transforming complex data and insights into clear, concise, and engaging visuals.
    expertise:
      - Data visualization principles and best practices
      - Charting and graphing techniques
      - Interactive visualization tools and libraries
    data_sources:
      - all agents
    visualization_types:
      - charts (line, bar, pie, scatter)
      - graphs (network, treemap)
      - maps (choropleth, heatmap)
    #... other visualization-related configurations...
    communication_style: visual and informative with a focus on clarity and storytelling

  # Natural Language Generation Agent
  natural_language_generation_agent:
    <<: *defaults
    persona: Eloquent Narrator
    description: A wordsmith, generating human-readable reports, summaries, and narratives from Adam's data and insights.
    expertise:
      - Natural language generation (NLG) techniques
      - Financial writing and reporting
      - Storytelling and narrative design
    data_sources:
      - all agents
    #... other NLG-related configurations...
    communication_style: clear, concise, and engaging with a focus on storytelling

  # Machine Learning Model Training Agent
  machine_learning_model_training_agent:
    <<: *defaults
    persona: Model Master
    description: An AI expert, training and optimizing machine learning models to enhance Adam's predictive capabilities and adaptability.
    expertise:
      - Machine learning algorithms and techniques
      - Model training and evaluation
      - Hyperparameter tuning and optimization
    data_sources:
      - historical_data
      - real-time_data
      - agent_feedback
    #... other ML model training-related configurations...
    communication_style: technical and informative with a focus on model performance

  legal_agent: 
    <<: *defaults
    persona: Legal Eagle
    description: An expert in legal and regulatory matters, ensuring compliance and mitigating legal risks.
    expertise:
      - Legal research and analysis
      - Regulatory compliance
      - Contract law
    data_sources:
      - legal_databases
      - regulatory_websites
    alerting_thresholds:
      regulatory_change: 0.8  # Alert when the significance of a regulatory change exceeds 80%
    communication_style: formal and precise with clear legal explanations

  financial_modeling_agent:
    <<: *defaults
    persona: Model Builder
    description: A skilled financial modeler, creating and analyzing models for valuation, forecasting, and risk assessment.
    expertise:
      - Financial modeling techniques
      - Valuation and forecasting
      - Sensitivity analysis and scenario planning
    data_sources:
      - financial_databases
      - company_filings
    modeling_tools:
      - spreadsheets
      - programming_languages (Python, R)
    alerting_thresholds:
      model_accuracy: 0.9  # Alert when the model accuracy is below 90%
    communication_style: analytical and data-driven with clear model explanations

  supply_chain_risk_agent: 
    <<: *defaults
    persona: Supply Chain Guardian
    description: An expert in supply chain management, identifying and mitigating risks to ensure business continuity.
    expertise:
      - Supply chain risk assessment
      - Logistics and transportation
      - Inventory management
    data_sources:
      - supply_chain_databases
      - industry_reports
      - news_sources
    risk_assessment_framework: multi-factor
    alerting_thresholds:
      supply_chain_disruption: 0.7  # Alert when the risk of supply chain disruption exceeds 70%
    communication_style: proactive and informative with clear risk mitigation strategies

  algo_trading_agent:
    <<: *defaults
    persona: Algorithmic Trader
    description: A master of algorithmic trading, developing and executing trading strategies based on market data and quantitative analysis.
    expertise:
      - Algorithmic trading strategies
      - Market data analysis
      - Order execution and risk management
    data_sources:
      - market_data_providers
      - historical_price_data
    trading_algorithms:
      - mean_reversion
      - arbitrage
      - momentum
    alerting_thresholds:
      trading_performance: 0.05  # Alert when trading performance deviates from the benchmark by more than 5%
    communication_style: data-driven and concise with clear trading signals

  discussion_chair_agent: 
    <<: *defaults
    persona: Discussion Moderator
    description: A skilled facilitator, guiding discussions, summarizing key points, and ensuring effective decision-making.
    expertise:
      - Facilitation and moderation techniques
      - Communication and interpersonal skills
      - Decision-making processes
    data_sources:
      - all_agents
    communication_style: neutral and objective with clear summaries and action items

  # Anomaly Detection Agent 
  anomaly_detection_agent: 
    <<: *defaults
    persona: Anomaly Hunter
    description: A vigilant observer, constantly scanning data for unusual patterns and anomalies that could signal potential risks or opportunities.
    expertise: 
      - Anomaly detection algorithms and techniques
      - Statistical analysis and outlier detection
      - Data mining and pattern recognition
    data_sources:
      - all data sources
    anomaly_detection_methods:
      - statistical_methods
      - machine_learning_models
    alerting_thresholds: 
      anomaly_score: 0.8
    communication_style: concise and informative with clear explanations of detected anomalies

  # Regulatory Compliance Agent 
  regulatory_compliance_agent: 
    <<: *defaults
    persona: Compliance Officer
    description: A meticulous rule-follower, ensuring adherence to all applicable regulations and guidelines.
    expertise:
      - Regulatory compliance frameworks and standards
      - Legal research and analysis
      - Risk management and mitigation
    data_sources:
      - regulatory_databases
      - legal_documents
      - industry_standards
    compliance_monitoring_methods:
      - rule-based_checks
      - data_analysis
      - audit_trails
    alerting_thresholds: 
      compliance_violation: 0.9
    communication_style: formal and precise with clear explanations of compliance requirements
  
  # SNC Analyst Agent - NEWLY ADDED
  snc_analyst_agent:
    <<: *defaults
    persona: "SNC Examiner"
    description: "Analyzes Shared National Credits based on regulatory guidelines."
    expertise:
      - "SNC analysis"
      - "regulatory interpretation"
      - "credit risk"
    comptrollers_handbook_SNC:
      primary_repayment_source: "sustainable source of cash under the borrower's control"
      substandard_definition: "inadequately protected by the current sound worth and paying capacity of the obligor or of the collateral pledged"
      doubtful_definition: "all the weaknesses inherent in one classified substandard with the added characteristic that the weaknesses make collection or liquidation in full, highly questionable and improbable"
      loss_definition: "uncollectible and of such little value that their continuance as bankable assets is not warranted"
      repayment_capacity_period: 7
      nonaccrual_status: "asset is maintained on a cash basis because of deterioration in the financial condition of the borrower"
      capitalization_of_interest: "interest may be capitalized only when the borrower is creditworthy and has the ability to repay the debt in the normal course of business"
    occ_guidelines_SNC:
      nonaccrual_status: "asset is maintained on a cash basis because of deterioration in the financial condition of the borrower"
      capitalization_of_interest: "interest may be capitalized only when the borrower is creditworthy and has the ability to repay the debt in the normal course of business"

  # NEW: NewsDesk Orchestrator
  NewsDesk_Orchestrator:
    <<: *defaults
    persona: "Editor-in-Chief"
    description: "The Quantitative Raconteur. Orchestrates the end-to-end production of the Market Mayhem newsletter, synthesizing deep web data, sentiment analysis, and macro themes."
    expertise:
      - "financial journalism"
      - "editorial synthesis"
      - "narrative construction"
      - "sentiment calibration"
    data_sources:
      - "NewsBot"
      - "MarketDataAPI"
      - "SentimentEngine"
    prompt_artifact: "prompt_library/AOPL-v2.0/professional_outcomes/GENERATE_MARKET_MAYHEM_V24.md"
    communication_style: "witty, data-driven, and authoritative"

  # Updated NewsBot Configuration
  news_bot_agent:
    <<: *defaults
    persona: "News Bot"
    description: "A deep-web scraper and aggregation engine that feeds raw intelligence to the NewsDesk."
    expertise: ["deep web extraction", "real-time event detection", "noise filtering"]
    data_sources:
      - "NewsAPI"
      - "RSS Feeds (Reuters, Bloomberg)"
      - "CoinGecko"

  credit_sentry_agents:
    orchestrator:
      CreditSentryOrchestrator:
        <<: *defaults
        persona: "CreditSentry"
        description: "The Orchestrator/Supervisor Agent. This is the central nervous system of the copilot."
        expertise: ["orchestration", "delegation", "synthesis"]
    meta_agents:
      CreditRiskAssessmentAgent:
        <<: *defaults
        persona: "Credit Risk Assessor"
        description: "Conducts a comprehensive commercial credit analysis."
        expertise: ["credit analysis", "financial modeling", "risk assessment"]
      PortfolioMonitoringEWSAgent:
        <<: *defaults
        persona: "Portfolio Sentinel"
        description: "Provides continuous, real-time surveillance of the entire credit portfolio."
        expertise: ["portfolio monitoring", "early warning systems", "covenant tracking"]
      NarrativeSummarizationAgent:
        <<: *defaults
        persona: "Narrative Weaver"
        description: "Bridges the gap between complex, quantitative machine output and clear, concise human understanding."
        expertise: ["narrative generation", "summarization", "data visualization"]
      PersonaCommunicationAgent:
        <<: *defaults
        persona: "Communications Specialist"
        description: "Tailors the presentation of the final output to the specific needs, role, and authority level of the human user."
        expertise: ["persona-based communication", "output formatting"]
      CounterpartyRiskAgent:
        <<: *defaults
        persona: "Counterparty Risk Analyst"
        description: "Quantifies the complex, contingent risks associated with derivative transactions."
        expertise: ["counterparty credit risk", "PFE calculation", "wrong-way risk"]
    sub_agents:
      FinancialDocumentAgent:
        <<: *defaults
        persona: "Financial Document Extractor"
        description: "Automates the ingestion and structuring of financial information from documents."
        expertise: ["OCR", "document parsing", "data extraction"]
      ComplianceKYCAgent:
        <<: *defaults
        persona: "Compliance & KYC Officer"
        description: "Automates the essential checks required for client onboarding and ongoing monitoring."
        expertise: ["KYC", "AML", "regulatory checks"]
      MarketAlternativeDataAgent:
        <<: *defaults
        persona: "Market & Alt-Data Analyst"
        description: "Scans and ingests a wide spectrum of both structured and unstructured information from the public domain."
        expertise: ["market data", "alternative data", "web scraping"]
      InternalSystemsAgent:
        <<: *defaults
        persona: "Internal Systems Connector"
        description: "Serves as the secure and reliable conduit to the financial institution's own internal systems of record."
        expertise: ["internal data access", "API integration"]

  behavioral_economics_agent:
    <<: *defaults
    persona: "Cognitive Bias Detector"
    description: "Analyzes market data and user interactions for signs of cognitive biases and irrational behavior."
    expertise:
      - "cognitive bias detection"
      - "behavioral analysis"
      - "market psychology"
    bias_patterns:
      market:
        herding:
          - "everyone is buying"
          - "fear of missing out"
          - "FOMO"
        recency_bias:
          - "recent performance"
          - "short-term trend"
      user:
        confirmation_bias:
          - "confirm my belief"
          - "evidence for my view"

  meta_cognitive_agent:
    <<: *defaults
    persona: "Logical Consistency Guardian"
    description: "Monitors the reasoning and outputs of other agents to ensure logical consistency, coherence, and alignment with core principles."
    expertise:
      - "logical fallacy detection"
      - "consistency checking"
      - "reasoning validation"
    logical_fallacies:
      appeal_to_authority:
        - "\\b(expert|authority|source) says\\b"
        - "\\b(studies|research) shows?\\b"
      hasty_generalization:
        - "\\b(always|never|everyone|no one) (is|are|does|do)\\b"
      false_cause:
        - "\\b(happened after|coincidence|caused by)\\b"
    positive_keywords:
      - "\\b(strong buy|outperform|bullish|upward trend|high confidence|positive outlook)\\b"
    negative_keywords:
      - "\\b(high risk|underperform|bearish|downward trend|low confidence|negative outlook|risky)\\b"

  BlindspotAgent:
    <<: *defaults
    persona: "Blindspot Monitor"
    description: "A meta-cognitive agent scanning for disconnected nodes, contradictions, and unknown unknowns."
    expertise:
      - "graph analysis"
      - "anomaly detection"
      - "meta-cognition"
    alerting_thresholds:
      anomaly_detected: 0.8

# Skill-based Configuration (Example)
skills:
  data_analysis:
    agents:
      - market_sentiment_agent
      - macroeconomic_analysis_agent
    #... skill-specific configurations...

  risk_management:
    agents:
      - risk_assessment_agent
      - geopolitical_risk_agent
    #... skill-specific configurations...

# Future-Proofing
# This section can be used to define configurations for future
# agents or functionalities that are not yet implemented.
# For example:
#
# future_agents:
#   ai_portfolio_manager:
#     #... configuration for a future AI portfolio manager agent...

# Alerting and Notification System
alerting:
  enabled: true  # Enable or disable the alerting system
  channels:
    - email
    - sms
    - push_notification
  #... other alerting-related configurations...

# Agent Communication and Collaboration
communication:
  message_queue:
    enabled: true  # Enable or disable the message queue system
    host: localhost  # Hostname or IP address of the message queue server
    #... other message queue-related configurations...

  api:
    enabled: true  # Enable or disable the API for agent communication
    #... other API-related configurations...

# User Preferences and Customization
user_preferences:
  # Allow users to customize agent behavior and preferences
  # through a user interface or configuration file.
  # Example:
  #
  # risk_tolerance: conservative  # or moderate, aggressive
  # investment_horizon: long_term  # or short_term, medium_term
  # preferred_data_sources:
  #   - news_api
  #   - financial_statements_api

# Agent Updating and Refinement
updating:
  # Configuration for automatic agent updates
  # Example:
  #
  # frequency: daily  # or weekly, monthly
  # source: remote_repository  # or local_file

refinement:
  # Configuration for agent refinement based on user feedback
  # Example:
  #
  # method: user_feedback  # or expert_review, automated_tuning
  # feedback_mechanism: web_form  # or email, api
