Unlock the potential of advanced AI-driven knowledge management and exploration with GenAI Demos. This repository offers a comprehensive suite of tools and functionalities to empower users in their data handling and interaction endeavors. From seamless RAG storage administration to dynamic LLM interactions, GenAI Demos provides a platform for efficient data insertion, retrieval, and contextual understanding. Explore the capabilities of legacy and RAG LLM runners, and witness the power of AI agents executing complex tasks with ease. Get started now and embark on a journey of AI-driven knowledge exploration like never before!
Install requirements
pip install -r requirements.txt
cd project/frontend
streamlit run Hello.py
- OpenAI key to run the agent
If you don't have an OpenAI key you can set it up & running using Ollama mistral, just set the env llm_impl=ollama_mistral
I have provided files dot_env_template. Those files are just placeholder for a .env file that will contain your keys. Just:
mv dot_env_template .env
There is a docker-compose that will set up a postgres in local, just:
docker-compose -f docker-compose-pgvector up -d
Note that this file contains the settings of your db parameters, if you want to change them edit the environment variables specified in this compose file
- RAG storage administration panel 2. insert in RAG storage 3. read all from RAG storage 4. semantic query
- Legacy LLM runner 6. ask something to an LLM (general purpose knowledge)
- RAG LLM runner 8. ask something to an LLM (with RAG documents as context)
- OpenAI Agent runner 10. run an agent demo and see the intermediate steps
The model strategy is programmed by setting a value to the llm_impl environment
variable of the llm_service package.
The supported models are:
- llm_impl=openai (OpenAI)
- llm_impl=azure_openai (AzureOpenAI)
- llm_impl=ollama_mistral (MistralAI from Ollama in local)
The model strategy is programmed by setting a value to the embeddings_model_impl environment
variable of the rag_service package.
The supported models are:
- embeddings_model_impl=openai_embeddings (OpenAI Embeddings Model)
- embeddings_model_impl=azure_openai_embeddings (AzureOpenAI Embeddings Model)
- embeddings_model_impl=ollama_mistral (MistralAI Embeddings Model from Ollama in local)
You can read all from your RAG storage:
You can insert into RAG storage:
Here you run an LLM in legacy mode (without RAG, so he won't be aware of specific domain data)
Works, but if we ask him about me...
meh, general purpose I guess :/
Here you can run LLM in RAG mode. He selects a context before responding.
The context is selected using a semantic search against the RAG storage:
Here you can run an agent that has access to a demo set of tools: An agent is backed by an LLM (OpenAI in this case), and he is an entity that, given a question decides what is the next step that can lead to the final answer; for example we have:
- a tool that is able to sum 2 numbers
- a tool that is able to make a browser search
- a tool that is able to feed our RAG storage
If we ask him: "What is the age of Barak Obama? What is the age of his wife? Sum the two ages and remember the result" An agent thinks: ...mmmm ok, I have to search on the browser for the age of Obama, then search for the age of his wife, call the tool I have to sum the two ages and call the tool I have to insert this information in "my knowledge" (my RAG)
we've got our answer! We can even see what are the intermediate steps he decided to do:
this means that he inserted this information in his knowledge as well, let's check by running a semantic query to the RAG storage: