{"id":26541375,"url":"https://github.com/laolarou726/rag_demo","last_synced_at":"2025-03-22T01:20:19.037Z","repository":{"id":282949359,"uuid":"950197082","full_name":"laolarou726/RAG_Demo","owner":"laolarou726","description":"This is a minimal demo project to show the capabilities of a RAG system using LangChain and Milvus, it contains all the things you required to build a basic RAG system.","archived":false,"fork":false,"pushed_at":"2025-03-17T20:31:46.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T20:35:13.321Z","etag":null,"topics":["demo","knowledge-base","langchain","llm","mark","milvus","minimal","ollama","pdf","plain","python","rag","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laolarou726.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":"2025-03-17T19:29:14.000Z","updated_at":"2025-03-17T20:31:49.000Z","dependencies_parsed_at":"2025-03-17T20:48:18.564Z","dependency_job_id":null,"html_url":"https://github.com/laolarou726/RAG_Demo","commit_stats":null,"previous_names":["laolarou726/rag_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laolarou726%2FRAG_Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laolarou726%2FRAG_Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laolarou726%2FRAG_Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laolarou726%2FRAG_Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laolarou726","download_url":"https://codeload.github.com/laolarou726/RAG_Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890820,"owners_count":20527153,"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":["demo","knowledge-base","langchain","llm","mark","milvus","minimal","ollama","pdf","plain","python","rag","vector-database"],"created_at":"2025-03-22T01:20:17.344Z","updated_at":"2025-03-22T01:20:19.032Z","avatar_url":"https://github.com/laolarou726.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RAG DEMO\n\n![GitHub](https://img.shields.io/github/license/laolarou726/RAG_Demo?logo=github\u0026style=for-the-badge)\n![Maintenance](https://img.shields.io/maintenance/yes/2025?logo=diaspora\u0026style=for-the-badge)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/laolarou726/RAG_Demo?style=for-the-badge)\n![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/laolarou726/RAG_Demo?logo=github\u0026style=for-the-badge)\n![GitHub repo size](https://img.shields.io/github/repo-size/laolarou726/RAG_Demo?logo=github\u0026style=for-the-badge)\n\nThis is a minimal demo project to show the capabilities of a RAG system using `LangChain` and `Milvus`, it contains all the things you required to build a basic RAG system.\n\n## Before Start\n\nFirst, make a copy of `.env.sample` and rename it to `.env`, and change any fields need to be changed\n\nThen:\n\n1. Setup the `Milvus` as the vector database\n   1. See folder `Milvus`\n2. Setup the `Ollama` for the document tokenization and interaction\n   1. See [Setup - OllamaEmbeddings](https://python.langchain.com/docs/integrations/text_embedding/ollama/)\n   2. See [Ollama](https://ollama.com/)\n3. Prep the documents used for RAG and the vector DB\n4. Copy all the documents to the `Documents` folder under the project root\n5. Run `python prep_doc.py` to prepare the documents for the RAG system\n6. You can run `python milvus_search.py` to verify all the documents has been loaded to the vector DB\n\n## Start the demo\n\nRun `python main.py` and type anything you want to ask the RAG system\n\n## Screenshots\n\n### Ask RAG a random question\n\n![a2f22b53e37ee6fb92e43bd67d735e20](https://github.com/user-attachments/assets/bfc7f3e0-bea7-4b3f-9f1f-855f4b78c1fa)\n\n### Vector Database\n\n![fb20250642869db7e0e8dd406774fdd3](https://github.com/user-attachments/assets/e8649171-8950-4693-b2d8-02e4d1cbc72b)\n![680b5c08190bfca80f51d1aeef6edff9](https://github.com/user-attachments/assets/af31f243-6b4f-4763-9e63-b0e53f2efc75)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaolarou726%2Frag_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaolarou726%2Frag_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaolarou726%2Frag_demo/lists"}