100+ AI Agents, Agent Skills and RAG Apps - Free and Open Source.
Added new demo
ShubhamSaboo489a9e6421b9
diff --git a/.DS_Store b/.DS_Storenew file mode 100644index 00000000..d5da7f70Binary files /dev/null and b/.DS_Store differdiff --git a/README.md b/README.mdindex d9cb6ab7..ee058db4 100644--- a/README.md+++ b/README.md@@ -18,6 +18,9 @@ A curated collection of awesome LLM apps using RAG with OpenAI, Anthropic, Gemin## π Projects+## π» Local Lllama-3 with RAG+Streamlit app that allows you to chat with any webpage using local Llama-3 and Retrieval Augmented Generation (RAG). This app runs entirely on your computer, making it 100% free and without the need for an internet connection.+### π¨ Chat with GmailInteract 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).diff --git a/chat_with_pdf/.DS_Store b/chat_with_pdf/.DS_Storenew file mode 100644index 00000000..89fbf5feBinary files /dev/null and b/chat_with_pdf/.DS_Store differdiff --git a/llama3_local_rag/README.md b/llama3_local_rag/README.mdnew file mode 100644index 00000000..e2201494--- /dev/null+++ b/llama3_local_rag/README.md@@ -0,0 +1,38 @@+## π» Local Lllama-3 with RAG+Streamlit app that allows you to chat with any webpage using local Llama-3 and Retrieval Augmented Generation (RAG). This app runs entirely on your computer, making it 100% free and without the need for an internet connection.+++### Features+- Input a webpage URL+- Ask questions about the content of the webpage+- Get accurate answers using RAG and the Llama-3 model running locally on your computer++### 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 llama3_local_rag.py+```++### How it Works?++- The app loads the webpage data using WebBaseLoader and splits it into chunks using RecursiveCharacterTextSplitter.+- It creates Ollama embeddings and a vector store using Chroma.+- The app sets up a RAG (Retrieval-Augmented Generation) chain, which retrieves relevant documents based on the user's question.+- The Llama-3 model is called to generate an answer using the retrieved context.+- The app displays the answer to the user's question.+diff --git a/llama3_local_rag/llama3_local_rag.py b/llama3_local_rag/llama3_local_rag.pynew file mode 100644index 00000000..6ae0e642--- /dev/null+++ b/llama3_local_rag/llama3_local_rag.py@@ -0,0 +1,50 @@+import streamlit as st+import ollama+from langchain.text_splitter import RecursiveCharacterTextSplitter+from langchain_community.document_loaders import WebBaseLoader+from langchain_community.vectorstores import Chroma+from langchain_community.embeddings import OllamaEmbeddings++st.title("Chat with Webpage π")+st.caption("This app allows you to chat with a webpage using local llama3 and RAG")++# Get the webpage URL from the user+webpage_url = st.text_input("Enter Webpage URL", type="default")++if webpage_url:+ # 1. Load the data+ loader = WebBaseLoader(webpage_url)+ docs = loader.load()+ text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=10)+ splits = text_splitter.split_documents(docs)++ # 2. Create Ollama embeddings and vector store+ embeddings = OllamaEmbeddings(model="llama3")+ vectorstore = Chroma.from_documents(documents=splits, embedding=embeddings)++ # 3. Call Ollama Llama3 model+ def ollama_llm(question, context):+ formatted_prompt = f"Question: {question}\n\nContext: {context}"+ response = ollama.chat(model='llama3', messages=[{'role': 'user', 'content': formatted_prompt}])+ return response['message']['content']++ # 4. RAG Setup+ retriever = vectorstore.as_retriever()++ def combine_docs(docs):+ return "\n\n".join(doc.page_content for doc in docs)++ def rag_chain(question):+ retrieved_docs = retriever.invoke(question)+ formatted_context = combine_docs(retrieved_docs)+ return ollama_llm(question, formatted_context)++ st.success(f"Loaded {webpage_url} successfully!")++ # Ask a question about the webpage+ prompt = st.text_input("Ask any question about the webpage")++ # Chat with the webpage+ if prompt:+ result = rag_chain(prompt)+ st.write(result)\ No newline at end of filediff --git a/llama3_local_rag/requirements.txt b/llama3_local_rag/requirements.txtnew file mode 100644index 00000000..28244304--- /dev/null+++ b/llama3_local_rag/requirements.txt@@ -0,0 +1,4 @@+streamlit+ollama+langchain+langchain_community\ No newline at end of file