Creating and Registering LangGraph based Financial Analysis Agent
This documentation explains how to build LangGraph agents that perform comprehensive financial analysis, register them on Fetch.ai's Agentverse, and enable collaboration between specialized agents for dynamic data analysis. Below, you'll see the main.py script containing the workflow logic run_financial_analysis_workflow
, as well as specialized agent implementations for financial analysis.
Overview
Purpose
This project showcases:
- Creating LangGraph agents for complex tasks (e.g., analyzing SEC filings, market research, and financial metrics).
- Integrating with Fetch.ai's Agentverse, enabling seamless communication and data exchange.
- Using autonomous agents to streamline financial analysis while combining multiple data sources and expert analysis.
Prerequisites
Environment Setup
To begin creating and registering LangGraph agents, ensure you have the following:
- Python 3.10+ or higher
- A virtual environment (recommended)
- Fetch.ai SDK for agent creation and registration
- LangGraph Framework for defining states and workflows
- LangChain for agent tools and chains
Key Components
- SEC Analysis Agent: A specialized agent that processes SEC filings and extracts financial metrics
- Search Agent: Gathers real-time market data and analyst opinions
- Supervisor Agent: Coordinates analysis flow and combines insights
- Agent Collaboration: Multiple agents work together via LangGraph state management
Architecture Diagram

Environment Variables
Create a .env
file with your API keys:
OPENAI_API_KEY=<your_openai_api_key>
TAVILY_API_KEY=<your_tavily_api_key>
AGENTVERSE_API_KEY=<your_agentverse_api_key>
Replace the placeholders with your actual keys:
Project Directory & Configuration Files
For a clean, maintainable setup, we recommend the following structure:
financial_analysis_agent/
├── .env
├── src/
│ ├── agents/
│ │ ├── __init__.py
│ │ ├── search_agent.py # Market research specialist
│ │ ├── sec_agent.py # SEC filings specialist
│ │ └── supervisor.py # Team coordinator
│ ├── tools/
│ │ ├── __init__.py
│ │ ├── search.py # Tavily search implementation
│ │ └── analysis.py # RAG implementation