{"id":29625309,"url":"https://github.com/leo-capvano/generative_ai_demos","last_synced_at":"2026-04-02T03:08:52.068Z","repository":{"id":228468413,"uuid":"770630720","full_name":"leo-capvano/generative_ai_demos","owner":"leo-capvano","description":"Generative AI demos, an example of a langchain based application that implements Retrieval-Augmented-Generation for an enhanced generation. It uses OpenAI model and OpenAI function tool agent. Able to run Ollama Mistral local LLM too.","archived":false,"fork":false,"pushed_at":"2024-03-26T20:09:41.000Z","size":636,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T13:58:50.300Z","etag":null,"topics":["brave","custom-tools","fastapi","langchain","langchain-agent","langchain-chains","langchain-pyth","langchain-tool","langchain-tools","mistral","ollama","openai","pgvector","rag","semantic-search","streamlit"],"latest_commit_sha":null,"homepage":"https://github.com/leo-capvano/generative_ai_demos","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leo-capvano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-11T22:01:00.000Z","updated_at":"2025-06-29T22:06:35.000Z","dependencies_parsed_at":"2024-03-19T00:23:13.202Z","dependency_job_id":"af0ec84e-61b8-491a-8f84-e97f11153a57","html_url":"https://github.com/leo-capvano/generative_ai_demos","commit_stats":null,"previous_names":["leo-capvano/generative_ai_demos"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leo-capvano/generative_ai_demos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-capvano%2Fgenerative_ai_demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-capvano%2Fgenerative_ai_demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-capvano%2Fgenerative_ai_demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-capvano%2Fgenerative_ai_demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leo-capvano","download_url":"https://codeload.github.com/leo-capvano/generative_ai_demos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leo-capvano%2Fgenerative_ai_demos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31294873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T01:43:37.129Z","status":"online","status_checked_at":"2026-04-02T02:00:08.535Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brave","custom-tools","fastapi","langchain","langchain-agent","langchain-chains","langchain-pyth","langchain-tool","langchain-tools","mistral","ollama","openai","pgvector","rag","semantic-search","streamlit"],"created_at":"2025-07-21T06:35:35.056Z","updated_at":"2026-04-02T03:08:52.040Z","avatar_url":"https://github.com/leo-capvano.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GenAI Demos\n\nUnlock the potential of advanced AI-driven knowledge management and exploration\nwith GenAI Demos. This repository offers a comprehensive suite of tools and \nfunctionalities to empower users in their data handling and interaction endeavors.\nFrom seamless RAG storage administration to dynamic LLM interactions, GenAI\nDemos provides a platform for efficient data insertion, retrieval, and contextual\nunderstanding. Explore the capabilities of legacy and RAG LLM runners, and witness\nthe power of AI agents executing complex tasks with ease. Get started \nnow and embark on a journey of AI-driven knowledge exploration like never before!\n\n## Set - Up\nInstall requirements\n\u003e pip install -r requirements.txt  \n\u003e cd project/frontend  \n\u003e streamlit run Hello.py\n\n### External Resourced\n- OpenAI key to run the agent  \nIf you don't have an OpenAI key you can set it up \u0026 running using Ollama mistral, just set the env _**llm_impl=ollama_mistral**_\n\n### Environment Variables\nI have provided files **dot_env_template**. Those files are just placeholder for a .env file that will contain your keys. Just:\n\u003e mv dot_env_template .env\n\n### Vector Store (RAG storage)\nThere is a docker-compose that will set up a postgres in local, just:\n\u003e docker-compose -f docker-compose-pgvector up -d   \n\nNote that this file contains the settings of your db parameters, if you want to change them edit the environment variables specified in \nthis compose file\n\n## What You can do?\n\u003e 1. RAG storage administration panel\n\u003e    2. insert in RAG storage\n\u003e    3. read all from RAG storage\n\u003e    4. semantic query \n\u003e 5. Legacy LLM runner\n\u003e    6. ask something to an LLM (general purpose knowledge)\n\u003e 7. RAG LLM runner\n\u003e    8. ask something to an LLM (with RAG documents as context)\n\u003e 9. OpenAI Agent runner\n\u003e    10. run an agent demo and see the intermediate steps\n\n# Supported models\nThe model strategy is programmed by setting a value to the **llm_impl** environment\nvariable of the **llm_service** package.  \nThe supported models are:\n- llm_impl=openai (**OpenAI**)\n- llm_impl=azure_openai (**AzureOpenAI**)\n- llm_impl=ollama_mistral (**MistralAI from Ollama in local**)\n\n# Supported embeddings models\nThe model strategy is programmed by setting a value to the **embeddings_model_impl** environment\nvariable of the **rag_service** package.  \nThe supported models are:\n- embeddings_model_impl=openai_embeddings (**OpenAI Embeddings Model**)\n- embeddings_model_impl=azure_openai_embeddings (**AzureOpenAI Embeddings Model**)\n- embeddings_model_impl=ollama_mistral (**MistralAI Embeddings Model from Ollama in local**)\n\n## RAG storage admin panel\nThis is the RAG admin panel:  \n![img.png](res/images/img.png)\n\nYou can read all from your RAG storage:  \n![img_1.png](res/images/img_1.png)\n\nYou can insert into RAG storage:  \n![img_2.png](res/images/img_2.png)\n\nYou can run a semantic query:  \n![img_3.png](res/images/img_3.png)\n\n## Legacy LLM runner\nHere you run an LLM in legacy mode (without RAG, so he won't be aware of specific domain data)  \n![img_4.png](res/images/img_4.png)\n\nWorks, but if we ask him about me...  \n![img_5.png](res/images/img_5.png)\nmeh, general purpose I guess :/  \n\n## RAG LLM runner\nHere you can run LLM in RAG mode. He selects a context before responding. \nThe context is selected using a semantic search against the RAG storage:  \n![img_6.png](res/images/img_6.png)\n\n## OpenAI Agent runner\nHere you can run an agent that has access to a demo set of tools:\n![img_7.png](res/images/img_7.png)\nAn agent is backed by an LLM (OpenAI in this case), and he is an entity that, given a question\ndecides what is the next step that can lead to the final answer;\nfor example we have:\n- a tool that is able to sum 2 numbers\n- a tool that is able to make a browser search\n- a tool that is able to feed our RAG storage\n\nIf 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\"\nAn agent thinks:\n...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 \nsum the two ages and call the tool I have to insert this information in \"my knowledge\" (my RAG)\n\nLet's see:\n![img_8.png](res/images/img_8.png)\n\nwe've got our answer! We can even see what are the intermediate steps he decided to do:\n![img_9.png](res/images/img_9.png)\n\nthis means that he inserted this information in his knowledge as well, let's check by running a semantic query to the RAG storage:\n![img_10.png](res/images/img_10.png)\n\n# Architecture\n## General\n![general_arch.png](res/images/general_arch.png)\n## LLM service [Legacy]\n![llm_legacy.png](res/images/llm_legacy.png)\n## LLM service [RAG]\n![llm_rag.png](res/images/llm_rag.png)\n## OpenAI Agent\n![agent.png](res/images/agent.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-capvano%2Fgenerative_ai_demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleo-capvano%2Fgenerative_ai_demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleo-capvano%2Fgenerative_ai_demos/lists"}