A workflow demonstrating how the Finance Agent can analyze stock market data and provide investment recommendations.

Quick Start

1

Install Package

First, install the PraisonAI Agents package:

pip install praisonaiagents
2

Set API Key

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY=your_api_key_here
3

Create Script

Create a new file finance_analysis.py:

from praisonaiagents import Agent, Tools
from praisonaiagents.tools import get_stock_price, get_stock_info, get_historical_data

agent = Agent(
    instructions="You are a Research Agent",
    tools=[get_stock_price, get_stock_info, get_historical_data]
)
agent.start("Understand current stock price and historical data of Apple and Google. Tell me if I can invest in them")

Understanding Financial Analysis

The Finance Agent specializes in stock market analysis and investment recommendations using three key components:

  1. Real-time Price Data: Uses get_stock_price to fetch current market prices
  2. Company Information: Retrieves company details using get_stock_info
  3. Historical Analysis: Analyzes trends with get_historical_data

Features

Real-time Data

Access to current stock market prices and information.

Company Analysis

Detailed company information and fundamentals.

Historical Trends

Analysis of historical price movements and patterns.

Investment Advice

AI-powered investment recommendations.

Example Usage

# Example: Analyzing specific stocks
agent.start("""
    1. Get current prices for AAPL and GOOGL
    2. Retrieve company information
    3. Analyze 6-month historical data
    4. Provide investment recommendations
""")

Next Steps

Was this page helpful?