/resumai

An AI powered API for my resume

Primary LanguagePython

ResumAI API

🔗 https://resumai.fly.dev/docs.

This is a FastAPI application that serves as the backend for the ResumAI web app.

For the web app, see the repo for my personal site.

Tech stack

The ResumAI API is built with FastAPI which itself uses Pydantic for data validation and OpenAPI for API documentation. The API is served by Uvicorn and is deployed to Fly.io.

The /chat endpoint magic is done via LangChain which uses OpenAI's GPT-3.5 to generate text. I feed my entire resume into the prompt on every request so that the bot can use it to generate responses.

Notes

This is just for fun and a lot of steps have been skipped for the sake of convenience. If you want to copy or productise this, here are some optimisations I'd highly recommend:

  • Fine-tune your own model using OpenAI's fine-tuning or something like PrivateGPT. Feeding the entire resume as JSON into the prompt every time like I do here is extremely token inefficient.
  • Store conversations at least ephemerally so that the bot can remember context, this will also save tokens plus it's better UX. This is possible with LangChain but I haven't implemented it here.
  • If you just want the chat interface and don't need the other endpoints, don't hardcode your entire resume as code into the repo. Use some document loaders to extract all the text out of actual resumes in .doc or .pdf format and hope GPT-4 can map it to your schemas.
  • There is basically no prompt injection protection. If this matters to you, I'd highly suggest adding some

Additionally, as far as best practises goes there is no error handling and there are no tests.

Todo

  • Optimise prompt to remove unnecessary whitespace
  • Use LangChain conversations to allow multiple messages within a single conversation
  • Add response language support (maybe)
  • Add bot persona support (maybe)