https://github.com/swamikannan/retrieval-augmented-generation-rag-learning-llamaindex-from-llamaindex
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/swamikannan/retrieval-augmented-generation-rag-learning-llamaindex-from-llamaindex
- Owner: SwamiKannan
- License: mit
- Created: 2024-01-28T07:25:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-06T17:17:12.000Z (over 1 year ago)
- Last Synced: 2025-03-03T16:48:19.002Z (7 months ago)
- Language: HTML
- Size: 8.22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Learn LlamaIndex using a LlamaIndex helper
![]()
## Introduction
I was trying to learn LlamaIndex and was getting a little frustrated by the syntax since it was different from LangChain (with storage context and service context). Hence, to start it off, I decided to first build a RAG and a chat assistant that helps me navigate the documentation.
## Requirements
Running this code as-is will require you to have an OpenAI account and an API key.
### Get OpenAI key
After creating an account here , get your API key as described here
### Store the OpenAI key in the env file
1. Create a text file using Notepad and name it ".env"
2. Open it and enter:
```
OPENAI_API_KEY=
```
3. Save it in the src folder
4. The code will automatically pick up the API key when running#### Note: Please do not share this API key with anyone. They will directly be able to use your account and your credits for their usage.
## Usage
### 1. Scraping the LlamaIndex website
```
cd src
python scrape_json.py
```### 2. Ingest the data into a vectordb:
There are three vectordbs that you can use for storing your embeddings:
a. Milvus
```
python ingestion-milvus.py
```
b.Pinecone
```
python ingestion-pinecone.py
```
c. Chromadb (Rest of the process is based on Chromadb"
```
python ingestion.py
```
### 3. Querying the vectordb
There are two ways to query the database]
#### Main.py#### Using the app
```
streamlit app.py
```
## Demo
https://github.com/SwamiKannan/Learning-LlamaIndex-from-LlamaIndex/assets/65940566/d6ba5aae-45f6-4847-bf7e-89d0c332de96
Image credit:
Segmind
Prompt: cinematic film still, 4k, realistic, ((cinematic photo:1.3)) of a person being overwhelmed walking through an infinite hallway of a digital library and looking at documentation, Fujifilm XT3, long shot, ((low light:1.4)), wide angle lens, landscape perspective, neon, somber, shallow depth of field, vignette, highly detailed, high budget Hollywood movie, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy