A GPT chatbot for teachers that uses retrieval-augmentation to answer questions about their students.
ā ļø This project ceased active development on April 21, 2024. Pull requests are still welcomed and will be given consideration.
https://github.com/sxflynn/TeacherGPT/assets/2034081/225c88d9-ad9e-44d6-973c-a72b23a43a96
The aim of this project is to build a technical demonstration where teachers can use AI to save time on context-driven tasks. It uses a fictional school database to simulate a chatbot interacting with real school data.
š» A web frontend, built in React, with a GPT-like chat interface that interacts with the LLM inference engine
š Python-based server running FastAPI which implements retrieval augmented generation (RAG) logic, such as orchestration, agents and tool prompting. Uses GraphQL to retrieve data from Java server and the OpenAI library to connect to an LLM inference endpoint.
ā Java server running Spring Data JPA that interfaces with the PostgreSQL data store. Uses spring-boot-starter-graphql
dependency to create GraphQL resolvers and schemas.
šļøš PostgreSQL database that contains data for fictional students including attendance, grades, behavior, enrollment and special education.
git clone https://github.com/sxflynn/TeacherGPT.git
cd
into the repo
cd TeacherGPT
ls
to verify the working directory
ls
LICENSE README.md chatlogic database
docker-compose.yml schooldb titanweb
.env
file.env.example
file to .env
.
mv .env.example .env
.env
in a text editor
OPENAI_API_KEY="..."
ANYSCALE_API_KEY="..."
TOGETHERAI_API_KEY="..."
OPENAI_API_KEY="your-secret-key-in-quotes"
DEFAULT_SERVICE=TogetherAi
or
DEFAULT_SERVICE=AnyScale
Install Docker Desktop
In your terminal cd
into the repo and type:
docker compose up
After waiting several minutes for the database to initialize, go to http://localhost:5173/gpt to begin using the chat interface. You might have to docker compose down
and then docker compose up
again for it to start up correctly.
For detailed instructions on how to develop, contribute and monitor progress on each table entity, please view DEVELOPMENT.md
If you are passionate about helping teachers remove data barriers to their work and want to contribute to an open project, here are some ways you can help:
The short answer is yes, but there are caveats and considerations.
In order to build this product, we have to combine two concepts:
A retrieval-augented generation (RAG) AI application that can generate responses based on data retrieved from a datastore.
Both of these pieces have been done independently. For example, Landing Zone by Converge is a product that helps schools build central data stores that pull data from various school databases. In addition, there are a multitude of RAG application examples on GitHub that use Langchain, many of which are demonstrated on Youtube.
It would be technically feasible to combine both of these concepts together to create a RAG application that can retrieve from a centralized school-based data store.
Is it legal for sensitive student data to be ingested into an AI chatbot, given laws like FERPA? This is not legal advice, but the answer is yes, based on all the Edtech tools that already exist. There is an entire industry of Edtech products that ingest and generate sensitive student data such as grades, IEPs, behavior reports, and more. The key is that these products are only to be used by school staff, and the students. As long as a GPT product is complying with privacy regulations like not storing or training on student data, then there should not be any legal hurdles to implementing the product.
AI RAG applications are very expensive to develop and operate, which is likely one of the largest barriers to its wider adoption. There are three drivers of cost:
LLM inference engines are already quite expensive. A single chat prompt and response could cost over $1 each. If teachers spread the word to each other of the utility of this product, you could easily see costs ballooning. Schools tend to prefer flat annual pricing for Edtech products, but paying per use would be a harder sell.
Even if an Edtech consulting firm could adopt an open source tool like this that provides, it takes a lot of developer time and skill to examine all the school databases and APIs and combine them into a single cohesive database that the AI can use.
Some school data is neatly packaged in obvious databases, like a School Information System which would have student contact information and grades. Other school data might be more haphazard. If a centralized behavior tracking system like PowerSchool Behavior Support isn't being adopted by the school, then you might have teachers creating their own unique data solutions, like a personal Google Sheets to collect behavior data, or a notebook. A school might require teachers to start using a centralized system to do this work in order to enable the use of AI, and having to adjust their workflows would create a burden on teachers.