LangGraph - Build Your Own AI Financial Agent Application (Beginners)



AI Summary

Summary: Building a Financial Agent Application with Lang Chain

Introduction

  • Creating a financial agent application for beginners using Lang Chain.
  • The application will check stock prices, latest news, financial reports, and historical prices.
  • Steps include creating tools, assigning them to an agent, coordinating with a graph, and adding a user interface with Gradio.

Setup

  • Install Lang Chain and dependencies using Conda and pip.
  • Set up API keys for OpenAI and Polygon, which provides financial data.

Development Steps

  1. Define Tools:
    • Import necessary packages and set up prompt templates.
    • Define a large language model (GPT-4 Turbo Preview) and Polygon API wrapper.
    • Assign tools for stock price, news, financial reports, and historical prices.
  2. Create Agent:
    • Define the agent with the large language model and tools.
    • Create helper functions to execute tools when needed by the agent.
  3. Define Graph:
    • Set up the workflow with nodes for the agent and tools.
    • Add entry points and conditional logic for the agent’s operation.
    • Compile the graph and invoke the chain with a sample question about Airbnb’s stock price.

User Interface

  • Modify the code to include a Gradio interface.
  • The interface takes user input, processes requests, and returns outputs.
  • Demonstration of various queries and their results using the interface.

Conclusion

  • The code will be provided for users to try out.
  • Encourages likes, shares, and subscriptions for support.