Spaces:
Sleeping
title: Feedback Chatbot
emoji: π
colorFrom: purple
colorTo: green
sdk: docker
app_port: 7860
pinned: false
Quick start
- Duplicate this Space on Hugging Face.
- In your Space β Settings β Variables and secrets, add:
HF_TOKENβ required; use a token with write access so the app can create/sync the dataset.APP_PASSWORDβ strongly recommended if the Space is public/protected; default ispassword.
- Optional overrides:
APP_USERNAMEβ defaults tostudent.DATASET_IDβ defaults to<SPACE_ID>-corpuson Spaces and is created automatically when needed.ADMIN_PASSCODEβ defaults topassword; set this for real deployments.- (optional)
LLM_MODELβ defaults todeepseek-ai/DeepSeek-V4-Flash; change this Space variable to switch models without a code push. - (optional)
LLM_MAX_TOKENSβ defaults to8192. - (optional)
LLM_FINAL_ANSWER_MAX_TOKENSβ defaults to8192. - (optional)
EMBED_MODELβ defaults toBAAI/bge-small-en-v1.5.
- Restart the Space. Open
/admin, sign in with the passcode, and upload rubric files (.pdf,.docx,.txt,.md). - Share the root URL with students. They can paste or upload tutor feedback and upload coursework locally for the chat session.
Student-uploaded tutor feedback and coursework are parsed in the running app and sent as chat context only. They are not saved to the linked Hugging Face Dataset. The Dataset stores teacher-uploaded rubrics and the vector cache used to retrieve rubric excerpts.
Local development
Requires Python 3.13, Node 20+, and uv.
cp .env.example .env # fill in HF_TOKEN; other values have defaults
# Backend
cd backend && uv sync && uv run uvicorn main:app --port 8000 --reload
# Frontend (in another shell)
cd frontend && npm install && npm run dev
Visit http://localhost:7860. Next.js proxies /api/* to 127.0.0.1:8000.
Or with Docker (matches the HF Space environment exactly)
docker build -t iamearthdev .
docker run --rm -p 7860:7860 --env-file .env iamearthdev
Customizing personas
Edit frontend/lib/personas.ts β each persona is just an
id, name, description, and a prompt that gets prepended to the system message.
Rebuild the Space to deploy.
Repo layout
/
βββ Dockerfile # multi-stage: Next build β Python+Node runtime
βββ start.sh # launches FastAPI (:8000) and Next.js (:7860)
βββ .env.example
βββ backend/
β βββ pyproject.toml # uv-managed deps
β βββ main.py # FastAPI app, /chat streams NDJSON
β βββ rag.py # rubric parsing β LlamaIndex β LanceDB
β βββ hf_sync.py # Dataset sync for rubrics and vector cache
β βββ auth.py # passcode cookie middleware
βββ frontend/
βββ next.config.js # /api/* β http://127.0.0.1:8000/*
βββ package.json
βββ app/
β βββ page.tsx # chat UI
β βββ admin/page.tsx # upload + file list
β βββ admin/login/page.tsx
βββ components/ # chat-interface, persona-selector, file-uploader, β¦
License
This project is released under the MIT License.
MIT License
Copyright (c) 2026 Dr Noorhan Abbas and Sen Lin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Citation
If you use or adapt this tool in your work, please cite:
Abbas, N. (under review). Investigating Student Perceptions of an AI-Powered Chatbot to Support Feedback Interpretation and Uptake in Higher Education. Manuscript submitted to Assessment and Evaluation in Higher Education.