Metadata-Version: 2.4
Name: studyrag
Version: 0.1.0
Summary: A private, offline study assistant: grounded Q&A with citations over your own slides, PDFs and notes (OCR included).
Author: Abubakar Idrees
License-Expression: MIT
Project-URL: Homepage, https://github.com/Abubakar-idrees-01/data-to-impact/tree/main/01-rag-from-scratch
Project-URL: Source, https://github.com/Abubakar-idrees-01/data-to-impact
Project-URL: Documentation, https://github.com/Abubakar-idrees-01/data-to-impact/blob/main/01-rag-from-scratch/docs/SETUP.md
Keywords: rag,retrieval,bm25,study,ocr,citations,llm
Classifier: Programming Language :: Python :: 3
Classifier: Intended Audience :: Education
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Text Processing :: Indexing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastembed>=0.9
Requires-Dist: rapidocr>=3.10
Requires-Dist: python-pptx>=1.0
Requires-Dist: python-docx>=1.2
Requires-Dist: pypdf>=7.1
Requires-Dist: httpx>=0.28
Requires-Dist: numpy<3,>=1.26
Provides-Extra: local-llm
Requires-Dist: llama-cpp-python>=0.3.37; extra == "local-llm"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# StudyRAG

A private study assistant that answers **only from your own course material** (slides, PDFs, Word files, notes,
even image-only slides through OCR), with a citation to the exact slide or page, and says "not in your documents"
when the answer isn't there. Everything runs on a CPU; no GPU needed.

![StudyRAG answering with citations](https://raw.githubusercontent.com/Abubakar-idrees-01/data-to-impact/main/01-rag-from-scratch/docs/images/ask.png)

```bash
pip install studyrag                      # search, citations, OCR, CLI (models download on first use)
pip install "studyrag[local-llm]"         # + local LLM answers via llama.cpp (compiles; see the setup guide)

studyrag sync ~/my-lecture-notes          # index a folder (data lives in ~/.studyrag; STUDYRAG_HOME to change)
studyrag search "porter five forces"      # ranked, cited passages
studyrag ask "What is a market space?"    # needs a local model or an OpenAI-compatible API (STUDYRAG_LLM_BACKEND=openai)
```

Built from scratch: BM25, vector search, Reciprocal Rank Fusion, cross-encoder reranking, a calibrated refusal
threshold and a sentence-level answer verifier. Measured on 77 labelled questions: the right passage in the top 3
for 100% of answerable questions, 14/14 unanswerable questions refused.

- Use it from Claude Code, Claude Desktop or Cursor with the MCP server: [`studyrag-mcp`](https://pypi.org/project/studyrag-mcp/)
- Source, Streamlit web app, results and docs: [https://github.com/Abubakar-idrees-01/data-to-impact/tree/main/01-rag-from-scratch](https://github.com/Abubakar-idrees-01/data-to-impact/tree/main/01-rag-from-scratch)
