🤖

Creating Agentic AI Applications with PhiData

Feb 16, 2025

Lecture Notes: Building End-to-End Agentic AI Applications

Introduction

  • Presenter: Krish Naik
  • Focus: Building agentic AI applications using multiple frameworks
  • Today's Framework: PhiData (open-source platform)
    • Build, deploy, and monitor agentic systems
    • Create AI agents, multi-modal agents, and agentic workflows
    • Use any LLM (Large Language Model) to create agents

Framework: PhiData

  • Features of PhiData:
    • Open-source platform for building agentic systems
    • Supports integration with various LLMs like Grok, HuggingFace, etc.
    • Allows creation of complex workflows
    • Easy code writing for integration
  • Integration Examples:
    • Grok, HuggingFace, Ulama, OpenAI
    • Various models: Grok, NVIDIA, Azure, AWS Bedrock

Setting Up the Environment

  • Python Environment Setup:
    • Use Conda to create a virtual environment
    • Python version 3.12
  • Requirements File (requirements.txt):
    • Libraries to install: PhiData, python-dotenv, YFinance, packaging, DuckDuckGo Search, FastAPI, Uvicorn, Grok

Creating AI Agents

Web Search Agent

  • Purpose: Search the web for information
  • Components:
    • Model: Grok
    • Tool: DuckDuckGo Search
    • Parameters: Include sources, use markdown

Financial Agent

  • Purpose: Analyze financial data
  • Components:
    • Model: Grok
    • Tool: YFinance
    • Parameters: Analyze recommendation, company news, technical indicators

Combining Agents

  • Multi-Model Agent: Combines web search and financial agents
    • Instructions: Include sources, use tables
    • Parameters: Stream responses

Building the Application

Creating the Project

  • File: financial_agent.py
  • Library Imports: PhiData, Grok, YFinance, DuckDuckGo
  • Environment Variables:
    • Set API keys for Grok and PhiData

Running the Application

  • Setup Python environment
  • Install dependencies from requirements.txt
  • Define and run agents

Error Handling

  • Common Errors: OpenAI API key requirement (even if not used)
  • Solution: Set OpenAI API key as environment variable

Using the Playground

  • Purpose: Visual interface for interacting with agents
  • Setup:
    • Connect to localhost endpoint
    • Use FastAPI for creating APIs
  • Example Queries:
    • Get analyst recommendations and latest news for stocks
    • Compare stock recommendations between Tesla and NVIDIA

Conclusion

  • Outcome: Successfully built and demonstrated financial analysis application
  • Next Steps: Explore more complex workflows
  • Motivation: Continue to learn and develop more agentic AI solutions

End of Lecture