{"id":26333036,"url":"https://github.com/astrabert/ragcoon","last_synced_at":"2025-10-25T00:45:20.088Z","repository":{"id":282282895,"uuid":"946822649","full_name":"AstraBert/ragcoon","owner":"AstraBert","description":"Agentic RAG to help you build a startup🚀","archived":false,"fork":false,"pushed_at":"2025-03-11T22:24:53.000Z","size":360,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T18:51:14.956Z","etag":null,"topics":["agentic-rag","groq","llamaindex","mesop","qdrant","qwq-32b","rag","startup"],"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/AstraBert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-11T18:20:28.000Z","updated_at":"2025-03-13T11:30:38.000Z","dependencies_parsed_at":"2025-03-13T19:02:36.561Z","dependency_job_id":null,"html_url":"https://github.com/AstraBert/ragcoon","commit_stats":null,"previous_names":["astrabert/ragcoon"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fragcoon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fragcoon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fragcoon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstraBert%2Fragcoon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstraBert","download_url":"https://codeload.github.com/AstraBert/ragcoon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806048,"owners_count":20350773,"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":["agentic-rag","groq","llamaindex","mesop","qdrant","qwq-32b","rag","startup"],"created_at":"2025-03-15T23:37:43.343Z","updated_at":"2025-10-25T00:45:19.976Z","avatar_url":"https://github.com/AstraBert.png","language":"Python","funding_links":["https://github.com/sponsors/AstraBert"],"categories":[],"sub_categories":[],"readme":"\r\n\u003ch1 align=\"center\"\u003eRAGcoon🦝\u003c/h1\u003e\r\n\r\n\u003ch2 align=\"center\"\u003eAgentic RAG to help you build your startup\u003c/h2\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003ch3\u003eIf you find RAGcoon userful, please consider to donate and support the project:\u003c/h3\u003e\r\n    \u003ca href=\"https://github.com/sponsors/AstraBert\"\u003e\u003cimg src=\"https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA\" alt=\"GitHub Sponsors Badge\"\u003e\u003c/a\u003e\r\n\u003c/div\u003e\r\n\u003cbr\u003e\r\n\u003cdiv align=\"center\"\u003e\r\n    \u003cimg src=\"logo.png\" alt=\"ragcoon Logo\" width=200 height=200\u003e\r\n\u003c/div\u003e\r\n\r\n## Install and launch🚀\r\n\r\nThe first step, common to both the Docker and the source code setup approaches, is to clone the repository and access it:\r\n\r\n```bash\r\ngit clone https://github.com/AstraBert/ragcoon.git\r\n```\r\nOnce there, you can choose one of the two following approaches:\r\n\r\n### Docker (recommended)🐋\r\n\r\n\u003e _Required: [Docker](https://docs.docker.com/desktop/) and [docker compose](https://docs.docker.com/compose/)_\r\n\r\n- Add the `groq_api_key` in the [`.env.example`](.env.example)file and modify the name of the file to `.env`. Get this key:\r\n\r\n    + [On Groq Console](https://console.groq.com/keys)\r\n\r\n```bash\r\nmv .env.example .env\r\n```\r\n\r\n- Launch the Docker application:\r\n\r\n```bash\r\n# If you are on Linux/macOS\r\nbash start_services.sh\r\n# If you are on Windows\r\n.\\start_services.ps1\r\n```\r\n\r\nOr, if you prefer:\r\n\r\n```bash\r\ndocker compose up qdrant -d\r\ndocker compose up frontend -d\r\ndocker compose up backend -d\r\n```\r\n\r\nYou will see the frontend application running on `http://localhost:8001`/ and you will be able to use it. Depending on your connection and on your hardware, the set up might take some time (up to 30 mins to set up) - but this is only for the first time your run it!\r\n\r\n### Source code🖥️\r\n\r\n\u003e _Required: [Docker](https://docs.docker.com/desktop/), [docker compose](https://docs.docker.com/compose/) and [conda](https://anaconda.org/anaconda/conda)_\r\n\r\n- Add the `groq_api_key` in the [`.env.example`](.env.example)file and modify the name of the file to `.env` in the `scripts` folder. Get this key:\r\n    + [On Groq Console](https://console.groq.com/keys)\r\n\r\n```bash\r\nmv .env.example scripts/.env\r\n```\r\n\r\n- Set up RAGcoon using the dedicated script:\r\n\r\n```bash\r\n# For MacOs/Linux users\r\nbash setup.sh\r\n# For Windows users\r\n.\\setup.ps1\r\n```\r\n\r\n- Or you can do it manually, if you prefer:\r\n\r\n```bash\r\ndocker compose up qdrant -d\r\nconda env create -f environment.yml\r\nconda activate ragcoon\r\n```\r\n\r\n- Now launch the frontend application\r\n\r\n```bash\r\ngunicorn frontend:me --bind 0.0.0.0:8001\r\n```\r\n\r\n- And then, from another terminal window, go into `scripts` and launch the backend:\r\n\r\n```bash\r\nuvicorn main:app --host 0.0.0.0 --port 8000\r\n```\r\n\r\nYou will see the application running on `http://localhost:8001` and you will be able to use it.\r\n\r\n## How it works\r\n\r\n![Workflow](workflow.png)\r\n\r\nThe main workflow is handled by a Query Agent, built upon the ReAct architecture. The agent exploits, as a base LLM, the latest reasoning model by Qwen, i.e. [`QwQ-32B`](https://console.groq.com/docs/model/qwen-qwq-32b), provisioned by [Groq](https://groq.com/).\r\n\r\n1. The question coming from the frontend (developed with [Mesop](https://google.github.io/mesop/) - running on `http://localhost:8001`) is sent into a POST request to the [FastAPI](https://fastapi.tiangolo.com/)-managed API endpoint on `http://localhost:8000/chat`.\r\n2. When the Agent is prompted with the user's question, it tries to retrieved relevant context routing the query to one of three query engines:\r\n    - If the query is simple and specific, it goes for a direct hybrid retrieval, exploiting both a dense ([`Alibaba-NLP/gte-modernbert-base`](https://huggingface.co/Alibaba-NLP/gte-modernbert-base)) and a sparse ([`Qdrant/bm25`](https://huggingface.co/Qdrant/bm25)) retriever\r\n    - If the query is general and vague, it first creates an hypothetical document, which is embedded and used for retrieval\r\n    - If the query is complex and involves searching for nested information, the query is decomposed into several sub-queries, and the retrieval is performed for all of them, with a summarization step in the end\r\n3. The agent evaluates the context using [`llama-3.3-70B-versatile`](https://github.com/meta-llama/llama-models/blob/main/models/llama3_3/MODEL_CARD.md), provisioned through Groq. If the context is deemed relevant, the Agent proceeds, otherwise it goes back to retrieval, trying a different method.\r\n4. The agent produces a candidate answer\r\n5. The agent evaluates the faithfulness and relevancy of the candidate response, in light of the retrieved context, using [LlamaIndex evaluation methods](https://docs.llamaindex.ai/en/stable/module_guides/evaluating/)\r\n6. If the response is faithful and relevant, the agent returns the response, otherwise it gets back at generating a new one.\r\n \r\n## Contributing\r\n\r\nContributions are always welcome! Follow the contributions guidelines reported [here](CONTRIBUTING.md).\r\n\r\n## License and rights of usage\r\n\r\nThe software is provided under MIT [license](./LICENSE).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fragcoon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrabert%2Fragcoon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrabert%2Fragcoon/lists"}