sliderag turns a slide deck and a reference textbook into a long-form latex chapter.
the idea is simple:
- slides give the structure
- the textbook gives the factual grounding
- the generator expands short bullet points into readable textbook prose
the output is not a summary. it is a chapter-writing pipeline built for producing detailed course material from sparse lecture slides.
sliderag runs a rolling-context rag pipeline:
- it reads a textbook pdf and stores chunked embeddings in chromadb
- it reads a slide deck pdf and converts it into structured json
- for each slide, or batch of slides, it retrieves relevant textbook context
- it feeds the slide content, retrieved context, and recent generated output into an llm
- it writes latex incrementally so long runs can resume after interruption
the result is a latex textbook chapter that follows the slide sequence but has much more depth, continuity, and explanation than the slides alone.
sliderag is useful when you have:
- lecture slides that are too brief to stand alone
- a textbook or reference pdf that contains the missing detail
- a need to produce notes, chapters, or expanded course handouts in latex
it is not a general chatbot app. it is a document-generation pipeline with a specific input shape and a specific output target.
sliderag supports two generation backends:
use this when you want local inference or a remote machine you control.
- backend: local ollama api
- good for: private runs, local experimentation, controlled environments
- requirements: ollama running with a compatible model
example:
ollama serve &
ollama pull deepseek-r1:32b
python -m sliderag generate --backend ollama -- --slides runs/course/slides.jsonuse this when you want browser-driven generation through the gemini web app.
- backend: gemini in a persistent chromium profile
- good for: avoiding local inference setup, using gemini through a saved session
- requirements: playwright, chromium, and a working google login
example:
python -m sliderag gemini-login
python -m sliderag generate --backend gemini -- --slides runs/course/slides.jsonmore detail:
pip install -r requirements.txtfor the gemini backend:
playwright install chromiumingest the reference textbook into chromadb:
python -m sliderag setup-rag -- \
--pdf data/input/textbook.pdf \
--db-path data/indexes/chroma_dbextract slide titles and content into structured json:
python -m sliderag parse-slides -- \
--pdf data/input/slides.pdf \
--output runs/course/slides.jsonwith ollama:
python -m sliderag generate --backend ollama -- \
--slides runs/course/slides.json \
--db-path data/indexes/chroma_db \
--output runs/course/output.tex \
--model deepseek-r1:32bwith gemini:
python -m sliderag generate --backend gemini -- \
--slides runs/course/slides.json \
--db-path data/indexes/chroma_db \
--output runs/course/output.tex \
--batch-size 5 \
--browser-profile data/profiles/gemini_browser_profilethe main entrypoint is:
python -m slideragavailable commands:
python -m sliderag help generate
python -m sliderag parse-slides -- --pdf slides.pdf
python -m sliderag setup-rag -- --pdf textbook.pdf
python -m sliderag generate --backend ollama -- --slides slides.json
python -m sliderag generate --backend gemini -- --slides slides.json
python -m sliderag gemini-login
python -m sliderag gemini-diagnosethe -- separator passes the remaining flags directly to the underlying module.
recommended layout:
data/
├── input/
│ ├── slides.pdf
│ └── textbook.pdf
├── indexes/
│ └── chroma_db/
└── profiles/
└── gemini_browser_profile/
runs/
└── course-name/
├── slides.json
├── output.tex
└── output.progress.json
main generated artifact:
output.tex: the generated chapter in latex
other runtime artifacts:
slides.json: parsed slides*.progress.json: resume statechroma_db/: vector indexgemini_browser_profile/: persistent browser session for gemini
the old entrypoints still work:
python main_agent.py
python gemini_agent.py --login
python parse_slides.py --pdf slides.pdf
python setup_rag.py --pdf textbook.pdfthe embedding stack currently expects numpy<2, and requirements.txt pins that. if your environment already has numpy 2 with older compiled ml wheels, rebuild the venv before running setup-rag.