{"id":50574747,"url":"https://github.com/0372hoanghoccode/corag-demo","last_synced_at":"2026-06-04T21:01:11.133Z","repository":{"id":348045166,"uuid":"1195495248","full_name":"0372hoanghoccode/corag-demo","owner":"0372hoanghoccode","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-30T14:34:32.000Z","size":1147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T16:31:48.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/0372hoanghoccode.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T18:26:43.000Z","updated_at":"2026-03-30T14:34:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/0372hoanghoccode/corag-demo","commit_stats":null,"previous_names":["0372hoanghoccode/corag-demo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/0372hoanghoccode/corag-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0372hoanghoccode%2Fcorag-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0372hoanghoccode%2Fcorag-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0372hoanghoccode%2Fcorag-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0372hoanghoccode%2Fcorag-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0372hoanghoccode","download_url":"https://codeload.github.com/0372hoanghoccode/corag-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0372hoanghoccode%2Fcorag-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33917202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"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":[],"created_at":"2026-06-04T21:01:10.259Z","updated_at":"2026-06-04T21:01:11.121Z","avatar_url":"https://github.com/0372hoanghoccode.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoRAG Demo (Streamlit)\n\nA side-by-side demo for Traditional RAG vs CoRAG-style iterative retrieval.\n\nThe app now supports a compare mode that runs both approaches side by side, auto-indexes `docs/` when needed, and shows a live step-by-step CoRAG trace.\n\n## 1) Prerequisites\n\n- Windows with WSL (Ubuntu) installed\n- Python 3.10+\n- A valid API key in `.env`:\n  - `GOOGLE_API_KEY=...` or\n  - `OPENAI_API_KEY=...`\n\n## 2) Recommended run path (WSL home)\n\nUse this path for better stability than `/mnt/c`.\n\nStep A - Sync project into WSL home (one-time or when code changes):\n\nwsl bash -lc \"rm -rf ~/corag-demo; mkdir -p ~/corag-demo; rsync -av --exclude '.venv' --exclude '.venv-win' --exclude '**pycache**' --exclude 'chroma_db' /mnt/c/Users/Admin/Desktop/corag-demo/ ~/corag-demo/\"\n\nStep B - Create venv and install dependencies:\n\nwsl bash -lc \"cd ~/corag-demo; python3 -m venv .venv; source .venv/bin/activate; pip install --upgrade pip; pip install -r requirements.txt\"\n\nStep C - Run app:\n\nwsl bash -lc \"cd ~/corag-demo; source .venv/bin/activate; streamlit run app.py --server.address 0.0.0.0 --server.port 8501 --server.headless true\"\n\nOpen in browser:\n\n- http://localhost:8501\n- If localhost is unstable, use WSL IP shown in terminal, for example `http://172.x.x.x:8501`.\n\n## 3) Quick run directly from /mnt/c (alternative)\n\nwsl bash -lc \"cd /mnt/c/Users/Admin/Desktop/corag-demo; source .venv/bin/activate; streamlit run app.py --server.address 0.0.0.0 --server.port 8501 --server.headless true\"\n\n## 4) Stop stale Streamlit processes\n\nIf port 8501 is busy or app hangs:\n\nwsl bash -lc \"pkill -9 -f 'streamlit run app.py' || true; pkill -9 -f 'python3 -m streamlit' || true\"\n\n## 5) Demo flow\n\n1. Start app.\n2. Click one of the sample question buttons.\n3. Click `Chay Demo`.\n4. If no documents are indexed yet, app auto-indexes `docs/` before running.\n5. Use `Compare both` when you want a direct side-by-side comparison.\n6. CoRAG shows live retrieval steps and a short summary above the answer.\n\n### What the comparison shows\n\n- RAG: one retrieval pass, then a single answer.\n- CoRAG: iterative retrieval with up to `max_steps`, then a final answer from the accumulated context.\n- Metrics: steps, retrieved docs, latency, and simple answer coverage scores.\n\n## 6) Optional health check\n\nwsl bash -lc \"curl -sS -m 5 http://127.0.0.1:8501/_stcore/health\"\n\nExpected output:\n\nok\n\n## 7) Common issues\n\n- Missing API key:\n  - Ensure `.env` contains `GOOGLE_API_KEY` or `OPENAI_API_KEY`.\n- Port already in use:\n  - Run the stop command in section 4, then start again.\n- Localhost cannot open:\n  - Use WSL Network URL from Streamlit output.\n- No indexed docs warning:\n  - Ensure `docs/` has at least one `.txt` or `.pdf`, then click `Chay Demo` again.\n\n## 8) Notes for the current demo corpus\n\n- The `docs/` folder is intentionally structured for multi-hop retrieval.\n- Some facts are repeated across files on purpose so CoRAG can chain retrieval across hops.\n- If you update documents, rerun the app or click `Chay Demo` again so the vector store is rebuilt from the latest corpus.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0372hoanghoccode%2Fcorag-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0372hoanghoccode%2Fcorag-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0372hoanghoccode%2Fcorag-demo/lists"}