{"id":27046784,"url":"https://github.com/wizo17/contextual_rag_application","last_synced_at":"2026-05-05T14:11:23.945Z","repository":{"id":284251349,"uuid":"954311581","full_name":"Wizo17/contextual_rag_application","owner":"Wizo17","description":"RAG Application with Contextual Retrieval and Lexical Retrieval.","archived":false,"fork":false,"pushed_at":"2025-04-02T15:42:31.000Z","size":89429,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T16:44:09.885Z","etag":null,"topics":["bm25","bm25-okapi","langchain","mlflow-tracking","openai-api","python","rag","streamlit"],"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/Wizo17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-24T22:19:03.000Z","updated_at":"2025-03-28T13:35:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ab3ffa3-2e9b-4d94-aeaf-ca4e18d373e8","html_url":"https://github.com/Wizo17/contextual_rag_application","commit_stats":null,"previous_names":["wizo17/generative_cag_application","wizo17/contextual_rag_application"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Wizo17/contextual_rag_application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wizo17%2Fcontextual_rag_application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wizo17%2Fcontextual_rag_application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wizo17%2Fcontextual_rag_application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wizo17%2Fcontextual_rag_application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wizo17","download_url":"https://codeload.github.com/Wizo17/contextual_rag_application/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wizo17%2Fcontextual_rag_application/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264390670,"owners_count":23600560,"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":["bm25","bm25-okapi","langchain","mlflow-tracking","openai-api","python","rag","streamlit"],"created_at":"2025-04-05T06:17:58.656Z","updated_at":"2025-10-16T17:19:06.490Z","avatar_url":"https://github.com/Wizo17.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Contextual Retrieval Augmented Generation Example\n\n\n## Build with\n\nThe project uses:\n* [Python](https://www.python.org/)\n* [LangChain](https://www.langchain.com/)\n* [Okapi BM25](https://fr.wikipedia.org/wiki/Okapi_BM25)\n* [FAISS](https://github.com/facebookresearch/faiss)\n* [Openai API](https://platform.openai.com/)\n* [Anthropic API](https://console.anthropic.com/)\n* [GoogleGenerativeAI API](https://aistudio.google.com/)\n* [MLFlow Tracking](https://mlflow.org/docs/latest/tracking/)\n\n\n## Architecture\n![Combine Contextual Retrieval and Reranking to maximize retrieval accuracy.](data/img/architecture.PNG)\n[https://www.anthropic.com/news/contextual-retrieval](https://www.anthropic.com/news/contextual-retrieval)\n\n## Setup\n\n### Prerequisites\n- Python 3.8+\n- pip (Python package manager)\n\n\n### Installation\n\n1. Clone this repository:\n```bash\ngit clone https://github.com/Wizo17/contextual_rag_application.git\ncd contextual_rag_application\n```\n\n2. Create a virtual environment:\n```bash\npython -m venv venv\n```\n\n3. Activate the virtual environment:\n```bash\n# Unix / MacOS\nsource venv/bin/activate\n# Windows\nvenv\\Scripts\\activate\n```\n\n4. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\u003cem\u003eIf you have some issues, use python 3.12.0 and requirements_all.txt\u003c/em\u003e\n\n\n5. Create .env file:\n```bash\ncp .env.example .env\n```\n\n6. **Update .env file**\n\n\n## Running app\n\n#### Keep or Delete and import **your own document in data/raw**\n\n#### Start mlflow if MLFLOW_ENABLE = \"yes\"\nAdapt host (MFFLOW_HOST) and port (MFFLOW_PORT)\n```bash\nmlflow server --host 127.0.0.1 --port 5000\n```\n\n#### Build index first\nIt is not necessary if you keep my docs and my indexes\nRemove all files in data/index before\n```bash\npython main.py\n```\n\n#### Test application\nUpdate queries if you don't keep my docs and my indexes\n```bash\npython test.py\n```\n\nBy launching streamlit, you can have competitive conflicts with `torch`. It is not a problem for this version.\n```bash\nstreamlit run chatbot.py\n```\n\n\n## Authors\n\n* [@wizo17](https://github.com/Wizo17)\n\n## License\n\nThis project is licensed under the ``MIT`` License - see [LICENSE](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizo17%2Fcontextual_rag_application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwizo17%2Fcontextual_rag_application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwizo17%2Fcontextual_rag_application/lists"}