A RAG-based API to answer questions about SightCall using curated data.
Stack:
- FastAPI for the API, pytest for automated testing
- PGVector for the vector database allowing document retrieval
- Github Actions for CI/CD pipeline
- Google Cloud Run for containerized deployment
- Terraform for automated infrastructure provisioning
- 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
.env
file that was created during installation - Find the
OPENAI_API_KEY
variable - 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.