A RAG-based API to answer questions about eMush using curated data.
Stack:
- FastAPI for the API, pytest for automated testing ;
- Chroma for the vector database allowing document retrieval ;
- Github Actions and Docker Swarm for automated deployment via a CI/CD pipeline on a self-managed Digital Ocean server : https://askneron.com/docs
- Run the following command:
curl -sSL https://raw.githubusercontent.com/cmnemoi/emush_rag/main/clone-and-install | bash
- Add an OpenAI API key to the
.env
file.
You can now ask questions to the API by running the following command:
curl -X POST "http://askneron.localhost/api/questions" \
-H "Content-Type: application/json" \
-d '{
"question": "Do mycoalarms detect spore extraction?",
"chat_history": []
}'
Or by accessing the API Swagger at http://askneron.localhost/docs.
To improve the answer of the RAG model, you can index new documents in the vector database by putting them in the data
directory and running the following command:
make index-documents
- Lint code with
make lint
. - Run tests with
make test
.
The source code of this repository is licensed under the AGPL-3.0-or-later License.