{"id":31693757,"url":"https://github.com/taha-kms/classmate-rag","last_synced_at":"2026-05-02T18:32:26.883Z","repository":{"id":311951623,"uuid":"1045122515","full_name":"taha-kms/CLASSMATE-RAG","owner":"taha-kms","description":"a local, multilingual (EN/IT) study assistant that indexes course materials and answers questions with citations—using multilingual-e5-base for retrieval and Llama 3.1-8B for generation. CLI-only.","archived":false,"fork":false,"pushed_at":"2025-09-27T21:07:47.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T21:08:03.999Z","etag":null,"topics":["bm25","chromadb","cli","docker","e5","information-retrieval","llama3","llm","rag","retrieval-augmented-generation"],"latest_commit_sha":null,"homepage":"","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/taha-kms.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":"2025-08-26T17:28:01.000Z","updated_at":"2025-09-27T21:07:51.000Z","dependencies_parsed_at":"2025-08-28T01:44:36.257Z","dependency_job_id":"34b43ae7-4875-44cb-b8fc-76adf83dd43c","html_url":"https://github.com/taha-kms/CLASSMATE-RAG","commit_stats":null,"previous_names":["taha-kms/classmate-rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taha-kms/CLASSMATE-RAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taha-kms%2FCLASSMATE-RAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taha-kms%2FCLASSMATE-RAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taha-kms%2FCLASSMATE-RAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taha-kms%2FCLASSMATE-RAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taha-kms","download_url":"https://codeload.github.com/taha-kms/CLASSMATE-RAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taha-kms%2FCLASSMATE-RAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278972328,"owners_count":26078017,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"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":["bm25","chromadb","cli","docker","e5","information-retrieval","llama3","llm","rag","retrieval-augmented-generation"],"created_at":"2025-10-08T15:52:59.524Z","updated_at":"2026-05-02T18:32:26.873Z","avatar_url":"https://github.com/taha-kms.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLASSMATE-RAG\n\n[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)\n[![PyTorch](https://img.shields.io/badge/PyTorch-2.0%2B-ee4c2c)](https://pytorch.org/)\n[![ChromaDB](https://img.shields.io/badge/ChromaDB-0.4%2B-brightgreen)](https://www.trychroma.com/)\n[![llama.cpp](https://img.shields.io/badge/llama.cpp--python-0.2%2B-orange)](https://github.com/abetlen/llama-cpp-python)\n[![tests](https://github.com/taha-kms/CLASSMATE-RAG/actions/workflows/tests.yml/badge.svg)](https://github.com/taha-kms/CLASSMATE-RAG/actions/workflows/tests.yml)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)\n\nA **Retrieval-Augmented Generation (RAG)** system for course materials.\nIt ingests documents (PDF, DOCX, PPTX, EPUB, HTML, CSV, TXT, MD), indexes them in **BM25** + **Chroma vector DB**, and answers questions with grounded citations using LLaMA/Mistral GGUF models.\n\n---\n\n## ✨ Features\n\n* **CLI-first workflow** (`rag` command)\n* Ingestion with metadata (course, unit, tags, language, semester, author)\n* **Hybrid retrieval** (BM25 keyword + vector embeddings, fused with RRF)\n* **Cited answers** generated with local LLMs\n* **Admin tools**: stats, preview, backup/restore, vacuum, rebuild embeddings, reingest\n* **Document loaders**: PDF, DOCX, PPTX, EPUB, HTML, CSV, TXT, Markdown\n* **Multilingual support** with E5 embeddings (`intfloat/multilingual-e5-base`)\n\n---\n\n## 📦 Installation\n\nSee [docs/installation.md](docs/installation.md) for details.\nQuick setup (Linux/macOS):\n\n```bash\n./quicksetup.sh\nsource .venv/bin/activate\nrag --help\n```\n\nWindows (PowerShell):\n\n```powershell\n.\\quicksetup.ps1\n.\\.venv\\Scripts\\Activate.ps1\nrag --help\n```\n\n---\n\n## 🚀 Usage\n\nIngest a document:\n\n```bash\nrag add path/to/file.pdf --course \"Math101\" --unit \"1\" --language \"en\" --tags exam,week1\n```\n\nAsk a question:\n\n```bash\nrag ask \"What is the chain rule?\" --course \"Math101\"\n```\n\nPreview retrieval (no generation):\n\n```bash\nrag preview \"Explain entropy\"\n```\n\nSee [docs/usage.md](docs/usage.md) for more.\n\n---\n\n## 🛠️ Maintenance\n\n* Show stats: `rag stats`\n* Backup: `rag dump --path dumps/corpus.jsonl`\n* Restore: `rag restore --path dumps/corpus.jsonl`\n* Vacuum: `rag vacuum`\n* Rebuild embeddings:\n  `rag rebuild --model intfloat/multilingual-e5-large`\n* Manage entries: `rag list`, `rag show`, `rag delete`, `rag reingest`\n\nDetails in [docs/configuration.md](docs/configuration.md).\n\n---\n\n## 📖 Documentation\n\n* [Installation](docs/installation.md)\n* [Usage](docs/usage.md)\n* [Configuration](docs/configuration.md)\n* [Architecture](docs/architecture.md)\n\n---\n\n## 📝 License\n\nCopyright (C) 2026 Taha Kamalisadeghian \u0026lt;tahakamali14@gmail.com\u0026gt;\n\nCLASSMATE-RAG is free software: you can redistribute it and/or modify it under the terms of the **GNU General Public License v3.0** as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but **WITHOUT ANY WARRANTY**; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [LICENSE](LICENSE) file for the full text, or visit \u0026lt;https://www.gnu.org/licenses/gpl-3.0.html\u0026gt;.\n\n---\n\n## 🧩 Project Structure\n\n```\ncli/             # CLI entrypoint (argparse)\nrag/             # Core RAG system\n  admin/         # Backup, restore, manage, inspect\n  chunking/      # Sentence-aware text splitting\n  embeddings/    # E5 embedder + on-disk cache\n  generation/    # llama.cpp runner, prompting, citation post-processing\n  loaders/       # File loaders (PDF, DOCX, PPTX, EPUB, HTML, CSV, TXT, MD)\n  metadata/      # DocumentMetadata schema + Pydantic CLI validation\n  pipeline/      # Ingestion + ask orchestration\n  retrieval/     # BM25, Chroma vector store, RRF hybrid fusion, neighbor expansion\n  routing/       # Hybrid subject router (math/code/translation/default) + sticky model loader\n  utils/         # Language detection, near-duplicate filtering, stable IDs\n  config.py      # Env/.env-driven configuration\n  model_fetch.py # On-demand GGUF download from HF\ndocs/            # Documentation\ntests/           # pytest suite\ntools/           # Benchmark / helper scripts\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaha-kms%2Fclassmate-rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaha-kms%2Fclassmate-rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaha-kms%2Fclassmate-rag/lists"}