Spaces:
Running on Zero
Running on Zero
title: Lesson Agent
emoji: π colorFrom: blue colorTo: green sdk: docker app_port: 7860 pinned: false license: apache-2.0
Lesson Agent
Backyard AI Gradio Space for the Build Small Hackathon.
A local skill-based agent helps a teacher you know turn a topic + grade level into a downloadable PowerPoint β powered by a small transformers model (MiniCPM5-1B by default), no cloud LLM API.
See USAGE.md for local run, Docker smoke test, and HF Space deployment.
Prerequisites
- uv
- Python 3.12
Quick start
uv sync --all-packages
cp .env.example .env # optional: edit model settings
# Run Gradio locally
uv run --package gradio-space python -m gradio_space.app
Open http://localhost:7860.
- Lesson slides β topic, grade, slide count β downloadable PowerPoint
- Research Agent β scrape/index sources into MemRAG, then ask questions offline with citations
How it works
- Skill β
skills/education-pptx/SKILL.md(Hermes / agentskills.io format) - LLM β local model drafts a JSON slide outline
- Tool β
create_pptxbuilds the file withpython-pptx - Trace β JSON log saved under
outputs/traces/for the Sharing is Caring badge
apps/gradio-space/ # Gradio tabs (Lesson slides, Research Agent, Chat debug)
libs/agent/ # Skill agent runner, tools, trace recorder
libs/researchmind/ # Scraper, chunk/embed, MemRAG SQLite store, retrieval
libs/inference/ # Transformers + llama.cpp backends
skills/ # SKILL.md + references/ + scripts/ per task
research/ # Fine-tune, ensemble experiments, agentic evals (optional)
ResearchMind (offline after ingest)
- Skills β
skills/scrape-web,scrape-pdf,extract-content,research-mind - Ingest β URL/PDF/DOCX or topic β (optional LLM URL suggest + confirm, or auto search) β chunk + embed β SQLite
- Q&A β local model + retrieved chunks with
[n]citations (no network at chat time) - Memory β persists under
RESEARCHMIND_DATA_DIR(defaultoutputs/researchmind)
Optional research tooling (not required for the Space): see research/USAGE.md.
Environment variables
| Variable | Default | Description |
|---|---|---|
ACTIVE_MODEL |
minicpm5-1b |
Preset key from models.yaml |
AGENT_OUTPUTS_DIR |
/tmp/agent_outputs |
Generated .pptx files |
AGENT_TRACES_DIR |
outputs/traces |
Agent trace JSON |
SKILLS_DIR |
./skills |
Skill definitions root |
RESEARCHMIND_DATA_DIR |
outputs/researchmind |
MemRAG DB and raw snapshots |
RESEARCHMIND_EMBED_MODEL |
all-MiniLM-L6-v2 |
Sentence embedding model |
RESEARCHMIND_AUTO_SEARCH |
false |
Default auto DuckDuckGo ingest |
See .env.example and models.yaml for model presets.
Hugging Face Space deployment
- Create a Space under build-small-hackathon with Docker SDK.
- Link this repository (root
Dockerfile+ rootREADME.mdYAML above). - Hardware: GPU basic recommended for transformers (
minicpm5-1b). - Optional secrets:
ACTIVE_MODEL,N_GPU_LAYERS(if using GGUF preset).
docker build -t hackathon-space .
docker run --rm -p 7860:7860 -e ACTIVE_MODEL=minicpm5-1b hackathon-space
Hackathon checklist
- Track: Backyard AI β lesson slide builder for a teacher you know
- Space live under build-small-hackathon
- Demo video: real user enters topic β download
.pptxβ show agent trace - Social post published
- Submission by June 15, 2026
Badge targets
- Best Agent β skill loop +
create_pptxtool - Tiny Titan β MiniCPM5 1B (β€4B)
- OpenBMB β
openbmb/MiniCPM5-1B - Sharing is Caring β upload traces with
scripts/upload_trace.py - Off-the-Grid β local inference only (no cloud LLM API)
- Well-Tuned β optional fine-tuned preset in
models.yaml(Phase 2)
Agent trace upload
uv run python scripts/upload_trace.py --repo-id YOUR_USER/build-small-agent-traces
Demo video script
- Introduce the teacher and the problem (building a 5-slide lesson takes 30+ minutes).
- Open Lesson slides, enter topic + grade, click Generate.
- Show outline preview and download the
.pptx. - Expand the agent trace JSON β local model, no cloud API.