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 fundamentals agent

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

Overview

Concrete tool for fundamental analysis scoring across profitability, growth, financial health, and price ratios provided by the A_Share_investment_Agent repository.

Description

The fundamentals_agent function evaluates a company's financial health from 4 dimensions using threshold-based scoring. It reads financial metrics (ROE, net margin, operating margin, revenue growth, earnings growth, current ratio, debt-to-equity, P/E, P/B, P/S) from the shared state and produces a bullish/bearish/neutral signal with detailed reasoning for each sub-dimension.

Usage

Import when you need to:

  • Evaluate stock fundamentals from financial metrics
  • Run as a parallel node in the LangGraph workflow (after market_data_agent)

Decorated with @agent_endpoint("fundamentals", "基本面分析师...").

Code Reference

Source Location

Signature

@agent_endpoint("fundamentals", "基本面分析师,分析公司财务指标、盈利能力和增长潜力")
def fundamentals_agent(state: AgentState) -> dict:
    """Responsible for fundamental analysis"""

Import

from src.agents.fundamentals import fundamentals_agent

I/O Contract

Inputs

Name Type Required Description
state AgentState Yes Reads data["financial_metrics"][0] (dict with ROE, margins, growth, ratios)

Outputs

Name Type Description
messages list HumanMessage with {signal, confidence, reasoning}
reasoning dict {profitability_signal, growth_signal, financial_health_signal, price_ratios_signal} each with signal, details

Usage Examples

from src.agents.fundamentals import fundamentals_agent

# Runs as parallel node after market_data_agent
# Reads data["financial_metrics"][0] which contains:
#   return_on_equity, net_margin, operating_margin,
#   revenue_growth, earnings_growth, book_value_growth,
#   current_ratio, debt_to_equity,
#   pe_ratio, price_to_book, price_to_sales

Related Pages

Implements Principle

Requires Environment

Page Connections

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