{"id":21672450,"url":"https://github.com/redis-developer/llm-redisrail","last_synced_at":"2025-03-20T08:27:01.348Z","repository":{"id":223768300,"uuid":"761492254","full_name":"redis-developer/llm-redisrail","owner":"redis-developer","description":"RAG with Redis.  Parallel implementations with/without guardrails.","archived":false,"fork":false,"pushed_at":"2024-02-22T23:55:12.000Z","size":150,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-25T09:27:37.452Z","etag":null,"topics":["bots","embeddings","langchain","llm","nemo-guardrails","openai","python3","redis","vectors"],"latest_commit_sha":null,"homepage":"https://joeywhelan.blogspot.com/2024/02/redis-rag-with-nvidia-nemoguardrails.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redis-developer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-02-21T23:41:32.000Z","updated_at":"2024-12-12T15:27:37.000Z","dependencies_parsed_at":"2024-02-22T01:23:25.697Z","dependency_job_id":"3407ee6f-bdf1-43cc-b832-8dd2fdde92cf","html_url":"https://github.com/redis-developer/llm-redisrail","commit_stats":null,"previous_names":["redis-developer/llm-redisrail"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fllm-redisrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fllm-redisrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fllm-redisrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redis-developer%2Fllm-redisrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redis-developer","download_url":"https://codeload.github.com/redis-developer/llm-redisrail/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244576930,"owners_count":20475214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bots","embeddings","langchain","llm","nemo-guardrails","openai","python3","redis","vectors"],"created_at":"2024-11-25T13:29:19.575Z","updated_at":"2025-03-20T08:27:01.329Z","avatar_url":"https://github.com/redis-developer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis RAG with Rails\n## Contents\n1.  [Summary](#summary)\n2.  [Architecture](#architecture)\n3.  [Features](#features)\n4.  [Prerequisites](#prerequisites)\n5.  [Installation](#installation)\n6.  [Usage](#usage)\n\n## Summary \u003ca name=\"summary\"\u003e\u003c/a\u003e\nThis is a demo of usage of Redis as a vector store for Retrieval Augmented Generation (RAG) in two distinct scenarios:\n- Pure LangChain Expression Language (LCEL) chain with no safeguards on user or LLM interactions\n- NVIDIA NeMo-Guardrails implementation restricting both user inputs and LLM outputs\nContent from the Redis online documentation of Redis Vector Search is used for the RAG content.  For the Guardrails implementation, questions and answers are restricted to the topic of Redis Vector Search.\n\n## Architecture \u003ca name=\"architecture\"\u003e\u003c/a\u003e\n### High-level Architecture\n\n![architecture](https://docs.google.com/drawings/d/e/2PACX-1vTY5N2ZLu7fwy-DuFQ1T8Taf6r-jJOVOsKPlyC6I_dhxH5Y6A2lQsO3LaPYlsIPXmdl5kAfBQlBj3Z8/pub?w=976\u0026h=354)  \n\n### Application-level Architecture\n\n![app](https://docs.google.com/drawings/d/e/2PACX-1vQ7uH_ho38iDeOBd8YRY1ybsVqYV41CxTYs4um6t2ytdSk7kRzKiZn9R-jE8p_0ENc65QVFI4Ta82ui/pub?w=815\u0026h=713)\n \n## Features \u003ca name=\"features\"\u003e\u003c/a\u003e\n- Redis Stack for the vector store\n- Python Bot server (Chainlit)\n- LangChain implementation of RAG with Redis\n- Parallel NVIDIA NeMo-Guardrails implementation of RAG with Redis\n\n## Prerequisites \u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n- Docker\n- Docker Compose\n- python3\n- git\n- pip\n\n## Installation \u003ca name=\"installation\"\u003e\u003c/a\u003e\n```bash\ngit clone https://github.com/redis-developer/llm-redisrail.git\ncd llm-redisrail\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -qU python-dotenv redis bs4 langchain langchain_openai\n```\n- Edit the .env_template file with your OpenAI key and rename the file to .env\n- By default, the guardrailed bot is executed.  If you want a non-railed bot, change the MODE variable in docker-compose to 'chain'.\n\n## Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n### Environment Start Up\n```bash\nstart.sh\n```\n\n### Environment Shut Down\n```bash\nstop.sh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fllm-redisrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredis-developer%2Fllm-redisrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredis-developer%2Fllm-redisrail/lists"}