This project is a lightweight AI-powered study assistant built with FastAPI and the OpenAI API.
It provides endpoints for text summarisation, structured note generation, and Q&A, making it easier to work with study materials.
/summarise: Produce a clear, concise summary of input text/notes: Turn raw text into structured study notes with headings and bullet points/qa: Answer questions, optionally grounded in a given context passage
- Backend: FastAPI (Python)
- AI: OpenAI
gpt-4o-minivia the async client (AsyncOpenAI) - Data modelling: Pydantic request/response models
- The client sends a JSON request to one of the endpoints.
- The API constructs a system prompt and user message based on the endpoint.
- The service calls the OpenAI Chat Completions API through a shared helper function.
- The response is validated and returned as a structured JSON payload.
The OpenAI client is lazily initialised using the OPENAI_API_KEY environment variable.
If the key is missing, the API responds with a 503 error so configuration issues surface early.
POST /summarisePOST /notesPOST /qa
You can explore and test them via the built-in Swagger UI at /docs once the server is running.
- Add authentication and basic rate limiting
- Add a simple frontend (React or Next.js) to interact with the assistant
- Introduce retrieval-augmented generation (RAG) using a vector store
- Log prompts and responses for analysis and prompt optimisation
Jingjing Wang