Skip to main content

A reusable RAG package and optional Streamlit app for academic question answering.

Project description

MAC Academy QA System

This repository now uses a src package layout so the RAG core can be published to PyPI as a reusable Python package, while the Streamlit UI remains available as an optional frontend.

What the project provides

  • A reusable allyoucanrag Python package.
  • A Streamlit QA app for course-material and user-uploaded PDF retrieval.
  • A dual-vector-store RAG workflow based on Chroma and LangChain.
  • Runtime-managed data directories for uploads, vector stores, and local config.

Important packaging note

The following runtime data is intentionally excluded from package distributions:

  • CourseMaterials/
  • UserUploads/
  • chroma_db/
  • config.json
  • .streamlit/secrets.toml

This means your course materials are treated as external runtime data, not packaged assets. That matches your PyPI goal.

Current layout

MAC-Academy-QA-System/
├── app.py
├── pyproject.toml
├── MANIFEST.in
├── requirements.txt
├── config.example.json
├── src/
│   └── allyoucanrag/
│       ├── __init__.py
│       ├── batch_upload_helper.py
│       ├── config.py
│       ├── document_manager.py
│       ├── exceptions.py
│       ├── paths.py
│       ├── rag_system.py
│       ├── streamlit_app.py
│       └── utils.py
└── CourseMaterials/

Installation

Local development

pip install -r requirements.txt

Install the package only

pip install .

Install the package with the Streamlit frontend

pip install ".[streamlit]"

After you publish to PyPI, the install command will become:

pip install "allyoucanrag[streamlit]"

The PyPI distribution name and the Python import path are both allyoucanrag.

Configuration

The package resolves API keys in this order:

  1. Streamlit secrets
  2. Environment variables
  3. config.json

Example local config.json:

{
  "OpenAIAPIKey": "your-openai-api-key",
  "LangChainAPIKey": "your-langchain-api-key"
}

Supported environment variables:

  • OPENAI_API_KEY
  • LANGCHAIN_API_KEY
  • MAC_ACADEMY_QA_HOME

If MAC_ACADEMY_QA_HOME is set, runtime directories are resolved from that base path. Otherwise the current working directory is used.

Run the Streamlit app

streamlit run app.py

Use as a package

from allyoucanrag import DualVectorStoreRAG, resolve_runtime_paths

runtime_paths = resolve_runtime_paths(base_docs_dir="D:/external-course-materials")
rag = DualVectorStoreRAG(runtime_paths=runtime_paths)
rag.initialize_base_vectorstore()
rag.initialize_user_vectorstore()

Runtime data directories

By default, the package expects these runtime paths under the active base directory:

  • CourseMaterials/
  • UserUploads/
  • chroma_db/base/
  • chroma_db/user/
  • config.json

These are not installed into site-packages and should be managed by the runtime environment.

Build distributions

python -m build --sdist --wheel

The generated files appear in dist/.

Publish checklist

  1. Choose and add a real LICENSE file.
  2. Verify README.md renders correctly on PyPI.
  3. Build with python -m build --sdist --wheel.
  4. Upload to TestPyPI first.
  5. Upload to PyPI.

Detailed release steps are in DEPLOYMENT.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allyoucanrag-0.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allyoucanrag-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file allyoucanrag-0.1.0.tar.gz.

File metadata

  • Download URL: allyoucanrag-0.1.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for allyoucanrag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 03f9d51f256944dd6bccd197812ff58572c83ef5294c644e5ea4a63976a0ecb6
MD5 667bbf7daa0441b4533aa3c911e1a8d7
BLAKE2b-256 a5a26a751b4921046bf05d53342dea72acf04e31336cbedb8a7e6e16c291637d

See more details on using hashes here.

File details

Details for the file allyoucanrag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: allyoucanrag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for allyoucanrag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8336646ac43ccf0462febf6a79c11edb66fd00f5b4154de75f859965e0ddd5c3
MD5 83333273365c773e2df55052ec14736a
BLAKE2b-256 da9d3144966bd43815c92dc7caabb3e91dcd25987f1e692a086ca369119687b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page