https://github.com/stackonehq/interview-ai-exercise
Example repo for AI interviews (document retrieval)
https://github.com/stackonehq/interview-ai-exercise
Last synced: 6 months ago
JSON representation
Example repo for AI interviews (document retrieval)
- Host: GitHub
- URL: https://github.com/stackonehq/interview-ai-exercise
- Owner: StackOneHQ
- Created: 2024-11-15T15:59:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-23T14:30:26.000Z (about 1 year ago)
- Last Synced: 2025-06-19T04:38:11.082Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 220 KB
- Stars: 0
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AI Exercise - Retrieval
> simple RAG example
## Project requirements
### uv
Install [uv](https://docs.astral.sh/uv/getting-started/installation/) to install and manage python dependencies.
### Docker Engine (optional)
Install [Docker Engine](https://docs.docker.com/engine/install/) to build and run the API's Docker image locally.
## Installation
```bash
make install
```
## API
The project includes an API built with [FastAPI](https://fastapi.tiangolo.com/). Its code can be found at `src/api`.
The API is containerized using a [Docker](https://docs.docker.com/get-started/) image, built from the `Dockerfile` and `docker-compose.yml` at the root. This is optional, you can also run the API without docker.
### Environment Variables
Copy .env_example to .env and fill in the values.
### Build and start the API
To build and start the API, use the following Makefile command:
```bash
make dev-api
```
you can also use `make start-api` to start the API using Docker.
## Frontend
The project includes a frontend built with [Streamlit](https://streamlit.io/). Its code can be found at `demo`.
Run the frontend with:
```bash
make start-app
```
## Testing
To run unit tests, run `pytest` with:
```bash
make test
```
## Formatting and static analysis
There is some preset up formatting and static analysis tools to help you write clean code. check the make file for more details.
```bash
make lint
```
```bash
make format
```
```bash
make typecheck
```
# Get Started
Have a look in `ai_exercise/constants.py`. Then check out the server routes in `ai_exercise/main.py`.
1. Load some documents by calling the `/load` endpoint. Does the system work as intended? Are there any issues?
2. Find some method of evaluating the quality of the retrieval system.
3. 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?