Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:24mlight A Share investment Agent researcher bear agent

From Leeroopedia
Knowledge Sources
Domains AI_Agents, Finance
Last Updated 2026-10-10 14:00 GMT

Overview

Concrete tool for constructing bearish investment theses from analyst signals with cautionary counter-narrative generation for non-supportive data, provided by the A_Share_investment_Agent repository.

Description

The researcher_bear_agent function mirrors the bull agent. It reads signals from four analyst agents and constructs a bearish thesis. For bearish signals, it extracts supporting details. For non-bearish signals, it generates cautionary counter-narratives (e.g., "recent rally may be technical correction, risk of reversion") with a baseline confidence of 0.3. Overall confidence is the average of all four signal confidences.

Usage

Import when you need to:

  • Build a bearish thesis from multiple analyst signals
  • Run as a fan-in node in the LangGraph workflow (after 4 parallel analysts)

Decorated with @agent_endpoint("researcher_bear", "空方研究员...").

Code Reference

Source Location

Signature

def _load_agent_signals(state: AgentState, agent_name: str) -> dict:
    """Fetch agent output if available, otherwise return neutral placeholder."""

@agent_endpoint("researcher_bear", "空方研究员,从看空角度分析市场数据并提出风险警示")
def researcher_bear_agent(state: AgentState) -> dict:
    """Analyzes signals from a bearish perspective and generates cautionary investment thesis."""

Import

from src.agents.researcher_bear import researcher_bear_agent

I/O Contract

Inputs

Name Type Required Description
state AgentState Yes Reads messages from technical_analyst_agent, fundamentals_agent, sentiment_agent, valuation_agent

Outputs

Name Type Description
messages list HumanMessage with {perspective: "bearish", confidence: float (0-1), thesis_points: list[str], reasoning: str}

Usage Examples

from src.agents.researcher_bear import researcher_bear_agent

# Runs as fan-in node after [technical, fundamentals, sentiment, valuation] agents
# Mirror of researcher_bull_agent but with bearish perspective
# Counter-narratives for non-bearish signals (e.g., "过度乐观需警惕回撤")

Related Pages

Implements Principle

Requires Environment

Uses Heuristics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment