Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxpaynestory/langchain-rag-pinecone-llm-conversational-ai
A conversational bot which impersonates Aljazeera English news Channel. Scaped a few pages from Aljazeera news website and fed it to LlaMA 2 using RAG
https://github.com/maxpaynestory/langchain-rag-pinecone-llm-conversational-ai
conversational-ai langchain-python llm pinecone rag
Last synced: 14 days ago
JSON representation
A conversational bot which impersonates Aljazeera English news Channel. Scaped a few pages from Aljazeera news website and fed it to LlaMA 2 using RAG
- Host: GitHub
- URL: https://github.com/maxpaynestory/langchain-rag-pinecone-llm-conversational-ai
- Owner: maxpaynestory
- License: apache-2.0
- Created: 2023-11-08T11:06:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-06T07:40:53.000Z (about 1 year ago)
- Last Synced: 2024-11-10T04:29:04.689Z (2 months ago)
- Topics: conversational-ai, langchain-python, llm, pinecone, rag
- Language: Python
- Homepage:
- Size: 147 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**In the name of ALLAH, who has guided me to do this work**
# LangChain RAG Pinecone Conversational AI news bot.
A conversational bot which impersonates Aljazeera English news Channel. Scraped a few pages from Aljazeera news website and fed it to LlaMA 2 using RAG. Pinecone is used as vector database.![](/screenshots/who-are-you.PNG)
![](/screenshots/doing-rag-llm-predict.PNG)
![](/screenshots/llm-pinecone-working.PNG)
![](/screenshots/more-results-with-context.PNG)### 1. Download LlaMA 2 model from Hugging Face
[LlaMA 2 7b Model GGUF file](https://huggingface.co/TheBloke/Llama-2-7b-Chat-GGUF/resolve/main/llama-2-7b-chat.Q8_0.gguf) 7 GB
### 2. Place downloaded file path inside llama_cpu.py
```python
MODEL_PATH = "D:\\path\\to\\folder\\llama-2-7b-chat.Q8_0.gguf"
```### 3. Install Packages Python version is 3.9.0
```sh
$ pip install -r requirements.txt
```### 4. Setup Pinecone
Signup to Pinecone and create a index with the name ```llama7bnewsbot```. The dimensions of index are ```4096``` and metric ```euclidean```.After index is created place environment variables on your system as ```PINECONE_API_KEY``` and ```PINECONE_ENVIRONMENT```. These environment variables are used by pinecone client.
### 4. Fill Pinecone index
I have filled pinecone vector database using the news from Aljazeera channel english website. You can change the date for which you want to download the news for. To fill Pinecone database run.```python llama_cpu.py```
That will download news from website and then fill them inside Pinecone vector database.
### 5. Run server
```sh
$ uvicorn api:app
```### 6. Open frontend
Open browser and navigate to URL
http://127.0.0.1:8000/frontend/index.html
## CPU/RAM requirements
Atleast a good 6 core CPU.
12 GB of free RAM.