simple RAG example
Install uv to install and manage python dependencies.
Install Docker Engine to build and run the API's Docker image locally.
make install
The project includes an API built with FastAPI. Its code can be found at src/api
.
The API is containerized using a Docker image, built from the Dockerfile
and docker-compose.yml
at the root. This is optional, you can also run the API without docker.
Copy .env_example to .env and fill in the values.
To build and start the API, use the following Makefile command:
make dev-api
you can also use make start-api
to start the API using Docker.
The project includes a frontend built with Streamlit. Its code can be found at demo
.
Run the frontend with:
make start-app
To run unit tests, run pytest
with:
make test
There is some preset up formatting and static analysis tools to help you write clean code. check the make file for more details.
make lint
make format
make typecheck
Have a look in ai_exercise/constants.py
. Then check out the server routes in ai_exercise/main.py
.
-
Load some documents by calling the
/load
endpoint. Does the system work as intended? Are there any issues? -
Find some method of evaluating the quality of the retrieval system.
-
See how you can improve the retrieval system. Some ideas:
- Play with the chunking logic
- Try different embeddings models
- Other types of models which may be relevant
- How else could you store the data for better retrieval?