A RAG-based API to answer questions about SightCall using curated data.
This repository also serves as a deployment demo/archive: it still contains the former GCP setup, where infrastructure was provisioned automatically with Terraform and the API was deployed on Google Cloud Run. That infrastructure flow is kept for reference, but the current active deployment workflow targets an OVH VPS because it is more cost-effective.
Stack:
- FastAPI for the API, pytest for automated testing
- PGVector for the vector database allowing document retrieval
- Github Actions for CI/CD pipeline
- OVH VPS for the current production deployment
- Google Cloud Run and Terraform as the archived demo deployment path
- First, clone and install the project:
curl -sSL https://raw.githubusercontent.com/cmnemoi/sightcall_qa_api/main/clone-and-install | bash-
Configure your OpenAI API key:
- Open the
.envfile that was created during installation - Find the
OPENAI_API_KEYvariable - Replace
sk-with your actual OpenAI API key
You can get an API key from OpenAI's API keys page if you don't have one already.
- Open the
You can interact with the API by running the following command:
curl -X POST "http://sightcall-qa.localhost/chat" \
-H "Content-Type: application/json" \
-d '{
"question": "What is SightCall?"
}'Or by accessing the API OpenAPI / Swagger documentation at http://sightcall-qa.localhost/docs.
To improve the RAG model's responses, you can index SightCall's website into the vector database by running:
make indexation- Lint code with
make lint - Run tests with
make test - Start the API locally with
make watch
The source code of this repository is licensed under the AGPL-3.0-or-later License.