This repository contains all the work done on the development of RAG applications using:
- Oracle AI Vector Search
- Oracle OCI GenAI Service
- Oracle OCI Embeddings
- Cohere Reranking
- Reranker models deployed in OCI Data Science
- OCI ADS 2.10.0 (with support for OCI GenAI)
- llama-index
In the Video demos section of the Wiki you'll find some video of the demo.
A very good introduction to what Retrieval Augmented Generation (RAG) is can be found here
- basic (12/2023) integration between Oracle DB Vector Store (23c) and llama-index
- All documents stored in an Oracle AI Vector Search
- Oracle AI Vector Search used for Semantic Search
- Reranking to improve retrieval
- How to show references (documents used for the response generation)
- (30/12/2023) Added reranker implemented as OCI Model Deployment
- (20/01/2024) Added implementation of Vector Store for LangChain and demo
- Using vector to find duplicates in the documentation
- (2/03/2024) Added Phoenix Traces for observability
- (25/3/2024) This is the code for LlamaIndex 0.10+
- demo1 This NB shows how you get answers to questions on Oracle Database and new features in 23c, using Oracler AI Vector Search
- Knowledge assistant full demo
See the wiki pages.
- You can use the create_save_embeddings Python program to load all the data in the Oracle DB schema.
- You can launch it using the script load_books.
- Files to be loaded are contained in the dir specified in the file config.py
You need to have pdf files in the same directory.
- OCI 2.126.1
- OCI ADS 2.11.3
- LangChain 0.1.12
- LangChain Community 0.0.28
- Llama-index 0.1.19
- Oracle Database 23c (23.4) Enterprise Edition with AI Vector Search
You can install a complete Python environment using the instructions in the *Setup section of the Wiki.
- OCI Python SDK
- OCI ADS
- oracledb
- Streamlit
- Llama-index
- LangChain
- Arize-AI/phoenix for Observability and Tracing
One of the key pieces in a RAG solution is the Retrieval module. To use the AI DB Vector Store you need an Embeddings Model: a model that does the magic of transforming text in vectors, capturing the content and the semantic of the text. The Embeddings Model used in these demos is Cohere Embeds V3, provided from OCI GenAI service.
With few changes, you can switch to use any Open Source model. But you need to have the computational power (GPU) to run it.
(02/03/2024) Added integration with Arize Phoenix (Phoenix traces).
To enable tracing you must set ADD_PHX_TRACING = True, in config.py
In case of troubles with installing Phoenix a quick solution is to disable it.
In the module prepare_chain_4_chat are defined the factory methods to create: embeddings, llm, reranker...
The philosophy is to make things simpler. So all the configuration are taken from config.py.
If you want to change the llm, (or anything else) go to config.py. No params in the NBs