This repository demonstrates how to build a Retrieval-Augmented Generation (RAG) system using Cohere's API to enhance conversational AI. The system integrates external knowledge sources to provide relevant responses to user queries.
OCI Vault(OCID of this resource) created with the admin password for the ADB in a secret. Proper IAM permission set to access the Vault.(Password must start with a letter, be 12 characters long, conatin at least one upper case letter and two digits and no special characters)
Deploy the infrastructure necessary to run this example in OCI by using the following git repo: https://github.com/dranicu/terraform-oke-ora23ai.git.
- Use the link output provided by the stack in the instalation step to access the JupyterHUB.
- Go to "examples" folder
- In the ora23ai_connection.py file use the ocids of the vault secret where you stored the ADMIN password for ADB and the ocid of the ADB(MARKED WITH )
- Run the cohere-rag-ora23ai-chatbot.ipynb. Shift+Enter on each section to avoid any errors.
- Once the Gradio interface is up and running, paste your cohere api key in the llm and embedding sections
- Upload a file and create a vector store.
- Load the cohere LLM model and ask any question from the files you uploaded.
cohere-rag-ora23ai-chatbot.ipynb: Contains the chatbot implementation.ora23ai_connection.py: Manages the connection to Oracle 23 AI services.ora23ai_gradio_chatbot.py: Gradio interface for user interaction.ora23ai_model_index.py: Handles model indexing.ora23ai_model_utils.py: Utility functions for model management.
The project relies on the following dependencies listed in requirements.txt:
- cohere
- gradio
- python-dotenv
- other necessary libraries.
Install them using:
pip install -r requirements.txt
This project is licensed under the Apache-2.0 License. See the LICENSE file for more details.
Contributions are welcome! Feel free to open a pull request or issue for bug fixes, features, or improvements.
Special thanks to: