Building Financial Research Agents with CrewAI and LangGraph (and When to Use Each)

This article is for solutions architects, data engineers, and applied ML practitioners who want a practical, production-minded way to automate commodity/market research and dataset generation.

Executive takeaway

Both CrewAI and LangGraph can orchestrate multi-step “agentic” workflows, but they optimize for different things:

  • CrewAI: fastest path to a *role-based* multi-agent flow (agents + tasks) with a simple mental model.
  • LangGraph: strongest choice for *deterministic, testable pipelines* with explicit state and conditional routing—closer to “workflow engine” than “chat with tools.”

If you need a dependable, auditable data pipeline that can be extended into production (e.g., daily dataset builds, validation, and feature engineering), LangGraph will generally feel more natural. If you want an agent team that can flex between research, summarization, and tooling, CrewAI is often faster to start.

Business impact framing (why this matters)

Commodity and macro-driven forecasting projects often fail before modeling due to:

  • fragmented data sources (prices, FX, macro, weather, positioning),
  • inconsistent refresh cadence,
  • weak validation and lineage,
  • and brittle “glue code.”

The goal of both projects was to turn research + extraction + feature engineering into a repeatable pipeline that produces:

1) a clean daily features dataset,

2) a data dictionary,

3) run metadata (what was fetched, when, from where), and

4) validation checks and warnings.

That structure improves:

  • reproducibility (same inputs → same outputs),
  • governance (metadata + checks),
  • and time-to-iteration (new features and sources are easy to add).

What is CrewAI?

CrewAI is a framework for orchestrating multiple agents (each with a role and goal) and tasks that run in sequence or via hierarchical coordination. In practice, you define:

  • agents (e.g., a researcher, an analyst),
  • the tools each agent can call,
  • and tasks that guide what each agent should produce.

It’s a strong fit when you want:

  • division of labor (research vs analysis vs reporting),
  • natural language task definitions,
  • and a workflow that can “reason” through ambiguous steps.

What is LangGraph?

LangGraph is a framework for building graph-based LLM workflows where nodes are functions/tools and edges define execution order and branching. A key design point is shared state (often a typed Pydantic model) that flows through nodes.

It’s a strong fit when you want:

  • deterministic execution and explicit state transitions,
  • conditional routing (skip nodes when inputs are missing),
  • robust validation and clear failure modes,
  • and testability (unit-test nodes like normal code).

CrewAI vs LangGraph: key differences

1) Orchestration model

  • CrewAI: “agents perform tasks,” often described in natural language.
  • LangGraph: “nodes transform state,” typically deterministic functions.

2) State management

  • CrewAI: state is usually implicit in task outputs and tool outputs (you decide how to pass it).
  • LangGraph: state is explicit and typed (e.g., `CommodityResearchState`), supporting durable pipelines.

3) Determinism and validation

  • CrewAI: can be deterministic, but you must enforce it via tools and conventions.
  • LangGraph: encourages deterministic nodes and validation gates by design.

4) Productionization posture

  • CrewAI: excellent for quickly assembling a research/analysis “team,” especially with human-readable tasks.
  • LangGraph: excellent for building a workflow that behaves like an ETL/feature pipeline with checks, metadata, and predictable outputs.

Architecture diagrams

CrewAI architecture (agents + tasks + tools)

CrewAI architecture

LangGraph architecture (stateful deterministic pipeline)

LangGraph architecture

Project 1: Financial research agents with CrewAI

High-level flow

1. Research task: gather context and explain the market drivers.

2. Extraction tasks:

  • Yahoo Finance OHLCV (daily),
  • FRED macro + FX (daily series where available),
  • Open-Meteo daily weather for multiple producing regions.

3. Dataset build task:

  • merge sources,
  • engineer features (returns, vol, ATR, etc.),
  • engineer weather aggregates (weighted across regions + rollups + lags),
  • write dataset + data dictionary.

Representative CrewAI configuration (Python)


# crew.py (simplified)
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task

from .tools.yahoo_finance_tools import yahoo_download_ohlcv_1d_tool
from .tools.fred_tools import fred_macro_fx_tool
from .tools.open_meteo_tools import open_meteo_daily_weather_tool
from .tools.dataset_build_tools import build_features_daily_tool

@CrewBase
class MultiAgentResearch:
    @agent
    def researcher(self) -> Agent:
        return Agent(config=self.agents_config["researcher"], verbose=True)

    @agent
    def reporting_analyst(self) -> Agent:
        return Agent(
            config=self.agents_config["reporting_analyst"],
            tools=[
                yahoo_download_ohlcv_1d_tool,
                fred_macro_fx_tool,
                open_meteo_daily_weather_tool,
                build_features_daily_tool,
            ],
            verbose=True,
        )

    @crew
    def crew(self) -> Crew:
        return Crew(
            agents=[self.researcher(), self.reporting_analyst()],
            tasks=[
                self.research_task(),
                self.yahoo_extraction_task(),
                self.fred_extraction_task(),
                self.dataset_build_task(),
            ],
            process=Process.sequential,
            verbose=True,
        )

Where to add 6 weather regions in CrewAI

You pass the `locations` argument into the Open-Meteo tool from the task YAML (or from the task prompt inputs). For example, your `open_meteo_daily_weather_tool` already supports:

open_meteo_daily_weather_tool(
  locations=[{"name": "...", "latitude": ..., "longitude": ...}, ...],
  start_date="2015-01-01",
  end_date="2025-01-01",
  use_archive=True
)

CrewAI GitHub repository

Project 2: Financial research pipeline with LangGraph

High-level flow

LangGraph is a better match when you want your workflow to behave like a deterministic pipeline:

1. Extract price (Yahoo OHLCV)

2. Extract macro/FX (FRED + World Bank)

3. Extract weather (Open-Meteo archive; 6 regions)

4. Build features (market + macro + weighted weather aggregates + rollups + lags)

5. Validate (schema checks, missingness, target horizon checks)

6. Write outputs (features CSV + data dictionary + metadata)

Representative LangGraph build (Python)

from langgraph.graph import StateGraph, START, END
from langgraphagenticai.state import CommodityResearchState

def build_graph():
    graph = StateGraph(CommodityResearchState)

    graph.add_node("yahoo_extract", yahoo_data_extraction_node)
    graph.add_node("fred_extract", fred_data_extraction_node)
    graph.add_node("open_meteo_extract", open_meteo_weather_node)
    graph.add_node("build_features", build_features_node)
    graph.add_node("validate", validate_node)

    graph.add_edge(START, "yahoo_extract")
    graph.add_edge("yahoo_extract", "fred_extract")
    graph.add_edge("fred_extract", "open_meteo_extract")
    graph.add_edge("open_meteo_extract", "build_features")
    graph.add_edge("build_features", "validate")
    graph.add_edge("validate", END)

    return graph.compile()

Why this felt “production-ready”

  • A typed shared state object (`CommodityResearchState`) makes the run explicit.
  • Nodes are deterministic (transform state and write artifacts).
  • Validation is a first-class step (fail fast, or warn with provenance).

LangGraph GitHub repository

Practical guidance: when I would choose which

Choose CrewAI if you want:

  • a “team” of agents that can flex between research and tooling,
  • richer narrative output (reports, analyses) driven by natural language tasks,
  • and rapid iteration on the interaction model.

Choose LangGraph if you want:

  • deterministic, testable workflow behavior,
  • explicit state and artifact tracking,
  • reliable validation and clear operational semantics,
  • and an easier path to scheduled runs (daily/weekly pipeline execution).

Closing

Both implementations reach the same outcome: a repeatable research-to-dataset pipeline. The difference is the operational posture:

  • CrewAI emphasizes *agent collaboration*,
  • LangGraph emphasizes *stateful, deterministic workflow execution*.