# Study assistant · stage 1 This tiny, local API is the first working release of the [six-stage builder path](https://www.tomorrowailand.us/build-ai). It needs only Python 3 and makes no paid model calls. ## Quick start 1. Make sure you have Python 3.8+ installed (`python3 --version`). 2. From this directory, run: ```bash python3 stage1.py ``` 3. In a second terminal, try: ```bash curl 'http://127.0.0.1:8001/api/ask?q=What%20is%20a%20training%20set' curl 'http://127.0.0.1:8001/api/ask?q=What%20is%20retrieval' curl 'http://127.0.0.1:8001/api/ask?q=What%20is%20a%20galaxy' curl 'http://127.0.0.1:8001/api/ask' ``` Inspect the JSON response, source URL, 200/400 status codes, and the refusal when the notes do not cover a question. Change one note and rerun the same questions. The lookup is deliberately simple; it matches words and can miss synonyms. Later stages replace it with better retrieval and add a model behind a server-side API. Keep API keys out of browser code and Git. ## Common first errors - **`python3: command not found`** — Install Python 3 from python.org or use `python` if that points to 3.x. - **`Address already in use`** — Something else is using port 8001. Kill it or edit the port in `stage1.py`. - **Module / import errors** — This starter uses only the Python standard library. Make sure you're running the file from the correct directory. - **Empty or unexpected JSON** — Check that the server printed a "Running on http://127.0.0.1:8001" message before you curl. Today's 30 minutes: 5 minutes recall how HTTP request and response work; 20 minutes run and modify the starter; 5 minutes write one takeaway and one question.