From c3beae9de7aa43b804f5f3c137439f8b38b80f00 Mon Sep 17 00:00:00 2001 From: ShubhamSaboo Date: Sat, 1 Jun 2024 16:39:24 -0500 Subject: [PATCH] Added new demo --- README.md | 71 +++++++++++++------ chat_with_github/chat_github_llama3.py | 7 +- .../README.md | 2 +- .../chat_arxiv.py | 6 +- .../chat_arxiv_llama3.py | 23 ++++++ chat_with_research_papers/requirements.txt | 4 ++ investment_ai_agent/README.md | 41 +++++++++++ investment_ai_agent/investment_agent.py | 30 ++++++++ .../requirements.txt | 0 .../README.md | 0 multi_agent_researcher/requirements.txt | 3 + .../research_agent.py | 2 +- .../README.md | 2 +- .../ai_websearch.py | 4 +- .../requirements.txt | 0 15 files changed, 163 insertions(+), 32 deletions(-) rename {chat_with_arxiv => chat_with_research_papers}/README.md (95%) rename {chat_with_arxiv => chat_with_research_papers}/chat_arxiv.py (80%) create mode 100644 chat_with_research_papers/chat_arxiv_llama3.py create mode 100644 chat_with_research_papers/requirements.txt create mode 100644 investment_ai_agent/README.md create mode 100644 investment_ai_agent/investment_agent.py rename {multi_agent => investment_ai_agent}/requirements.txt (100%) rename {multi_agent => multi_agent_researcher}/README.md (100%) create mode 100644 multi_agent_researcher/requirements.txt rename {multi_agent => multi_agent_researcher}/research_agent.py (94%) rename {web_search_ai_agent => web_search_ai_assistant}/README.md (98%) rename web_search_ai_agent/ai_webagent.py => web_search_ai_assistant/ai_websearch.py (89%) rename {web_search_ai_agent => web_search_ai_assistant}/requirements.txt (100%) diff --git a/README.md b/README.md index 8402c57..5a6cce3 100644 --- a/README.md +++ b/README.md @@ -6,64 +6,95 @@

- LinkedIn + LinkedIn - Twitter + Twitter +

+
# 🌟 Awesome LLM Apps A curated collection of awesome LLM apps built with RAG and AI agents. This repository features LLM apps that use models from OpenAI, Anthropic, Google, and even open-source models like LLaMA that you can run locally on your computer. +## 📑 Table of Contents + +- [🤔 Why Awesome LLM Apps?](#-why-awesome-llm-apps) +- [📂 Featured Projects](#-featured-projects) + - [💻 Local Lllama-3 with RAG](#-local-llama-3-with-rag) + - [🎯 Generative AI Web Search Assistant](#-generative-ai-web-search-assistant) + - [💬 Chat with GitHub Repo](#-chat-with-github-repo) + - [📈 AI Investment Agent](#-ai-investment-agent) + - [📰 Multi-Agent AI Researcher](#-multi-agent-ai-researcher) + - [📄 Chat with PDF](#-chat-with-pdf) + - [💻 Web Scraping AI Agent](#-web-scraping-ai-agent) + - [📨 Chat with Gmail](#-chat-with-gmail) + - [📽️ Chat with YouTube Videos](#-chat-with-youtube-videos) + - [🔎 Chat with Arxiv Research Papers](#-chat-with-arxiv-research-papers) + - [📝 Chat with Substack Newsletter](#-chat-with-substack-newsletter) +- [🚀 Getting Started](#-getting-started) +- [🤝 Contributing to Opensource](#-contributing-to-opensource) + ## 🤔 Why Awesome LLM Apps? - 💡 Discover practical and creative ways LLMs can be applied across different domains, from code repositories to email inboxes and more. -- 🔥 Explore apps that combines LLMs from OpenAI, Anthropic, Gemini, and open-source alternatives with RAG and AI Agents. -- 🎓 Learn from well-documented projects and contribute to the growing opensource ecosystem of LLM-powered applications. +- 🔥 Explore apps that combine LLMs from OpenAI, Anthropic, Gemini, and open-source alternatives with RAG and AI Agents. +- 🎓 Learn from well-documented projects and contribute to the growing open-source ecosystem of LLM-powered applications. ## 📂 Featured Projects ### 💻 Local Lllama-3 with RAG Chat with any webpage using local Llama-3 and Retrieval Augmented Generation (RAG) in a Streamlit app. Enjoy 100% free and offline functionality. +### 🎯 Generative AI Web Search Assistant +Get pinpointed answers to your queries by combining search engines and LLMs using OpenAI's GPT-4 and the DuckDuckGo search engine for accurate responses. + ### 💬 Chat with GitHub Repo Engage in natural conversations with your GitHub repositories using GPT-4. Uncover valuable insights and documentation effortlessly. -### 📨 Chat with Gmail -Interact with your Gmail inbox using natural language. Get accurate answers to your questions based on the content of your emails with Retrieval Augmented Generation (RAG). +### 📈 AI Investment Agent +AI investment agent that compares the performance of two stocks and generates detailed stock reports with company insights, news, and analyst recommendations to help you make smart investment choices. -### 📝 Chat with Substack Newsletter -Chat with a Substack newsletter using OpenAI's API and the Embedchain library in a Streamlit app. Leverage GPT-4 for precise answers based on newsletter content. +### 📰 Multi-Agent AI Researcher +Use a team of AI agents to research top HackerNews stories and users with GPT-4 to generate blog posts, reports, and social media content on autopilot. ### 📄 Chat with PDF Engage in intelligent conversation and question-answering based on the content of your PDF documents. Simply upload and start asking questions. -### 📽️ Chat with YouTube Videos -Dive into video content with interactive conversation and question-answering based on YouTube videos. Provide a URL and engage with the video's content through natural language. - ### 💻 Web Scraping AI Agent Intelligently scrape websites using OpenAI API and the scrapegraphai library. Specify the URL and extraction requirements, and let the AI agent handle the rest. +### 📨 Chat with Gmail +Interact with your Gmail inbox using natural language. Get accurate answers to your questions based on the content of your emails with Retrieval Augmented Generation (RAG). + +### 📽️ Chat with YouTube Videos +Dive into video content with interactive conversation and question-answering based on YouTube videos. Provide a URL and engage with the video's content through natural language. + +### 🔎 Chat with Arxiv Research Papers +Explore the vast knowledge in arXiv research papers through interactive conversations using GPT-4 and unlock insights from millions of research papers. + +### 📝 Chat with Substack Newsletter +Chat with a Substack newsletter using OpenAI's API and the Embedchain library in a Streamlit app. Leverage GPT-4 for precise answers based on newsletter content. ## 🚀 Getting Started 1. Clone the repository -```bash -git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git -``` + ```bash + git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git + ``` 2. Navigate to the desired project directory -```bash -cd awesome-llm-apps/chat_with_gmail -``` + ```bash + cd awesome-llm-apps/chat_with_gmail + ``` 3. Install the required dependencies -```bash -pip install -r requirements.txt -``` + ```bash + pip install -r requirements.txt + ``` 4. Follow the project-specific instructions in each project's README.md file to set up and run the app. diff --git a/chat_with_github/chat_github_llama3.py b/chat_with_github/chat_github_llama3.py index a1e71a6..d700482 100644 --- a/chat_with_github/chat_github_llama3.py +++ b/chat_with_github/chat_github_llama3.py @@ -5,9 +5,9 @@ from embedchain.loaders.github import GithubLoader import streamlit as st import os -GITHUB_TOKEN = os.getenv("GITHUB_TOKEN") +GITHUB_TOKEN = os.getenv("Your GitHub Token") + def get_loader(): - print("Creating GithubLoader") loader = GithubLoader( config={ "token": GITHUB_TOKEN @@ -22,7 +22,6 @@ loader = st.session_state.loader # Define the embedchain_bot function def embedchain_bot(db_path): - print("Creating Embedchain App") return App.from_config( config={ "llm": {"provider": "ollama", "config": {"model": "llama3:instruct", "max_tokens": 250, "temperature": 0.5, "stream": True, "base_url": 'http://localhost:11434'}}, @@ -36,7 +35,7 @@ def load_repo(git_repo): # Add the repo to the knowledge base print(f"Adding {git_repo} to knowledge base!") app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader) -# st.success(f"Added {git_repo} to knowledge base!") + st.success(f"Added {git_repo} to knowledge base!") def make_db_path(): diff --git a/chat_with_arxiv/README.md b/chat_with_research_papers/README.md similarity index 95% rename from chat_with_arxiv/README.md rename to chat_with_research_papers/README.md index eda46a9..b5fa6ce 100644 --- a/chat_with_arxiv/README.md +++ b/chat_with_research_papers/README.md @@ -1,4 +1,4 @@ -## 🔎 Chat with Arxiv +## 🔎 Chat with Arxiv Research Papers This Streamlit app enables you to engage in interactive conversations with arXiv, a vast repository of scholarly articles, using GPT-4o. With this RAG application, you can easily access and explore the wealth of knowledge contained within arXiv. ### Features diff --git a/chat_with_arxiv/chat_arxiv.py b/chat_with_research_papers/chat_arxiv.py similarity index 80% rename from chat_with_arxiv/chat_arxiv.py rename to chat_with_research_papers/chat_arxiv.py index 7688048..a06e956 100644 --- a/chat_with_arxiv/chat_arxiv.py +++ b/chat_with_research_papers/chat_arxiv.py @@ -5,8 +5,8 @@ from phi.llm.openai import OpenAIChat from phi.tools.arxiv_toolkit import ArxivToolkit # Set up the Streamlit app -st.title("Chat with Arxiv 🔎🤖") -st.caption("This app allows you to chat with arXiv using OpenAI GPT-4o model.") +st.title("Chat with Research Papers 🔎🤖") +st.caption("This app allows you to chat with arXiv research papers using OpenAI GPT-4o model.") # Get OpenAI API key from user openai_access_token = st.text_input("OpenAI API Key", type="password") @@ -19,7 +19,7 @@ if openai_access_token: model="gpt-4o", max_tokens=1024, temperature=0.9, - api_key=openai_access_token) , tools=[ArxivToolkit()], show_tool_calls=True + api_key=openai_access_token) , tools=[ArxivToolkit()] ) # Get the search query from the user diff --git a/chat_with_research_papers/chat_arxiv_llama3.py b/chat_with_research_papers/chat_arxiv_llama3.py new file mode 100644 index 0000000..5e1181d --- /dev/null +++ b/chat_with_research_papers/chat_arxiv_llama3.py @@ -0,0 +1,23 @@ +# Import the required libraries +import streamlit as st +from phi.assistant import Assistant +from phi.llm.ollama import Ollama +from phi.tools.arxiv_toolkit import ArxivToolkit + +# Set up the Streamlit app +st.title("Chat with Research Papers 🔎🤖") +st.caption("This app allows you to chat with arXiv research papers using Llama-3 running locally.") + +# Create an instance of the Assistant +assistant = Assistant( +llm=Ollama( + model="llama3:instruct") , tools=[ArxivToolkit()], show_tool_calls=True +) + +# Get the search query from the user +query= st.text_input("Enter the Search Query", type="default") + +if query: + # Search the web using the AI Assistant + response = assistant.run(query, stream=False) + st.write(response) \ No newline at end of file diff --git a/chat_with_research_papers/requirements.txt b/chat_with_research_papers/requirements.txt new file mode 100644 index 0000000..0f954bf --- /dev/null +++ b/chat_with_research_papers/requirements.txt @@ -0,0 +1,4 @@ +streamlit +phidata +arxiv +openai \ No newline at end of file diff --git a/investment_ai_agent/README.md b/investment_ai_agent/README.md new file mode 100644 index 0000000..f655d04 --- /dev/null +++ b/investment_ai_agent/README.md @@ -0,0 +1,41 @@ +## 📈 AI Investment Agent +This Streamlit app is an AI-powered investment agent that compares the performance of two stocks and generates detailed reports. By using GPT-4o with Yahoo Finance data, this app provides valuable insights to help you make informed investment decisions. + +### Features +- Compare the performance of two stocks +- Retrieve comprehensive company information +- Get the latest company news and analyst recommendations +- Get the latest company news and analyst recommendations + +### How to get Started? + +1. Clone the GitHub repository + +```bash +git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git +``` +2. Install the required dependencies: + +```bash +pip install -r requirements.txt +``` +3. Get your OpenAI API Key + +- Sign up for an [OpenAI account](https://platform.openai.com/) (or the LLM provider of your choice) and obtain your API key. + +4. Run the Streamlit App +```bash +streamlit run investment_agent.py +``` + +### How it Works? + +- Upon running the app, you will be prompted to enter your OpenAI API key. This key is used to authenticate and access the OpenAI language model. +- Once you provide a valid API key, an instance of the Assistant class is created. This assistant utilizes the GPT-4 language model from OpenAI and the YFinanceTools for accessing stock data. +- Enter the stock symbols of the two companies you want to compare in the provided text input fields. +- The assistant will perform the following steps: + - Retrieve real-time stock prices and historical data using YFinanceTools + - Fetch the latest company news and analyst recommendations + - Gather comprehensive company information + - Generate a detailed comparison report using the GPT-4 language model +- The generated report will be displayed in the app, providing you with valuable insights and analysis to guide your investment decisions. \ No newline at end of file diff --git a/investment_ai_agent/investment_agent.py b/investment_ai_agent/investment_agent.py new file mode 100644 index 0000000..2bd474d --- /dev/null +++ b/investment_ai_agent/investment_agent.py @@ -0,0 +1,30 @@ +# Import the required libraries +import streamlit as st +from phi.assistant import Assistant +from phi.llm.openai import OpenAIChat +from phi.tools.yfinance import YFinanceTools + +# Set up the Streamlit app +st.title("AI Investment Agent 📈🤖") +st.caption("This app allows you to compare the performance of two stocks and generate detailed reports.") + +# Get OpenAI API key from user +openai_api_key = st.text_input("OpenAI API Key", type="password") + +if openai_api_key: + # Create an instance of the Assistant + assistant = Assistant( + llm=OpenAIChat(model="gpt-4o", api_key=openai_api_key), + tools=[YFinanceTools(stock_price=True, analyst_recommendations=True, company_info=True, company_news=True)], + show_tool_calls=True, + ) + + # Input fields for the stocks to compare + stock1 = st.text_input("Enter the first stock symbol") + stock2 = st.text_input("Enter the second stock symbol") + + if stock1 and stock2: + # Get the response from the assistant + query = f"Compare {stock1} to {stock2}. Use every tool you have." + response = assistant.run(query, stream=False) + st.write(response) \ No newline at end of file diff --git a/multi_agent/requirements.txt b/investment_ai_agent/requirements.txt similarity index 100% rename from multi_agent/requirements.txt rename to investment_ai_agent/requirements.txt diff --git a/multi_agent/README.md b/multi_agent_researcher/README.md similarity index 100% rename from multi_agent/README.md rename to multi_agent_researcher/README.md diff --git a/multi_agent_researcher/requirements.txt b/multi_agent_researcher/requirements.txt new file mode 100644 index 0000000..a0e8efb --- /dev/null +++ b/multi_agent_researcher/requirements.txt @@ -0,0 +1,3 @@ +streamlit +phidata +openai \ No newline at end of file diff --git a/multi_agent/research_agent.py b/multi_agent_researcher/research_agent.py similarity index 94% rename from multi_agent/research_agent.py rename to multi_agent_researcher/research_agent.py index 2be894d..a5a6fcb 100644 --- a/multi_agent/research_agent.py +++ b/multi_agent_researcher/research_agent.py @@ -6,7 +6,7 @@ from phi.llm.openai import OpenAIChat # Set up the Streamlit app st.title("Multi-Agent AI Researcher 🔍🤖") -st.caption("This app allows you to research top stories and users on HackerNews and write blog posts, reports and social posts on that.") +st.caption("This app allows you to research top stories and users on HackerNews and write blogs, reports and social posts.") # Get OpenAI API key from user openai_api_key = st.text_input("OpenAI API Key", type="password") diff --git a/web_search_ai_agent/README.md b/web_search_ai_assistant/README.md similarity index 98% rename from web_search_ai_agent/README.md rename to web_search_ai_assistant/README.md index 9d5f0c6..b31e0e7 100644 --- a/web_search_ai_agent/README.md +++ b/web_search_ai_assistant/README.md @@ -24,7 +24,7 @@ pip install -r requirements.txt 4. Run the Streamlit App ```bash -streamlit run ai_webagent.py +streamlit run ai_websearch.py ``` ### How It Works? diff --git a/web_search_ai_agent/ai_webagent.py b/web_search_ai_assistant/ai_websearch.py similarity index 89% rename from web_search_ai_agent/ai_webagent.py rename to web_search_ai_assistant/ai_websearch.py index a23fd59..aab2563 100644 --- a/web_search_ai_agent/ai_webagent.py +++ b/web_search_ai_assistant/ai_websearch.py @@ -5,8 +5,8 @@ from phi.tools.duckduckgo import DuckDuckGo from phi.llm.openai import OpenAIChat # Set up the Streamlit app -st.title("AI Search Assistant 🤖") -st.caption("This app allows you to search the web using AI") +st.title("AI Web Search Assistant 🤖") +st.caption("This app allows you to search the web using GPT-4o") # Get OpenAI API key from user openai_access_token = st.text_input("OpenAI API Key", type="password") diff --git a/web_search_ai_agent/requirements.txt b/web_search_ai_assistant/requirements.txt similarity index 100% rename from web_search_ai_agent/requirements.txt rename to web_search_ai_assistant/requirements.txt